diff options
author | Juan J. Martinez <jjm@usebox.net> | 2022-09-12 20:16:42 +0100 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2022-09-12 20:16:42 +0100 |
commit | 8fe1fc0c2b0b10f64c43498481e738221fe03bb3 (patch) | |
tree | 3a934f555abfbee3881f171377f64dd2f31107d0 /test/Language.hs | |
parent | fea91d8e7e61693d8ece149bac91d7acda16453d (diff) | |
download | micro-lang-hs-8fe1fc0c2b0b10f64c43498481e738221fe03bb3.tar.gz micro-lang-hs-8fe1fc0c2b0b10f64c43498481e738221fe03bb3.zip |
Track local variables, WIP code gen
Diffstat (limited to 'test/Language.hs')
-rw-r--r-- | test/Language.hs | 14 |
1 files changed, 7 insertions, 7 deletions
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" $ |