lang: parser: Try to add the end values in parser

Not sure if this is right, but it's a start.
This commit is contained in:
James Shubin
2025-06-06 02:36:20 -04:00
parent cdc6743d83
commit 58461323b9
7 changed files with 31 additions and 18 deletions

View File

@@ -12,4 +12,4 @@ class c1($a, $b []str) {
}
}
-- OUTPUT --
# err: errUnify: type error: list != str: /main.mcl @ 4:1-4:25
# err: errUnify: type error: list != str: /main.mcl @ 4:1-4:26

View File

@@ -15,4 +15,4 @@ test ["x",] {
float32 => $b,
}
-- OUTPUT --
# err: errUnify: type error: int != float: /main.mcl @ 10:6-10:22
# err: errUnify: type error: int != float: /main.mcl @ 10:6-10:25

View File

@@ -3,4 +3,4 @@ test "t1" {
stringptr => 42, # int, not str
}
-- OUTPUT --
# err: errUnify: type error: str != int: /main.mcl @ 2:2-2:17
# err: errUnify: type error: str != int: /main.mcl @ 2:2-2:18

View File

@@ -7,4 +7,4 @@ test "test" {}
Test["${name}"] -> Test["test"] # must fail
-- OUTPUT --
# err: errUnify: type error: str != list: /main.mcl @ 6:1-6:15
# err: errUnify: type error: str != list: /main.mcl @ 6:1-6:16

View File

@@ -7,4 +7,4 @@ test "test" {}
Test["test"] -> Test["${name}"] # must fail
-- OUTPUT --
# err: errUnify: type error: str != list: /main.mcl @ 6:17-6:31
# err: errUnify: type error: str != list: /main.mcl @ 6:17-6:32

View File

@@ -5,4 +5,4 @@ $name = ["a", "bb", "ccc",]
test "${name}" {} # must fail
-- OUTPUT --
# err: errUnify: type error: str != list: /main.mcl @ 4:1-4:17
# err: errUnify: type error: str != list: /main.mcl @ 4:1-4:18