mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-27 16:49:31 +00:00
Update tests
This commit is contained in:
parent
a79b054bfb
commit
a85e7ab0af
73 changed files with 246 additions and 157 deletions
38
anselme/state/calling_environment_manager.lua
Normal file
38
anselme/state/calling_environment_manager.lua
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
local class = require("anselme.lib.class")
|
||||||
|
|
||||||
|
local ast = require("anselme.ast")
|
||||||
|
local Identifier
|
||||||
|
|
||||||
|
-- stack of resumable contexts
|
||||||
|
local calling_env_identifier, calling_env_symbol
|
||||||
|
|
||||||
|
local calling_environment_manager = class {
|
||||||
|
init = false,
|
||||||
|
|
||||||
|
push = function(self, state, calling_environment)
|
||||||
|
state.scope:push_partial(calling_env_identifier)
|
||||||
|
state.scope:define(calling_env_symbol, calling_environment)
|
||||||
|
end,
|
||||||
|
pop = function(self, state)
|
||||||
|
state.scope:pop()
|
||||||
|
end,
|
||||||
|
|
||||||
|
get_level = function(self, state, level)
|
||||||
|
local env = state.scope:capture()
|
||||||
|
while level > 0 do
|
||||||
|
assert(env:defined(state, calling_env_identifier), "no calling function")
|
||||||
|
env = env:get(state, calling_env_identifier)
|
||||||
|
level = level - 1
|
||||||
|
end
|
||||||
|
return env
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
package.loaded[...] = calling_environment_manager
|
||||||
|
|
||||||
|
Identifier = ast.Identifier
|
||||||
|
|
||||||
|
calling_env_identifier = Identifier:new("_calling_environment")
|
||||||
|
calling_env_symbol = calling_env_identifier:to_symbol()
|
||||||
|
|
||||||
|
return calling_environment_manager
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
--- text ---
|
--- text ---
|
||||||
| {}"" {}"type(\"kg\", 12)" {}"" |
|
| {}"" {}"type(\"kg\", 12)" {}"" |
|
||||||
--- error ---
|
--- error ---
|
||||||
[0m[31m[0m[31mtype check failure for weigh; 32 does not satisfy ($(x) type(x) == t)[0m
|
[0m[31m[0m[31mtype check failure for weigh; 32 does not satisfy $(x) type(x) == t[0m
|
||||||
↳ from [4mtest/tests/constrained variable assignement.ans:9:7[0m in assignment: [2mweigh = 32[0m[0m
|
↳ from [4mtest/tests/constrained variable assignement.ans:9:7[0m in assignment: [2mweigh = 32[0m[0m
|
||||||
↳ from [4m?[0m in block: [2m:weigh::is("kg") = type(5, "kg")…[0m
|
↳ from [4m?[0m in block: [2m:weigh::is("kg") = type(5, "kg")…[0m
|
||||||
--# saved #--
|
--# saved #--
|
||||||
|
|
|
||||||
7
test/results/default attached block.ans
Normal file
7
test/results/default attached block.ans
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
--# run #--
|
||||||
|
--- text ---
|
||||||
|
| {}"ok" |
|
||||||
|
--- return ---
|
||||||
|
()
|
||||||
|
--# saved #--
|
||||||
|
{"fn.checkpoint":false, "fn.run":1}
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
--- text ---
|
--- text ---
|
||||||
| {}"" {}"42" {}"" |
|
| {}"" {}"42" {}"" |
|
||||||
--- error ---
|
--- error ---
|
||||||
[0m[31m[0m[31m[0m[31m[0m[31midentifier "z" is undefined in branch 1228bcf1-5118-4955-10048-8fda790007be[0m
|
[0m[31m[0m[31m[0m[31m[0m[31midentifier "z" is undefined in branch cf017f8a-7c86-4871-109af-6658231331e6[0m
|
||||||
↳ from [4mtest/tests/exported variable nested.ans:12:3[0m in identifier: [2mz[0m[0m
|
↳ from [4mtest/tests/exported variable nested.ans:12:3[0m in identifier: [2mz[0m[0m
|
||||||
↳ from [4mtest/tests/exported variable nested.ans:12:1[0m in text interpolation: [2m| {z} |[0m[0m
|
↳ from [4mtest/tests/exported variable nested.ans:12:1[0m in text interpolation: [2m| {z} |[0m[0m
|
||||||
↳ from [4mtest/tests/exported variable nested.ans:12:1[0m in translatable: [2m| {z} |[0m[0m
|
↳ from [4mtest/tests/exported variable nested.ans:12:1[0m in translatable: [2m| {z} |[0m[0m
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
--# run #--
|
--# run #--
|
||||||
--- error ---
|
--- error ---
|
||||||
[0m[31m[0m[31mcan't call closure ($(a, b) _): expected 2 arguments, received 1[0m
|
[0m[31m[0m[31mcan't call function $(a, b) _: expected 2 arguments, received 1[0m
|
||||||
↳ from [4mtest/tests/function args arity check fail.ans:4:2[0m in call: [2mf("ok")[0m[0m
|
↳ from [4mtest/tests/function args arity check fail.ans:4:2[0m in call: [2mf("ok")[0m[0m
|
||||||
↳ from [4m?[0m in block: [2m:f = ($(a, b) _)…[0m
|
↳ from [4m?[0m in block: [2m:f = ($(a, b) _)…[0m
|
||||||
--# saved #--
|
--# saved #--
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,14 @@
|
||||||
--- text ---
|
--- text ---
|
||||||
| {}"c" |
|
| {}"c" |
|
||||||
--- text ---
|
--- text ---
|
||||||
| {}"a" |
|
| {}"b" |
|
||||||
--- text ---
|
|
||||||
| {}"c" |
|
|
||||||
--- text ---
|
--- text ---
|
||||||
| {}"a" |
|
| {}"a" |
|
||||||
--- text ---
|
--- text ---
|
||||||
| {}"b" |
|
| {}"b" |
|
||||||
|
--- text ---
|
||||||
|
| {}"b" |
|
||||||
--- return ---
|
--- return ---
|
||||||
()
|
()
|
||||||
--# saved #--
|
--# saved #--
|
||||||
{"a.checkpoint":false, "a.run":2, "b.checkpoint":false, "b.run":1, "c.checkpoint":false, "c.run":2}
|
{"a.checkpoint":false, "a.run":1, "b.checkpoint":false, "b.run":3, "c.checkpoint":false, "c.run":1}
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
--# run #--
|
--# run #--
|
||||||
--- error ---
|
--- error ---
|
||||||
[0m[31m[0m[31m[0m[31m[0m[31midentifier "b" is undefined in branch 57b4c67d-b128-4b9a-11e39-0e6612f1210e[0m
|
[0m[31m[0m[31m[0m[31m[0m[31midentifier "b" is undefined in branch cf017f8a-7c86-4871-109af-6658231331e6[0m
|
||||||
↳ from [4mtest/tests/function scope wrong.ans:4:7[0m in identifier: [2mb[0m[0m
|
↳ from [4mtest/tests/function scope wrong.ans:4:7[0m in identifier: [2mb[0m[0m
|
||||||
↳ from [4mtest/tests/function scope wrong.ans:4:1[0m in text interpolation: [2m| a: {b} |[0m[0m
|
↳ from [4mtest/tests/function scope wrong.ans:4:1[0m in text interpolation: [2m| a: {b} |[0m[0m
|
||||||
↳ from [4mtest/tests/function scope wrong.ans:4:1[0m in translatable: [2m| a: {b} |[0m[0m
|
↳ from [4mtest/tests/function scope wrong.ans:4:1[0m in translatable: [2m| a: {b} |[0m[0m
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,8 @@
|
||||||
| {}"" {}"\"d\":[]" {}"" |
|
| {}"" {}"\"d\":[]" {}"" |
|
||||||
--- text ---
|
--- text ---
|
||||||
| {}"function:" |
|
| {}"function:" |
|
||||||
| {}"" {}"($() 12)" {}"" |
|
| {}"" {}"$() 12" {}"" |
|
||||||
| {}"" {}"($(x) x)" {}"" |
|
| {}"" {}"$(x) x" {}"" |
|
||||||
--- return ---
|
--- return ---
|
||||||
()
|
()
|
||||||
--# saved #--
|
--# saved #--
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,21 @@
|
||||||
--# run #--
|
--# run #--
|
||||||
--- error ---
|
--- error ---
|
||||||
[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31mabort[0m
|
[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31mabort[0m
|
||||||
↳ from [4mtest/tests/merge nested mutable error bis.ans:14:7[0m in call: [2merror("abort")[0m[0m
|
↳ from [4mtest/tests/merge nested mutable error bis.ans:14:7[0m in call: [2merror("abort")[0m[0m
|
||||||
↳ from [4mtest/tests/merge nested mutable error bis.ans:3:1[0m in block: [2minsert(a, b)…[0m[0m
|
↳ from [4mtest/tests/merge nested mutable error bis.ans:3:1[0m in block: [2minsert(a, b)…[0m[0m
|
||||||
↳ from [4mtest/tests/merge nested mutable error bis.ans:3:18[0m in call: [2m_[0m[0m
|
↳ from [4mtest/tests/merge nested mutable error bis.ans:3:18[0m in call: [2m_[0m[0m
|
||||||
↳ from [4mtest/tests/merge nested mutable error bis.ans:3:17[0m in return boundary: [2m_[0m[0m
|
↳ from [4mtest/tests/merge nested mutable error bis.ans:3:17[0m in return boundary: [2m_[0m[0m
|
||||||
↳ from [4mtest/tests/merge nested mutable error bis.ans:3:17[0m in return boundary: [2m_[0m[0m
|
|
||||||
↳ from [4mscript.ans:29:6[0m in call: [2mfn![0m[0m
|
↳ from [4mscript.ans:29:6[0m in call: [2mfn![0m[0m
|
||||||
↳ from [4mscript.ans:27:3[0m in block: [2mresumed from = ()…[0m[0m
|
↳ from [4mscript.ans:27:3[0m in block: [2mresumed from = ()…[0m[0m
|
||||||
↳ from [4mscript.ans:27:5[0m in call: [2m_[0m[0m
|
↳ from [4mscript.ans:27:7[0m in call: [2melse![0m[0m
|
||||||
↳ from [4mscript.ans:27:3[0m in call: [2m~_[0m[0m
|
↳ from [4mscript.ans:27:3[0m in partial scope: [2melse!…[0m[0m
|
||||||
↳ from [4mscript.ans:27:3[0m in partial scope: [2m~_…[0m[0m
|
↳ from [4mscript.ans:23:2[0m in block: [2mif(fn . "current checkpoint")…[0m[0m
|
||||||
↳ from [4mscript.ans:23:2[0m in block: [2mfn . "current checkpoint" ~…[0m[0m
|
|
||||||
↳ from [4mscript.ans:23:9[0m in call: [2m_[0m[0m
|
↳ from [4mscript.ans:23:9[0m in call: [2m_[0m[0m
|
||||||
↳ from [4mscript.ans:23:7[0m in return boundary: [2m_[0m[0m
|
↳ from [4mscript.ans:23:7[0m in return boundary: [2m_[0m[0m
|
||||||
↳ from [4mscript.ans:23:7[0m in return boundary: [2m_[0m[0m
|
|
||||||
↳ from [4mscript.ans:37:9[0m in call: [2mvalue(s)![0m[0m
|
↳ from [4mscript.ans:37:9[0m in call: [2mvalue(s)![0m[0m
|
||||||
↳ from [4mscript.ans:36:1[0m in block: [2mvalue(s)![0m[0m
|
↳ from [4mscript.ans:36:1[0m in block: [2mvalue(s)![0m[0m
|
||||||
↳ from [4mscript.ans:36:20[0m in call: [2m_[0m[0m
|
↳ from [4mscript.ans:36:20[0m in call: [2m_[0m[0m
|
||||||
↳ from [4mscript.ans:36:1[0m in return boundary: [2m_[0m[0m
|
↳ from [4mscript.ans:36:1[0m in return boundary: [2m_[0m[0m
|
||||||
↳ from [4mscript.ans:36:1[0m in return boundary: [2m_[0m[0m
|
|
||||||
↳ from [4mtest/tests/merge nested mutable error bis.ans:19:2[0m in call: [2mf![0m[0m
|
↳ from [4mtest/tests/merge nested mutable error bis.ans:19:2[0m in call: [2mf![0m[0m
|
||||||
↳ from [4m?[0m in block: [2m:a = *[1]…[0m
|
↳ from [4m?[0m in block: [2m:a = *[1]…[0m
|
||||||
--# post run check #--
|
--# post run check #--
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,21 @@
|
||||||
--# run #--
|
--# run #--
|
||||||
--- error ---
|
--- error ---
|
||||||
[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31mabort[0m
|
[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31mabort[0m
|
||||||
↳ from [4mtest/tests/merge nested mutable error.ans:14:7[0m in call: [2merror("abort")[0m[0m
|
↳ from [4mtest/tests/merge nested mutable error.ans:14:7[0m in call: [2merror("abort")[0m[0m
|
||||||
↳ from [4mtest/tests/merge nested mutable error.ans:3:1[0m in block: [2minsert(a, b)…[0m[0m
|
↳ from [4mtest/tests/merge nested mutable error.ans:3:1[0m in block: [2minsert(a, b)…[0m[0m
|
||||||
↳ from [4mtest/tests/merge nested mutable error.ans:3:18[0m in call: [2m_[0m[0m
|
↳ from [4mtest/tests/merge nested mutable error.ans:3:18[0m in call: [2m_[0m[0m
|
||||||
↳ from [4mtest/tests/merge nested mutable error.ans:3:17[0m in return boundary: [2m_[0m[0m
|
↳ from [4mtest/tests/merge nested mutable error.ans:3:17[0m in return boundary: [2m_[0m[0m
|
||||||
↳ from [4mtest/tests/merge nested mutable error.ans:3:17[0m in return boundary: [2m_[0m[0m
|
|
||||||
↳ from [4mscript.ans:29:6[0m in call: [2mfn![0m[0m
|
↳ from [4mscript.ans:29:6[0m in call: [2mfn![0m[0m
|
||||||
↳ from [4mscript.ans:27:3[0m in block: [2mresumed from = ()…[0m[0m
|
↳ from [4mscript.ans:27:3[0m in block: [2mresumed from = ()…[0m[0m
|
||||||
↳ from [4mscript.ans:27:5[0m in call: [2m_[0m[0m
|
↳ from [4mscript.ans:27:7[0m in call: [2melse![0m[0m
|
||||||
↳ from [4mscript.ans:27:3[0m in call: [2m~_[0m[0m
|
↳ from [4mscript.ans:27:3[0m in partial scope: [2melse!…[0m[0m
|
||||||
↳ from [4mscript.ans:27:3[0m in partial scope: [2m~_…[0m[0m
|
↳ from [4mscript.ans:23:2[0m in block: [2mif(fn . "current checkpoint")…[0m[0m
|
||||||
↳ from [4mscript.ans:23:2[0m in block: [2mfn . "current checkpoint" ~…[0m[0m
|
|
||||||
↳ from [4mscript.ans:23:9[0m in call: [2m_[0m[0m
|
↳ from [4mscript.ans:23:9[0m in call: [2m_[0m[0m
|
||||||
↳ from [4mscript.ans:23:7[0m in return boundary: [2m_[0m[0m
|
↳ from [4mscript.ans:23:7[0m in return boundary: [2m_[0m[0m
|
||||||
↳ from [4mscript.ans:23:7[0m in return boundary: [2m_[0m[0m
|
|
||||||
↳ from [4mscript.ans:37:9[0m in call: [2mvalue(s)![0m[0m
|
↳ from [4mscript.ans:37:9[0m in call: [2mvalue(s)![0m[0m
|
||||||
↳ from [4mscript.ans:36:1[0m in block: [2mvalue(s)![0m[0m
|
↳ from [4mscript.ans:36:1[0m in block: [2mvalue(s)![0m[0m
|
||||||
↳ from [4mscript.ans:36:20[0m in call: [2m_[0m[0m
|
↳ from [4mscript.ans:36:20[0m in call: [2m_[0m[0m
|
||||||
↳ from [4mscript.ans:36:1[0m in return boundary: [2m_[0m[0m
|
↳ from [4mscript.ans:36:1[0m in return boundary: [2m_[0m[0m
|
||||||
↳ from [4mscript.ans:36:1[0m in return boundary: [2m_[0m[0m
|
|
||||||
↳ from [4mtest/tests/merge nested mutable error.ans:19:2[0m in call: [2mf![0m[0m
|
↳ from [4mtest/tests/merge nested mutable error.ans:19:2[0m in call: [2mf![0m[0m
|
||||||
↳ from [4m?[0m in block: [2m:a = *[1]…[0m
|
↳ from [4m?[0m in block: [2m:a = *[1]…[0m
|
||||||
--# post run check #--
|
--# post run check #--
|
||||||
|
|
|
||||||
|
|
@ -14,21 +14,18 @@
|
||||||
--- text ---
|
--- text ---
|
||||||
| {}"CHECK 2" |
|
| {}"CHECK 2" |
|
||||||
--- error ---
|
--- error ---
|
||||||
[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31mt[0m
|
[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31mt[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:32:7[0m in call: [2merror("t")[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:32:7[0m in call: [2merror("t")[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:7:1[0m in block: [2minsert(t, len(l) + 1)…[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:7:1[0m in block: [2minsert(t, len(l) + 1)…[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:7:8[0m in call: [2m_[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:7:8[0m in call: [2m_[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:7:1[0m in return boundary: [2m_[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:7:1[0m in return boundary: [2m_[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:7:1[0m in return boundary: [2m_[0m[0m
|
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:19:4[0m in call: [2mf(t)[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:19:4[0m in call: [2mf(t)[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:15:2[0m in block: [2m| REC |…[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:15:2[0m in block: [2m| REC |…[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:15:10[0m in call: [2m_[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:15:4[0m in call: [2mif(n < 1)[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:15:8[0m in call: [2mn < 1 ~ _[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:15:2[0m in partial scope: [2mif(n < 1)…[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:15:2[0m in partial scope: [2mn < 1 ~…[0m[0m
|
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:7:1[0m in block: [2minsert(t, len(l) + 1)…[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:7:1[0m in block: [2minsert(t, len(l) + 1)…[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:7:8[0m in call: [2m_[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:7:8[0m in call: [2m_[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:7:1[0m in return boundary: [2m_[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:7:1[0m in return boundary: [2m_[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:7:1[0m in return boundary: [2m_[0m[0m
|
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:41:2[0m in call: [2mf(l)[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:41:2[0m in call: [2mf(l)[0m[0m
|
||||||
↳ from [4m?[0m in block: [2m:x = *[99]…[0m
|
↳ from [4m?[0m in block: [2m:x = *[99]…[0m
|
||||||
--# post run check #--
|
--# post run check #--
|
||||||
|
|
|
||||||
|
|
@ -10,21 +10,18 @@
|
||||||
--- text ---
|
--- text ---
|
||||||
| {}"CHECK" |
|
| {}"CHECK" |
|
||||||
--- error ---
|
--- error ---
|
||||||
[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31mt[0m
|
[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31mt[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable error.ans:23:7[0m in call: [2merror("t")[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable error.ans:23:7[0m in call: [2merror("t")[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable error.ans:5:1[0m in block: [2minsert(t, len(l) + 1)…[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable error.ans:5:1[0m in block: [2minsert(t, len(l) + 1)…[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable error.ans:5:8[0m in call: [2m_[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable error.ans:5:8[0m in call: [2m_[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable error.ans:5:1[0m in return boundary: [2m_[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable error.ans:5:1[0m in return boundary: [2m_[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable error.ans:5:1[0m in return boundary: [2m_[0m[0m
|
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable error.ans:17:4[0m in call: [2mf(t)[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable error.ans:17:4[0m in call: [2mf(t)[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable error.ans:13:2[0m in block: [2m| REC |…[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable error.ans:13:2[0m in block: [2m| REC |…[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable error.ans:13:10[0m in call: [2m_[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable error.ans:13:4[0m in call: [2mif(n < 1)[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable error.ans:13:8[0m in call: [2mn < 1 ~ _[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable error.ans:13:2[0m in partial scope: [2mif(n < 1)…[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable error.ans:13:2[0m in partial scope: [2mn < 1 ~…[0m[0m
|
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable error.ans:5:1[0m in block: [2minsert(t, len(l) + 1)…[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable error.ans:5:1[0m in block: [2minsert(t, len(l) + 1)…[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable error.ans:5:8[0m in call: [2m_[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable error.ans:5:8[0m in call: [2m_[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable error.ans:5:1[0m in return boundary: [2m_[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable error.ans:5:1[0m in return boundary: [2m_[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable error.ans:5:1[0m in return boundary: [2m_[0m[0m
|
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable error.ans:32:2[0m in call: [2mf(l)[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable error.ans:32:2[0m in call: [2mf(l)[0m[0m
|
||||||
↳ from [4m?[0m in block: [2m:l = *[1]…[0m
|
↳ from [4m?[0m in block: [2m:l = *[1]…[0m
|
||||||
--# post run check #--
|
--# post run check #--
|
||||||
|
|
|
||||||
|
|
@ -14,21 +14,18 @@
|
||||||
--- text ---
|
--- text ---
|
||||||
| {}"CHECK 2" |
|
| {}"CHECK 2" |
|
||||||
--- error ---
|
--- error ---
|
||||||
[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31mt[0m
|
[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31mt[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:34:7[0m in call: [2merror("t")[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:34:7[0m in call: [2merror("t")[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:7:1[0m in block: [2minsert(t, len(l) + 1)…[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:7:1[0m in block: [2minsert(t, len(l) + 1)…[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:7:8[0m in call: [2m_[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:7:8[0m in call: [2m_[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:7:1[0m in return boundary: [2m_[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:7:1[0m in return boundary: [2m_[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:7:1[0m in return boundary: [2m_[0m[0m
|
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:19:4[0m in call: [2mf(t)[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:19:4[0m in call: [2mf(t)[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:15:2[0m in block: [2m| REC |…[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:15:2[0m in block: [2m| REC |…[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:15:10[0m in call: [2m_[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:15:4[0m in call: [2mif(n < 1)[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:15:8[0m in call: [2mn < 1 ~ _[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:15:2[0m in partial scope: [2mif(n < 1)…[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:15:2[0m in partial scope: [2mn < 1 ~…[0m[0m
|
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:7:1[0m in block: [2minsert(t, len(l) + 1)…[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:7:1[0m in block: [2minsert(t, len(l) + 1)…[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:7:8[0m in call: [2m_[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:7:8[0m in call: [2m_[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:7:1[0m in return boundary: [2m_[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:7:1[0m in return boundary: [2m_[0m[0m
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:7:1[0m in return boundary: [2m_[0m[0m
|
|
||||||
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:43:2[0m in call: [2mf(l)[0m[0m
|
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:43:2[0m in call: [2mf(l)[0m[0m
|
||||||
↳ from [4m?[0m in block: [2m:x = *[99]…[0m
|
↳ from [4m?[0m in block: [2m:x = *[99]…[0m
|
||||||
--# post run check #--
|
--# post run check #--
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,6 @@
|
||||||
--- text ---
|
--- text ---
|
||||||
| {1:1}"lol" |
|
| {1:1}"lol" |
|
||||||
--- return ---
|
--- return ---
|
||||||
@| {}"a " {1:2}"d" {}" " {1:3}"t" {}" b" |
|
| {}"a " {1:2}"d" {}" " {1:3}"t" {}" b" |
|
||||||
--# saved #--
|
--# saved #--
|
||||||
{}
|
{}
|
||||||
|
|
@ -2,6 +2,6 @@
|
||||||
--- text ---
|
--- text ---
|
||||||
| {}"lol" |
|
| {}"lol" |
|
||||||
--- return ---
|
--- return ---
|
||||||
@| {}"a " {}"d" {}" b" |
|
| {}"a " {}"d" {}" b" |
|
||||||
--# saved #--
|
--# saved #--
|
||||||
{}
|
{}
|
||||||
19
test/results/while break.ans
Normal file
19
test/results/while break.ans
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
--# run #--
|
||||||
|
--- text ---
|
||||||
|
| {}"" {}"0" {}"" |
|
||||||
|
--- text ---
|
||||||
|
| {}"" {}"1" {}"" |
|
||||||
|
--- text ---
|
||||||
|
| {}"" {}"2" {}"" |
|
||||||
|
--- text ---
|
||||||
|
| {}"" {}"3" {}"" |
|
||||||
|
--- text ---
|
||||||
|
| {}"" {}"4" {}"" |
|
||||||
|
--- text ---
|
||||||
|
| {}"" {}"5" {}"" |
|
||||||
|
--- text ---
|
||||||
|
| {}"ok" |
|
||||||
|
--- return ---
|
||||||
|
()
|
||||||
|
--# saved #--
|
||||||
|
{}
|
||||||
17
test/results/while continue.ans
Normal file
17
test/results/while continue.ans
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
--# run #--
|
||||||
|
--- text ---
|
||||||
|
| {}"" {}"1" {}"" |
|
||||||
|
--- text ---
|
||||||
|
| {}"" {}"2" {}"" |
|
||||||
|
--- text ---
|
||||||
|
| {}"" {}"4" {}"" |
|
||||||
|
--- text ---
|
||||||
|
| {}"" {}"5" {}"" |
|
||||||
|
--- text ---
|
||||||
|
| {}"" {}"6" {}"" |
|
||||||
|
--- text ---
|
||||||
|
| {}"ok" |
|
||||||
|
--- return ---
|
||||||
|
()
|
||||||
|
--# saved #--
|
||||||
|
{}
|
||||||
|
|
@ -36,6 +36,6 @@
|
||||||
--- text ---
|
--- text ---
|
||||||
| {}"" {}"5" {}"" |
|
| {}"" {}"5" {}"" |
|
||||||
--- return ---
|
--- return ---
|
||||||
@()
|
()
|
||||||
--# saved #--
|
--# saved #--
|
||||||
{}
|
{}
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
:$ a - b
|
:$ a - b
|
||||||
@"generic minus"
|
return("generic minus")
|
||||||
|
|
||||||
:$ a::string - b::string
|
:$ a::string - b::string
|
||||||
@a + " minus " + b
|
return(a + " minus " + b)
|
||||||
|
|
||||||
| {2-5}
|
| {2-5}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
:$ jump button
|
:$ jump button
|
||||||
1 # |A
|
1 # |A
|
||||||
| Suprise choice! |> ()
|
| Suprise choice! |> ()
|
||||||
@"JOIN"
|
return("JOIN")
|
||||||
|
|
||||||
| Press {jump button!} to jump. |>
|
| Press {jump button!} to jump. |>
|
||||||
|ok
|
|ok
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
:$ jump button
|
:$ jump button
|
||||||
1 # | a
|
1 # | a
|
||||||
|
|
||||||
@"SPLIT"
|
return("SPLIT")
|
||||||
|
|
||||||
| Press {jump button!} to jump. |>
|
| Press {jump button!} to jump. |>
|
||||||
| ok
|
| ok
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
:$ jump button
|
:$ jump button
|
||||||
@1 # | A
|
return(1 # | A)
|
||||||
|
|
||||||
:$ move axis
|
:$ move axis
|
||||||
1 # | left
|
1 # | left
|
||||||
@" joystick"
|
return(" joystick")
|
||||||
|
|
||||||
| Press {jump button!} to jump. |>
|
| Press {jump button!} to jump. |>
|
||||||
|ok
|
|ok
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,17 @@
|
||||||
1 ~ | a |>
|
if(1)
|
||||||
| -> a
|
| a |>
|
||||||
|
| -> a
|
||||||
| b |>
|
| b |>
|
||||||
| -> b
|
| -> b
|
||||||
:@choice = 1
|
:@choice = 1
|
||||||
|
|
||||||
1 ~ | a |>
|
if(1, $| a |> _)
|
||||||
| -> a
|
| -> a
|
||||||
| b |>
|
| b |>
|
||||||
| -> b
|
| -> b
|
||||||
choice = 2
|
choice = 2
|
||||||
|
|
||||||
() ~ | a |>
|
if((), $| a |> _)
|
||||||
| -> a
|
| -> a
|
||||||
| b |>
|
| b |>
|
||||||
| -> b
|
| -> b
|
||||||
|
|
@ -22,13 +23,13 @@ choice = 1
|
||||||
| -> b
|
| -> b
|
||||||
choice = 2
|
choice = 2
|
||||||
|
|
||||||
12 # () ~ | a |>
|
12 # if((), $| a |> _)
|
||||||
| -> a
|
| -> a
|
||||||
3 # | b |>
|
3 # | b |>
|
||||||
| -> b
|
| -> b
|
||||||
choice = 1
|
choice = 1
|
||||||
|
|
||||||
12 # 1 ~ | a |>
|
12 # if(1, $| a |> _)
|
||||||
| -> a
|
| -> a
|
||||||
3 # | b |>
|
3 # | b |>
|
||||||
| -> b
|
| -> b
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
() ~ |ko
|
if((), $|ko)
|
||||||
1 ~ |ok
|
if(1, $|ok)
|
||||||
1 ~ |ok bis
|
if(1, $|ok bis)
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
:a = 5
|
:a = 5
|
||||||
|
|
||||||
a == 2 ~
|
if(a == 2)
|
||||||
|ko
|
|ko
|
||||||
~
|
else!
|
||||||
|ok
|
|ok
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
:a = 5
|
:a = 5
|
||||||
|
|
||||||
a == 5 ~
|
if(a == 5)
|
||||||
|ok
|
|ok
|
||||||
~
|
else!
|
||||||
|ko
|
|ko
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
:a = 5
|
:a = 5
|
||||||
|
|
||||||
a == 2 ~
|
if(a == 2)
|
||||||
|ko
|
|ko
|
||||||
~ () ~
|
else if(())
|
||||||
|ko
|
|ko
|
||||||
~
|
else!
|
||||||
|ok
|
|ok
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
:a = 5
|
:a = 5
|
||||||
|
|
||||||
a == 2 ~
|
if(a == 2)
|
||||||
|ko
|
|ko
|
||||||
~ 1 ~
|
else if(1)
|
||||||
|ok
|
|ok
|
||||||
~
|
else!
|
||||||
|ko
|
|ko
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
:a = 5
|
:a = 5
|
||||||
|
|
||||||
a == 2 ~
|
if(a == 2)
|
||||||
|ko
|
|ko
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
:$ f
|
:$ f
|
||||||
@|b
|
return(|b)
|
||||||
|
|
||||||
|a {5 ~ f!} c
|
|a {if(5, f)} c
|
||||||
|
|
||||||
|a {() ~ f!} c
|
|a {if((), f)} c
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
:a = 5
|
:a = 5
|
||||||
|
|
||||||
a == 5 ~
|
if(a == 5)
|
||||||
|ok
|
|ok
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
:$ format(p::is(person))
|
:$ format(p::is(person))
|
||||||
p = p!value
|
p = p!value
|
||||||
@"Name: {p("name")}\nAge: {p("age")}"
|
return("Name: {p("name")}\nAge: {p("age")}")
|
||||||
|
|
||||||
:$ Person(name, age)
|
:$ Person(name, age)
|
||||||
@{"name":name, "age":age}!type(person)
|
return({"name":name, "age":age}!type(person))
|
||||||
|
|
||||||
:abject = Person("Darmanin", 38)
|
:abject = Person("Darmanin", 38)
|
||||||
|
|
||||||
|
|
|
||||||
4
test/tests/default attached block.ans
Normal file
4
test/tests/default attached block.ans
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
:fn = "fn"!script
|
||||||
|
|ok
|
||||||
|
|
||||||
|
fn!
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
:a = 5
|
:a = 5
|
||||||
|
|
||||||
:$ f(p)
|
:$ f(p)
|
||||||
@a
|
return(a)
|
||||||
|
|
||||||
:$ f(p) = v
|
:$ f(p) = v
|
||||||
|v={v}
|
|v={v}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
:f = $(x)x*x
|
:f = $(x)x*x
|
||||||
|
|
||||||
:$g(x)
|
:$g(x)
|
||||||
@x*x
|
return(x*x)
|
||||||
|
|
||||||
|{f(5)} = {g(5)}
|
|{f(5)} = {g(5)}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
:$ hey
|
:$ hey
|
||||||
:@$ foo
|
:@$ foo
|
||||||
@2
|
return(2)
|
||||||
@3
|
return(3)
|
||||||
@5
|
return(5)
|
||||||
|u
|
|u
|
||||||
|
|
||||||
|{hey!}
|
|{hey!}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
:$ hey
|
:$ hey
|
||||||
@5
|
return(5)
|
||||||
|a
|
|a
|
||||||
@2
|
return(2)
|
||||||
|
|
||||||
|{hey!}
|
|{hey!}
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
:$ hey
|
:$ hey
|
||||||
:@$ foo
|
:@$ foo
|
||||||
@2
|
return(2)
|
||||||
@5
|
return(5)
|
||||||
|
|
||||||
|{hey!}
|
|{hey!}
|
||||||
|{hey.foo!}
|
|{hey.foo!}
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
:$ hey
|
:$ hey
|
||||||
@5
|
return(5)
|
||||||
|
|
||||||
|{hey!}
|
|{hey!}
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
|before recursion {c}: {a}
|
|before recursion {c}: {a}
|
||||||
|
|
||||||
n < 5 ~
|
if(n < 5)
|
||||||
f(c+1)
|
f(c+1)
|
||||||
|
|
||||||
|after recursion {c}: {a}
|
|after recursion {c}: {a}
|
||||||
|
|
@ -29,7 +29,7 @@ f!
|
||||||
|
|
||||||
|before recursion {c}: {a}
|
|before recursion {c}: {a}
|
||||||
|
|
||||||
n < 5 ~
|
if(n < 5)
|
||||||
g(c+1, a)
|
g(c+1, a)
|
||||||
|
|
||||||
|after recursion {c}: {a}
|
|after recursion {c}: {a}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
|before recursion {c}: {a}
|
|before recursion {c}: {a}
|
||||||
|
|
||||||
n < 5 ~
|
if(n < 5)
|
||||||
f(c+1)
|
f(c+1)
|
||||||
|
|
||||||
|after recursion {c}: {a}
|
|after recursion {c}: {a}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
:$ a(x::number)
|
:$ a(x::number)
|
||||||
@x + 2
|
return(x + 2)
|
||||||
|
|
||||||
:$ x
|
:$ x
|
||||||
:$ a(x::string)
|
:$ a(x::string)
|
||||||
@x + "heh"
|
return(x + "heh")
|
||||||
|
|
||||||
|{a("plop")}
|
|{a("plop")}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,10 @@ fn(5)
|
||||||
fn()
|
fn()
|
||||||
|
|
||||||
:$ g(n="s", a::number=5)
|
:$ g(n="s", a::number=5)
|
||||||
@"gn"
|
return("gn")
|
||||||
|
|
||||||
:$ g(n="s", a::string="lol")
|
:$ g(n="s", a::string="lol")
|
||||||
@"gs"
|
return("gs")
|
||||||
|
|
||||||
|{g(n="k", a="l")}
|
|{g(n="k", a="l")}
|
||||||
|{g(n="k", a=1)}
|
|{g(n="k", a=1)}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
:$ a
|
:$ a
|
||||||
|a
|
|a
|
||||||
@1
|
return(1)
|
||||||
|
|
||||||
:$ b
|
:$ b
|
||||||
|b
|
|b
|
||||||
@()
|
return(())
|
||||||
|
|
||||||
|{a! & b!} = a b ()
|
|{a! & b!} = a b ()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
:i = 0
|
:i = 0
|
||||||
|
|
||||||
(i += 1; i <= 10) ~? (| {i}\n)!
|
while($()(i += 1; i <= 10), $| {i}\n |!)
|
||||||
|
|
||||||
|{i}
|
|{i}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
:$ f(a, b, c)
|
:$ f(a, b, c)
|
||||||
@a + b + c
|
return(a + b + c)
|
||||||
|
|
||||||
|{f("a", "b", "c")} = {f(a="a", b="b", c="c")} = {f(c="c", a="a", b="b")}
|
|{f("a", "b", "c")} = {f(a="a", b="b", c="c")} = {f(c="c", a="a", b="b")}
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,19 @@
|
||||||
1 ~
|
if(1)
|
||||||
|yes
|
|yes
|
||||||
() ~
|
if(())
|
||||||
|no
|
|no
|
||||||
~
|
else!
|
||||||
|nope
|
|nope
|
||||||
1 ~
|
if(1)
|
||||||
|niet
|
|niet
|
||||||
() ~
|
if(())
|
||||||
|still no
|
|still no
|
||||||
~
|
else!
|
||||||
|nein
|
|nein
|
||||||
|
|
||||||
() ~
|
if(())
|
||||||
|nah
|
|nah
|
||||||
~
|
else!
|
||||||
|ye
|
|ye
|
||||||
~
|
else!
|
||||||
|da
|
|da
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
1 ~
|
if(1)
|
||||||
|a
|
|a
|
||||||
|
|
||||||
|b
|
|b
|
||||||
|
|
||||||
1 ~
|
if(1)
|
||||||
|c
|
|c
|
||||||
|d
|
|d
|
||||||
|
|
||||||
1 ~
|
if(1)
|
||||||
|e
|
|e
|
||||||
|
|
||||||
| f |> ()
|
| f |> ()
|
||||||
:@choice = 1
|
:@choice = 1
|
||||||
|
|
||||||
1 ~
|
if(1)
|
||||||
|g
|
|g
|
||||||
| h |> ()
|
| h |> ()
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
:$ f(a, b, c="c")
|
:$ f(a, b, c="c")
|
||||||
@a + b + c
|
return(a + b + c)
|
||||||
|
|
||||||
|{f("a", "b")} = {f("a", "b", "c")} = {f(b="b", a="a")}
|
|{f("a", "b")} = {f("a", "b", "c")} = {f(b="b", a="a")}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
:f = "f"!script($_)
|
:f = "f"!script
|
||||||
"a":"a" #
|
"a":"a" #
|
||||||
|a
|
|a
|
||||||
1 ~ "x":"x" #
|
if(1, $()("x":"x" # _))
|
||||||
"b":"b" #
|
"b":"b" #
|
||||||
#p!checkpoint($_)
|
#p!checkpoint($_)
|
||||||
"c":"c"# |b
|
"c":"c"# |b
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ g!
|
||||||
g!from(#p)
|
g!from(#p)
|
||||||
|
|
||||||
:h = "h"!script($_)
|
:h = "h"!script($_)
|
||||||
1 ~
|
if(1)
|
||||||
| a |>
|
| a |>
|
||||||
|-> a
|
|-> a
|
||||||
#p!checkpoint
|
#p!checkpoint
|
||||||
|
|
@ -76,7 +76,7 @@ h!from(#p)
|
||||||
|-> ab
|
|-> ab
|
||||||
| b |>
|
| b |>
|
||||||
|-> b
|
|-> b
|
||||||
1 ~
|
if(1)
|
||||||
| c |>
|
| c |>
|
||||||
|-> c
|
|-> c
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
:f = "f"!script($_)
|
:f = "f"!script($_)
|
||||||
1 ~
|
if(1)
|
||||||
#p!checkpoint
|
#p!checkpoint
|
||||||
|x
|
|x
|
||||||
~
|
else!
|
||||||
|y
|
|y
|
||||||
|
|
||||||
f!
|
f!
|
||||||
|
|
@ -10,10 +10,10 @@ f!
|
||||||
f!from(#p)
|
f!from(#p)
|
||||||
|
|
||||||
:g = "g"!script($_)
|
:g = "g"!script($_)
|
||||||
() ~
|
if(())
|
||||||
#p!checkpoint
|
#p!checkpoint
|
||||||
|x
|
|x
|
||||||
~
|
else!
|
||||||
|y
|
|y
|
||||||
|
|
||||||
g!
|
g!
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
:$ fn
|
:$ fn
|
||||||
:i=0
|
:i=0
|
||||||
@
|
return(_)
|
||||||
i=50
|
i=50
|
||||||
i
|
i
|
||||||
|
|
||||||
| {fn!} = 50
|
| {fn!} = 50
|
||||||
|
|
||||||
:$ g
|
:$ g
|
||||||
@
|
return(_)
|
||||||
@3
|
return(3)
|
||||||
|
|
||||||
| {g!} = 3
|
| {g!} = 3
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
:$ f
|
:$ f
|
||||||
| a |>
|
| a |>
|
||||||
| x
|
| x
|
||||||
@1
|
return(1)
|
||||||
| y
|
| y
|
||||||
@2
|
return(2)
|
||||||
|
|
||||||
f! == 2 ~
|
if(f! == 2)
|
||||||
:@choice = 1
|
:@choice = 1
|
||||||
| Yes.
|
| Yes.
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
|CHECK
|
|CHECK
|
||||||
merge branch!
|
merge branch!
|
||||||
|
|
||||||
n < 1 ~
|
if(n < 1)
|
||||||
|REC
|
|REC
|
||||||
|
|
||||||
n += 1
|
n += 1
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
|CHECK
|
|CHECK
|
||||||
merge branch!
|
merge branch!
|
||||||
|
|
||||||
n < 1 ~
|
if(n < 1)
|
||||||
|REC
|
|REC
|
||||||
|
|
||||||
n += 1
|
n += 1
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|CHECK
|
|CHECK
|
||||||
merge branch!
|
merge branch!
|
||||||
|
|
||||||
n < 1 ~
|
if(n < 1)
|
||||||
|REC
|
|REC
|
||||||
|
|
||||||
n += 1
|
n += 1
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
|CHECK
|
|CHECK
|
||||||
merge branch!
|
merge branch!
|
||||||
|
|
||||||
n < 1 ~
|
if(n < 1)
|
||||||
|REC
|
|REC
|
||||||
|
|
||||||
n += 1
|
n += 1
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
|CHECK
|
|CHECK
|
||||||
merge branch!
|
merge branch!
|
||||||
|
|
||||||
n < 1 ~
|
if(n < 1)
|
||||||
|REC
|
|REC
|
||||||
|
|
||||||
n += 1
|
n += 1
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|CHECK
|
|CHECK
|
||||||
merge branch!
|
merge branch!
|
||||||
|
|
||||||
n < 1 ~
|
if(n < 1)
|
||||||
|REC
|
|REC
|
||||||
|
|
||||||
n += 1
|
n += 1
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
1 #
|
1 #
|
||||||
|foo
|
|foo
|
||||||
1 ~ "b":[1,2] #
|
if(1, $()("b":[1,2] # _))
|
||||||
1 ~ "a":[2,3] # | bar
|
if(1, $()("a":[2,3] # | bar))
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
:$ f
|
:$ f
|
||||||
@"b"
|
return("b")
|
||||||
|
|
||||||
|a {5 # |{f!}} c
|
|a {5 # |{f!}} c
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
:$ f
|
:$ f
|
||||||
1 # | lol
|
1 # | lol
|
||||||
|
|
||||||
@2 # |d
|
return(2 # |d)
|
||||||
|
|
||||||
:a = |a {f!} {3#|t} b
|
:a = |a {f!} {3#|t} b
|
||||||
|
|
||||||
@a
|
return(a)
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
:$ f
|
:$ f
|
||||||
|lol
|
|lol
|
||||||
|
|
||||||
@|d
|
return(|d)
|
||||||
|
|
||||||
:a = |a {f!} b
|
:a = |a {f!} b
|
||||||
|
|
||||||
@a
|
return(a)
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
1 # | left
|
1 # | left
|
||||||
| Surprise choice! |>
|
| Surprise choice! |>
|
||||||
| ok2
|
| ok2
|
||||||
@" joystick"
|
return(" joystick")
|
||||||
|
|
||||||
| Press {jump button!} to jump.
|
| Press {jump button!} to jump.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
:$ jump button
|
:$ jump button
|
||||||
1 # | A
|
1 # | A
|
||||||
|
|
||||||
@
|
return!
|
||||||
|
|
||||||
:$ move axis
|
:$ move axis
|
||||||
1 # | left
|
1 # | left
|
||||||
|
|
||||||
@" joystick"
|
return(" joystick")
|
||||||
|
|
||||||
| Press {jump button!} to jump.
|
| Press {jump button!} to jump.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
:$ jump button
|
:$ jump button
|
||||||
@1 # | A
|
return(1 # | A)
|
||||||
|
|
||||||
:$ move axis
|
:$ move axis
|
||||||
2 # | left
|
2 # | left
|
||||||
@" joystick"
|
return(" joystick")
|
||||||
|
|
||||||
| Press {jump button!} to jump.
|
| Press {jump button!} to jump.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
:$ -f
|
:$ -f
|
||||||
@"generic minus"
|
return("generic minus")
|
||||||
|
|
||||||
:$ -f::string
|
:$ -f::string
|
||||||
@"minus "+f
|
return("minus "+f)
|
||||||
|
|
||||||
|{-5}
|
|{-5}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
: x = "x"!script($_)
|
: x = "x"!script($_)
|
||||||
|a
|
|a
|
||||||
run == 0 ~ |seen only once
|
if(run == 0, $|seen only once)
|
||||||
|b
|
|b
|
||||||
|
|
||||||
x!
|
x!
|
||||||
|
|
|
||||||
10
test/tests/while break.ans
Normal file
10
test/tests/while break.ans
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
:i = 0
|
||||||
|
while($i <= 10)
|
||||||
|
| {i}
|
||||||
|
|
||||||
|
if(i == 5)
|
||||||
|
break!
|
||||||
|
|
||||||
|
i += 1
|
||||||
|
|
||||||
|
|ok
|
||||||
10
test/tests/while continue.ans
Normal file
10
test/tests/while continue.ans
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
:i = 0
|
||||||
|
while($i <= 5)
|
||||||
|
i += 1
|
||||||
|
|
||||||
|
if(i == 3)
|
||||||
|
continue!
|
||||||
|
|
||||||
|
| {i}
|
||||||
|
|
||||||
|
|ok
|
||||||
|
|
@ -2,18 +2,18 @@
|
||||||
|
|
||||||
| Start with i={i}:
|
| Start with i={i}:
|
||||||
|
|
||||||
i < 5 ~?
|
while($i < 5)
|
||||||
| {i}
|
| {i}
|
||||||
|
|
||||||
i += 1
|
i += 1
|
||||||
~
|
else!
|
||||||
| Loop not ran.
|
| Loop not ran.
|
||||||
|
|
||||||
| Start with i={i}:
|
| Start with i={i}:
|
||||||
|
|
||||||
i < 5 ~?
|
while($i < 5)
|
||||||
| {i}
|
| {i}
|
||||||
|
|
||||||
i += 1
|
i += 1
|
||||||
~
|
else!
|
||||||
| Loop not ran.
|
| Loop not ran.
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
:i = 0
|
:i = 0
|
||||||
i <= 10 ~?
|
while($i <= 10)
|
||||||
| {i}
|
| {i}
|
||||||
|
|
||||||
i += 1
|
i += 1
|
||||||
|
|
@ -7,10 +7,10 @@ i <= 10 ~?
|
||||||
| return in loop:
|
| return in loop:
|
||||||
|
|
||||||
i = 0
|
i = 0
|
||||||
i <= 10 ~?
|
while($i <= 10)
|
||||||
| {i}
|
| {i}
|
||||||
|
|
||||||
i == 5 ~
|
if(i == 5)
|
||||||
@()
|
return!
|
||||||
|
|
||||||
i += 1
|
i += 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue