1
0
Fork 0
mirror of https://github.com/Reuh/anselme.git synced 2025-10-27 16:49:31 +00:00

[internal] do block parsing at the same time as expression parsing

This commit is contained in:
Étienne Fildadut 2024-01-15 17:10:30 +01:00
parent 09b73301b4
commit 1ea06c63eb
50 changed files with 240 additions and 249 deletions

View file

@ -10,7 +10,7 @@
--- error ---
cancel merge
↳ from test/tests/checkpoint merging mutable value.ans:24:6 in call: error("cancel merge")
↳ from ? in block: :l = *[1, 2]…
↳ from test/tests/checkpoint merging mutable value.ans:1:1 in block: :l = *[1, 2]…
--# post run check #--
--- text ---
| {}"1,2,3,4: " {}"*[1, 2, 3, 4]" {}"" |

View file

@ -10,7 +10,7 @@
--- error ---
cancel merge
↳ from test/tests/checkpoint merging variable.ans:24:6 in call: error("cancel merge")
↳ from ? in block: :l = 1…
↳ from test/tests/checkpoint merging variable.ans:1:1 in block: :l = 1…
--# post run check #--
--- text ---
| {}"3: " {}"3" {}"" |

View file

@ -5,6 +5,6 @@
no variable "y" defined in closure
↳ from test/tests/closure define nested.ans:12:4 in call: f . "y"
↳ from test/tests/closure define nested.ans:12:1 in text interpolation: | {f . "y"} |
↳ from ? in block: :f = ($() _)…
↳ from test/tests/closure define nested.ans:1:1 in block: :f = ($() _)…
--# saved #--
{}

View file

@ -2,6 +2,6 @@
--- error ---
trying to change the value of constant a
↳ from test/tests/constant variable.ans:5:3 in call: a = 52
↳ from ? in block: ::a = 3…
↳ from test/tests/constant variable.ans:1:1 in block: ::a = 3…
--# saved #--
{}

View file

@ -6,6 +6,6 @@
--- error ---
value check failure for weigh; 32 does not satisfy $(x) type(x) == t
↳ from test/tests/constrained variable assignement.ans:9:7 in call: weigh = 32
↳ from ? in block: :weigh::is("kg") = type(5, "kg")…
↳ from test/tests/constrained variable assignement.ans:1:1 in block: :weigh::is("kg") = type(5, "kg")…
--# saved #--
{}

View file

@ -2,6 +2,6 @@
--- error ---
a is already defined in the current scope
↳ from test/tests/define override function.ans:4:4 in call: :a = 2
↳ from ? in block: :a = ($() _)…
↳ from test/tests/define override function.ans:1:1 in block: :a = ($() _)…
--# saved #--
{}

View file

@ -2,6 +2,6 @@
--- error ---
can't add an overload variant to non-overloadable variable a defined in the same scope
↳ from test/tests/define override variable.ans:3:1 in call: :a = ($() _)
↳ from ? in block: :a = 2…
↳ from test/tests/define override variable.ans:1:1 in block: :a = 2…
--# saved #--
{}

View file

@ -2,6 +2,6 @@
--- error ---
a is already defined in the current scope
↳ from test/tests/define override.ans:3:4 in call: :a = 2
↳ from ? in block: :a = 5…
↳ from test/tests/define override.ans:1:1 in block: :a = 5…
--# saved #--
{}

View file

@ -2,6 +2,6 @@
--- error ---
nope
↳ from test/tests/error.ans:1:6 in call: error("nope")
↳ from ? in block: error("nope")
↳ from test/tests/error.ans:1:1 in block: error("nope")
--# saved #--
{}

View file

@ -8,6 +8,6 @@
identifier "z" is undefined in branch test/tests/exported variable nested.ans - run
↳ from test/tests/exported variable nested.ans:12:3 in identifier: z
↳ from test/tests/exported variable nested.ans:12:1 in text interpolation: | {z} |
↳ from ? in block: :f = ($() _)…
↳ from test/tests/exported variable nested.ans:1:1 in block: :f = ($() _)…
--# saved #--
{}

View file

@ -11,9 +11,9 @@
value check failure for parameter s
↳ from stdlib/for.ans:3:18 in call: iter(var)
↳ from stdlib/for.ans:3:12 in call: :iterator = iter(var)
↳ from stdlib/for.ans:2:1 in block: :iterator = iter(var)…
↳ from stdlib/for.ans:2:71 in call: _
↳ from stdlib/for.ans:3:1 in block: :iterator = iter(var)…
↳ from stdlib/for.ans:2:70 in call: _
↳ from test/tests/for invalid iterator.ans:1:4 in call: for(:x, 42)
↳ from ? in block: for(:x, 42)…
↳ from test/tests/for invalid iterator.ans:1:1 in block: for(:x, 42)…
--# saved #--
{}

View file

@ -2,6 +2,6 @@
--- error ---
can't call function f: expected 2 arguments, received 1
↳ from test/tests/function args arity check fail.ans:4:2 in call: f("ok")
↳ from ? in block: :f = ($(a, b) _)…
↳ from test/tests/function args arity check fail.ans:1:1 in block: :f = ($(a, b) _)…
--# saved #--
{}

View file

@ -2,6 +2,6 @@
--- error ---
a function with parameters $(a, b) is already defined in the overload
↳ from test/tests/function conflict.ans:5:1 in call: :f = ($(a, b) 0)
↳ from ? in block: :f = ($(a, b) 0)…
↳ from test/tests/function conflict.ans:1:1 in block: :f = ($(a, b) 0)…
--# saved #--
{}

View file

@ -10,6 +10,6 @@
• $(name::($(x) type(x) == t)) (from test/tests/function custom type dispatch error.ans:4:1):
value check failure for parameter name
↳ from test/tests/function custom type dispatch error.ans:14:2 in call: a(type(5, "nope"))
↳ from ? in block: :french name = "french name"…
↳ from test/tests/function custom type dispatch error.ans:1:1 in block: :french name = "french name"…
--# saved #--
{}

View file

@ -3,6 +3,6 @@
identifier "b" is undefined in branch test/tests/function scope wrong.ans - run
↳ from test/tests/function scope wrong.ans:4:7 in identifier: b
↳ from test/tests/function scope wrong.ans:4:1 in text interpolation: | a: {b} |
↳ from ? in block: :a = ($() _)…
↳ from test/tests/function scope wrong.ans:1:1 in block: :a = ($() _)…
--# saved #--
{}

View file

@ -21,6 +21,6 @@
value check failure for parameter c
↳ from test/tests/function separate variable from variants.ans:10:4 in call: f . "a"
↳ from test/tests/function separate variable from variants.ans:10:1 in text interpolation: | {f . "a"} = 2 |
↳ from ? in block: :f = ($() _)…
↳ from test/tests/function separate variable from variants.ans:1:1 in block: :f = ($() _)…
--# saved #--
{}

View file

@ -4,6 +4,6 @@
• $(x::is number) (from test/tests/function type dispatch ambigous.ans:1:1)
• $(a::is number) (from test/tests/function type dispatch ambigous.ans:4:1)
↳ from test/tests/function type dispatch ambigous.ans:7:3 in call: fn(5)
↳ from ? in block: :fn = ($(x::is number) _)…
↳ from test/tests/function type dispatch ambigous.ans:1:1 in block: :fn = ($(x::is number) _)…
--# saved #--
{}

View file

@ -12,6 +12,6 @@
--- error ---
list index out of bounds
↳ from test/tests/list assignement.ans:21:6 in call: x(5) = 0
↳ from ? in block: :x = *[1, 2]…
↳ from test/tests/list assignement.ans:1:1 in block: :x = *[1, 2]…
--# saved #--
{}

View file

@ -11,6 +11,6 @@
tuple index out of bounds
↳ from test/tests/list index.ans:11:4 in call: x(-4)
↳ from test/tests/list index.ans:11:1 in text interpolation: | {x(-4)} |
↳ from ? in block: :x = [1, 2, 3]…
↳ from test/tests/list index.ans:1:1 in block: :x = [1, 2, 3]…
--# saved #--
{}

View file

@ -3,6 +3,6 @@
no variable "b" defined in environment
↳ from test/tests/load file error.ans:3:4 in call: e . "b"
↳ from test/tests/load file error.ans:3:1 in text interpolation: | {e . "b"} |
↳ from ? in block: :e = load("test/tests/import/test.ans")…
↳ from test/tests/load file error.ans:1:1 in block: :e = load("test/tests/import/test.ans")…
--# saved #--
{}

View file

@ -2,18 +2,18 @@
--- error ---
abort
↳ from test/tests/merge nested mutable error bis.ans:14:7 in call: error("abort")
↳ from test/tests/merge nested mutable error bis.ans:3:1 in block: insert(a, b)…
↳ from test/tests/merge nested mutable error bis.ans:4:1 in block: insert(a, b)…
↳ from test/tests/merge nested mutable error bis.ans:3:18 in call: _
↳ from stdlib/script.ans:31:6 in call: fn!
↳ from stdlib/script.ans:29:3 in block: resume target = ()…
↳ from stdlib/script.ans:30:1 in block: resume target = ()…
↳ from stdlib/script.ans:29:7 in call: else!
↳ from stdlib/script.ans:25:2 in block: if(fn . "current checkpoint")…
↳ from stdlib/script.ans:25:9 in call: _
↳ from stdlib/script.ans:26:1 in block: if(fn . "current checkpoint")…
↳ from stdlib/script.ans:25:8 in call: _
↳ from stdlib/script.ans:39:9 in call: value(s)!
↳ from stdlib/script.ans:38:1 in block: value(s)!
↳ from stdlib/script.ans:38:20 in call: _
↳ from stdlib/script.ans:39:1 in block: value(s)!
↳ from stdlib/script.ans:38:19 in call: _
↳ from test/tests/merge nested mutable error bis.ans:19:2 in call: f!
↳ from ? in block: :a = *[1]…
↳ from test/tests/merge nested mutable error bis.ans:1:1 in block: :a = *[1]…
--# post run check #--
--- text ---
| {}"[1,[2,3]]: " {}"*[1, *[2, 3]]" {}"" |

View file

@ -2,18 +2,18 @@
--- error ---
abort
↳ from test/tests/merge nested mutable error.ans:14:7 in call: error("abort")
↳ from test/tests/merge nested mutable error.ans:3:1 in block: insert(a, b)…
↳ from test/tests/merge nested mutable error.ans:4:1 in block: insert(a, b)…
↳ from test/tests/merge nested mutable error.ans:3:18 in call: _
↳ from stdlib/script.ans:31:6 in call: fn!
↳ from stdlib/script.ans:29:3 in block: resume target = ()…
↳ from stdlib/script.ans:30:1 in block: resume target = ()…
↳ from stdlib/script.ans:29:7 in call: else!
↳ from stdlib/script.ans:25:2 in block: if(fn . "current checkpoint")…
↳ from stdlib/script.ans:25:9 in call: _
↳ from stdlib/script.ans:26:1 in block: if(fn . "current checkpoint")…
↳ from stdlib/script.ans:25:8 in call: _
↳ from stdlib/script.ans:39:9 in call: value(s)!
↳ from stdlib/script.ans:38:1 in block: value(s)!
↳ from stdlib/script.ans:38:20 in call: _
↳ from stdlib/script.ans:39:1 in block: value(s)!
↳ from stdlib/script.ans:38:19 in call: _
↳ from test/tests/merge nested mutable error.ans:19:2 in call: f!
↳ from ? in block: :a = *[1]…
↳ from test/tests/merge nested mutable error.ans:1:1 in block: :a = *[1]…
--# post run check #--
--- text ---
| {}"[1,[2,3]]: " {}"*[1, *[2, 3]]" {}"" |

View file

@ -16,15 +16,15 @@
--- error ---
t
↳ from test/tests/scope checkpoint mutable bis error.ans:32:7 in call: error("t")
↳ from test/tests/scope checkpoint mutable bis error.ans:7:1 in block: insert(t, len(l) + 1)…
↳ from test/tests/scope checkpoint mutable bis error.ans:7:8 in call: _
↳ from test/tests/scope checkpoint mutable bis error.ans:8:1 in block: insert(t, len(l) + 1)…
↳ from test/tests/scope checkpoint mutable bis error.ans:7:7 in call: _
↳ from test/tests/scope checkpoint mutable bis error.ans:19:4 in call: f(t)
↳ from test/tests/scope checkpoint mutable bis error.ans:15:2 in block: | REC |…
↳ from test/tests/scope checkpoint mutable bis error.ans:16:1 in block: | REC |…
↳ from test/tests/scope checkpoint mutable bis error.ans:15:4 in call: if(n < 1)
↳ from test/tests/scope checkpoint mutable bis error.ans:7:1 in block: insert(t, len(l) + 1)…
↳ from test/tests/scope checkpoint mutable bis error.ans:7:8 in call: _
↳ from test/tests/scope checkpoint mutable bis error.ans:8:1 in block: insert(t, len(l) + 1)…
↳ from test/tests/scope checkpoint mutable bis error.ans:7:7 in call: _
↳ from test/tests/scope checkpoint mutable bis error.ans:41:2 in call: f(l)
↳ from ? in block: :x = *[99]…
↳ from test/tests/scope checkpoint mutable bis error.ans:1:1 in block: :x = *[99]…
--# post run check #--
--- text ---
| {}"AFTER ERROR" |

View file

@ -12,15 +12,15 @@
--- error ---
t
↳ from test/tests/scope checkpoint mutable error.ans:23:7 in call: error("t")
↳ from test/tests/scope checkpoint mutable error.ans:5:1 in block: insert(t, len(l) + 1)…
↳ from test/tests/scope checkpoint mutable error.ans:5:8 in call: _
↳ from test/tests/scope checkpoint mutable error.ans:6:1 in block: insert(t, len(l) + 1)…
↳ from test/tests/scope checkpoint mutable error.ans:5:7 in call: _
↳ from test/tests/scope checkpoint mutable error.ans:17:4 in call: f(t)
↳ from test/tests/scope checkpoint mutable error.ans:13:2 in block: | REC |…
↳ from test/tests/scope checkpoint mutable error.ans:14:1 in block: | REC |…
↳ from test/tests/scope checkpoint mutable error.ans:13:4 in call: if(n < 1)
↳ from test/tests/scope checkpoint mutable error.ans:5:1 in block: insert(t, len(l) + 1)…
↳ from test/tests/scope checkpoint mutable error.ans:5:8 in call: _
↳ from test/tests/scope checkpoint mutable error.ans:6:1 in block: insert(t, len(l) + 1)…
↳ from test/tests/scope checkpoint mutable error.ans:5:7 in call: _
↳ from test/tests/scope checkpoint mutable error.ans:32:2 in call: f(l)
↳ from ? in block: :l = *[1]…
↳ from test/tests/scope checkpoint mutable error.ans:1:1 in block: :l = *[1]…
--# post run check #--
--- text ---
| {}"AFTER ERROR" |

View file

@ -16,15 +16,15 @@
--- error ---
t
↳ from test/tests/scope checkpoint mutable ter error.ans:34:7 in call: error("t")
↳ from test/tests/scope checkpoint mutable ter error.ans:7:1 in block: insert(t, len(l) + 1)…
↳ from test/tests/scope checkpoint mutable ter error.ans:7:8 in call: _
↳ from test/tests/scope checkpoint mutable ter error.ans:8:1 in block: insert(t, len(l) + 1)…
↳ from test/tests/scope checkpoint mutable ter error.ans:7:7 in call: _
↳ from test/tests/scope checkpoint mutable ter error.ans:19:4 in call: f(t)
↳ from test/tests/scope checkpoint mutable ter error.ans:15:2 in block: | REC |…
↳ from test/tests/scope checkpoint mutable ter error.ans:16:1 in block: | REC |…
↳ from test/tests/scope checkpoint mutable ter error.ans:15:4 in call: if(n < 1)
↳ from test/tests/scope checkpoint mutable ter error.ans:7:1 in block: insert(t, len(l) + 1)…
↳ from test/tests/scope checkpoint mutable ter error.ans:7:8 in call: _
↳ from test/tests/scope checkpoint mutable ter error.ans:8:1 in block: insert(t, len(l) + 1)…
↳ from test/tests/scope checkpoint mutable ter error.ans:7:7 in call: _
↳ from test/tests/scope checkpoint mutable ter error.ans:43:2 in call: f(l)
↳ from ? in block: :x = *[99]…
↳ from test/tests/scope checkpoint mutable ter error.ans:1:1 in block: :x = *[99]…
--# post run check #--
--- text ---
| {}"AFTER ERROR" |

View file

@ -7,6 +7,6 @@
--- error ---
trying to change the value of constant d
↳ from test/tests/symbol alias constant.ans:12:3 in call: d = 5
↳ from ? in block: :l = *[1, 2, 3]…
↳ from test/tests/symbol alias constant.ans:1:1 in block: :l = *[1, 2, 3]…
--# saved #--
{}