From 8fe1fc0c2b0b10f64c43498481e738221fe03bb3 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Mon, 12 Sep 2022 20:16:42 +0100 Subject: Track local variables, WIP code gen --- test/Language.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'test/Language.hs') diff --git a/test/Language.hs b/test/Language.hs index 1965883..3e6a898 100644 --- a/test/Language.hs +++ b/test/Language.hs @@ -176,7 +176,7 @@ testCases = "module main\n\ \var a: u8 = 10;" [ A.Module "main" $ newPos "-" 1 1, - A.Var "a" (A.Type "u8") (A.Num 10 $ newPos "-" 2 13) False $ newPos "-" 2 5 + A.Var "a" (A.Type "u8") (A.Num 10 $ newPos "-" 2 13) False False $ newPos "-" 2 5 ], TestLabel "parse a private variable declaration" $ TestCase $ @@ -184,7 +184,7 @@ testCases = "module main\n\ \private var a: u8 = 10;" [ A.Module "main" $ newPos "-" 1 1, - A.Var "a" (A.Type "u8") (A.Num 10 $ newPos "-" 2 21) True $ newPos "-" 2 13 + A.Var "a" (A.Type "u8") (A.Num 10 $ newPos "-" 2 21) False True $ newPos "-" 2 13 ], TestLabel "parse a group variable declaration" $ TestCase $ @@ -193,8 +193,8 @@ testCases = \var (a: u8 = 10,\n\ \b: bool = true);" [ A.Module "main" $ newPos "-" 1 1, - A.Var "a" (A.Type "u8") (A.Num 10 $ newPos "-" 2 14) False $ newPos "-" 2 6, - A.Var "b" (A.Type "bool") (A.Bool' True $ newPos "-" 3 11) False $ newPos "-" 3 1 + A.Var "a" (A.Type "u8") (A.Num 10 $ newPos "-" 2 14) False False $ newPos "-" 2 6, + A.Var "b" (A.Type "bool") (A.Bool' True $ newPos "-" 3 11) False False $ newPos "-" 3 1 ], TestLabel "parse a group of private variable declaration" $ TestCase $ @@ -203,8 +203,8 @@ testCases = \private var (a: u8 = 10,\n\ \b: bool = true);" [ A.Module "main" $ newPos "-" 1 1, - A.Var "a" (A.Type "u8") (A.Num 10 $ newPos "-" 2 22) True $ newPos "-" 2 14, - A.Var "b" (A.Type "bool") (A.Bool' True $ newPos "-" 3 11) True $ newPos "-" 3 1 + A.Var "a" (A.Type "u8") (A.Num 10 $ newPos "-" 2 22) True False $ newPos "-" 2 14, + A.Var "b" (A.Type "bool") (A.Bool' True $ newPos "-" 3 11) True False $ newPos "-" 3 1 ], TestLabel "parse assignation" $ TestCase $ @@ -213,7 +213,7 @@ testCases = \var a: u8 = 0;\n\ \a = 10;" [ A.Module "main" $ newPos "-" 1 1, - A.Var "a" (A.Type "u8") (A.Num 0 $ newPos "-" 2 13) False $ newPos "-" 2 5, + A.Var "a" (A.Type "u8") (A.Num 0 $ newPos "-" 2 13) False False $ newPos "-" 2 5, A.BinOp A.Assign (newPos "-" 3 5) (A.Variable "a" $ newPos "-" 3 1) (A.Num 10 $ newPos "-" 3 5) ], TestLabel "fold constant addition" $ -- cgit v1.2.3