mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-28 00:59:31 +00:00
Rewrite
This commit is contained in:
parent
7a5a05ff34
commit
b233d7fa1e
138 changed files with 4369 additions and 1611 deletions
11
test/tests/choice block.ans
Normal file
11
test/tests/choice block.ans
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
> ye
|
||||
no
|
||||
> ne
|
||||
ok
|
||||
~ choose(2)
|
||||
|
||||
> ho
|
||||
plop
|
||||
> oh
|
||||
plup
|
||||
~ choose(1)
|
||||
48
test/tests/choice block.lua
Normal file
48
test/tests/choice block.lua
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
local _={}
|
||||
_[21]={}
|
||||
_[20]={}
|
||||
_[19]={}
|
||||
_[18]={}
|
||||
_[17]={}
|
||||
_[16]={}
|
||||
_[15]={data="plop",tags=_[21]}
|
||||
_[14]={data="oh",tags=_[20]}
|
||||
_[13]={data="ho",tags=_[19]}
|
||||
_[12]={data="ok",tags=_[18]}
|
||||
_[11]={data="ne",tags=_[17]}
|
||||
_[10]={data="ye",tags=_[16]}
|
||||
_[9]={_[15]}
|
||||
_[8]={_[13],_[14]}
|
||||
_[7]={_[12]}
|
||||
_[6]={_[10],_[11]}
|
||||
_[5]={"return"}
|
||||
_[4]={"text",_[9]}
|
||||
_[3]={"choice",_[8]}
|
||||
_[2]={"text",_[7]}
|
||||
_[1]={"choice",_[6]}
|
||||
return {_[1],_[2],_[3],_[4],_[5]}
|
||||
--[[
|
||||
{ "choice", { {
|
||||
data = "ye",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "ne",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "ok",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "choice", { {
|
||||
data = "ho",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "oh",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "plop",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
11
test/tests/choice function.ans
Normal file
11
test/tests/choice function.ans
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
$ f
|
||||
> neol
|
||||
nah
|
||||
|
||||
> ho
|
||||
plop
|
||||
~ f
|
||||
> oh
|
||||
ok
|
||||
~ f
|
||||
~ choose(3)
|
||||
37
test/tests/choice function.lua
Normal file
37
test/tests/choice function.lua
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
local _={}
|
||||
_[15]={}
|
||||
_[14]={}
|
||||
_[13]={}
|
||||
_[12]={}
|
||||
_[11]={}
|
||||
_[10]={data="ok",tags=_[15]}
|
||||
_[9]={data="neol",tags=_[14]}
|
||||
_[8]={data="oh",tags=_[13]}
|
||||
_[7]={data="neol",tags=_[12]}
|
||||
_[6]={data="ho",tags=_[11]}
|
||||
_[5]={_[10]}
|
||||
_[4]={_[6],_[7],_[8],_[9]}
|
||||
_[3]={"return"}
|
||||
_[2]={"text",_[5]}
|
||||
_[1]={"choice",_[4]}
|
||||
return {_[1],_[2],_[3]}
|
||||
--[[
|
||||
{ "choice", { {
|
||||
data = "ho",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "neol",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "oh",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "neol",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "ok",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
5
test/tests/choice simple.ans
Normal file
5
test/tests/choice simple.ans
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
> ye
|
||||
no
|
||||
> ne
|
||||
ok
|
||||
~ choose(2)
|
||||
27
test/tests/choice simple.lua
Normal file
27
test/tests/choice simple.lua
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
local _={}
|
||||
_[11]={}
|
||||
_[10]={}
|
||||
_[9]={}
|
||||
_[8]={data="ok",tags=_[11]}
|
||||
_[7]={data="ne",tags=_[10]}
|
||||
_[6]={data="ye",tags=_[9]}
|
||||
_[5]={_[8]}
|
||||
_[4]={_[6],_[7]}
|
||||
_[3]={"return"}
|
||||
_[2]={"text",_[5]}
|
||||
_[1]={"choice",_[4]}
|
||||
return {_[1],_[2],_[3]}
|
||||
--[[
|
||||
{ "choice", { {
|
||||
data = "ye",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "ne",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "ok",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
7
test/tests/comment block.ans
Normal file
7
test/tests/comment block.ans
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
(hey couic + 5)
|
||||
other stuff
|
||||
|
||||
CHAZOUM
|
||||
OO
|
||||
|
||||
k
|
||||
6
test/tests/comment block.lua
Normal file
6
test/tests/comment block.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
local _={}
|
||||
_[1]={"return"}
|
||||
return {_[1]}
|
||||
--[[
|
||||
{ "return" }
|
||||
]]--
|
||||
1
test/tests/comment.ans
Normal file
1
test/tests/comment.ans
Normal file
|
|
@ -0,0 +1 @@
|
|||
(hey couic + 5)
|
||||
6
test/tests/comment.lua
Normal file
6
test/tests/comment.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
local _={}
|
||||
_[1]={"return"}
|
||||
return {_[1]}
|
||||
--[[
|
||||
{ "return" }
|
||||
]]--
|
||||
20
test/tests/commit.ans
Normal file
20
test/tests/commit.ans
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
$ bar
|
||||
:5 var
|
||||
|
||||
~ var := 2
|
||||
|
||||
before: {var}
|
||||
|
||||
~ run("parallel")
|
||||
|
||||
§ foo
|
||||
checkpoint
|
||||
|
||||
after: {var}
|
||||
|
||||
~ run("parallel")
|
||||
|
||||
$ parallel
|
||||
parallel: {bar.var}
|
||||
|
||||
~ bar
|
||||
38
test/tests/commit.lua
Normal file
38
test/tests/commit.lua
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
local _={}
|
||||
_[17]={}
|
||||
_[16]={}
|
||||
_[15]={}
|
||||
_[14]={}
|
||||
_[13]={data="parallel: 2",tags=_[17]}
|
||||
_[12]={data="after: 2",tags=_[16]}
|
||||
_[11]={data="parallel: 5",tags=_[15]}
|
||||
_[10]={data="before: 2",tags=_[14]}
|
||||
_[9]={_[13]}
|
||||
_[8]={_[12]}
|
||||
_[7]={_[11]}
|
||||
_[6]={_[10]}
|
||||
_[5]={"return"}
|
||||
_[4]={"text",_[9]}
|
||||
_[3]={"text",_[8]}
|
||||
_[2]={"text",_[7]}
|
||||
_[1]={"text",_[6]}
|
||||
return {_[1],_[2],_[3],_[4],_[5]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "before: 2",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "parallel: 5",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "after: 2",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "parallel: 2",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
3
test/tests/condition decorator.ans
Normal file
3
test/tests/condition decorator.ans
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
ko ~ 0
|
||||
ok ~ 1
|
||||
ok bis ~
|
||||
19
test/tests/condition decorator.lua
Normal file
19
test/tests/condition decorator.lua
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
local _={}
|
||||
_[7]={}
|
||||
_[6]={}
|
||||
_[5]={data="ok bis",tags=_[7]}
|
||||
_[4]={data="ok",tags=_[6]}
|
||||
_[3]={_[4],_[5]}
|
||||
_[2]={"return"}
|
||||
_[1]={"text",_[3]}
|
||||
return {_[1],_[2]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "ok",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "ok bis",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
6
test/tests/condition else false.ans
Normal file
6
test/tests/condition else false.ans
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
:5 a
|
||||
|
||||
~ a = 2
|
||||
ko
|
||||
~~
|
||||
ok
|
||||
14
test/tests/condition else false.lua
Normal file
14
test/tests/condition else false.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
local _={}
|
||||
_[5]={}
|
||||
_[4]={data="ok",tags=_[5]}
|
||||
_[3]={_[4]}
|
||||
_[2]={"return"}
|
||||
_[1]={"text",_[3]}
|
||||
return {_[1],_[2]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "ok",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
6
test/tests/condition else true.ans
Normal file
6
test/tests/condition else true.ans
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
:5 a
|
||||
|
||||
~ a = 5
|
||||
ok
|
||||
~~
|
||||
ko
|
||||
14
test/tests/condition else true.lua
Normal file
14
test/tests/condition else true.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
local _={}
|
||||
_[5]={}
|
||||
_[4]={data="ok",tags=_[5]}
|
||||
_[3]={_[4]}
|
||||
_[2]={"return"}
|
||||
_[1]={"text",_[3]}
|
||||
return {_[1],_[2]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "ok",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
8
test/tests/condition elseif false.ans
Normal file
8
test/tests/condition elseif false.ans
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
:5 a
|
||||
|
||||
~ a = 2
|
||||
ko
|
||||
~~ 0
|
||||
ko
|
||||
~~
|
||||
ok
|
||||
14
test/tests/condition elseif false.lua
Normal file
14
test/tests/condition elseif false.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
local _={}
|
||||
_[5]={}
|
||||
_[4]={data="ok",tags=_[5]}
|
||||
_[3]={_[4]}
|
||||
_[2]={"return"}
|
||||
_[1]={"text",_[3]}
|
||||
return {_[1],_[2]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "ok",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
8
test/tests/condition elseif true.ans
Normal file
8
test/tests/condition elseif true.ans
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
:5 a
|
||||
|
||||
~ a = 2
|
||||
ko
|
||||
~~ 1
|
||||
ok
|
||||
~~
|
||||
ko
|
||||
14
test/tests/condition elseif true.lua
Normal file
14
test/tests/condition elseif true.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
local _={}
|
||||
_[5]={}
|
||||
_[4]={data="ok",tags=_[5]}
|
||||
_[3]={_[4]}
|
||||
_[2]={"return"}
|
||||
_[1]={"text",_[3]}
|
||||
return {_[1],_[2]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "ok",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
4
test/tests/condition false.ans
Normal file
4
test/tests/condition false.ans
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
:5 a
|
||||
|
||||
~ a = 2
|
||||
ko
|
||||
6
test/tests/condition false.lua
Normal file
6
test/tests/condition false.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
local _={}
|
||||
_[1]={"return"}
|
||||
return {_[1]}
|
||||
--[[
|
||||
{ "return" }
|
||||
]]--
|
||||
4
test/tests/condition true.ans
Normal file
4
test/tests/condition true.ans
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
:5 a
|
||||
|
||||
~ a = 5
|
||||
ok
|
||||
14
test/tests/condition true.lua
Normal file
14
test/tests/condition true.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
local _={}
|
||||
_[5]={}
|
||||
_[4]={data="ok",tags=_[5]}
|
||||
_[3]={_[4]}
|
||||
_[2]={"return"}
|
||||
_[1]={"text",_[3]}
|
||||
return {_[1],_[2]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "ok",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
3
test/tests/custom event.ans
Normal file
3
test/tests/custom event.ans
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
ah
|
||||
~ wait(5)
|
||||
ho
|
||||
21
test/tests/custom event.lua
Normal file
21
test/tests/custom event.lua
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
local _={}
|
||||
_[8]={}
|
||||
_[7]={}
|
||||
_[6]={data="ho",tags=_[8]}
|
||||
_[5]={data="ah",tags=_[7]}
|
||||
_[4]={_[5],_[6]}
|
||||
_[3]={"return"}
|
||||
_[2]={"text",_[4]}
|
||||
_[1]={"wait",5}
|
||||
return {_[1],_[2],_[3]}
|
||||
--[[
|
||||
{ "wait", 5 }
|
||||
{ "text", { {
|
||||
data = "ah",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "ho",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
3
test/tests/define override function.ans
Normal file
3
test/tests/define override function.ans
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
$ a
|
||||
|
||||
:2 a
|
||||
6
test/tests/define override function.lua
Normal file
6
test/tests/define override function.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
local _={}
|
||||
_[1]={"error","trying to define variable define override function.a, but a function with the same name exists; at line 3"}
|
||||
return {_[1]}
|
||||
--[[
|
||||
{ "error", "trying to define variable define override function.a, but a function with the same name exists; at line 3" }
|
||||
]]--
|
||||
3
test/tests/define override variable.ans
Normal file
3
test/tests/define override variable.ans
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
:2 a
|
||||
|
||||
$ a
|
||||
6
test/tests/define override variable.lua
Normal file
6
test/tests/define override variable.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
local _={}
|
||||
_[1]={"error","trying to define function define override variable.a, but a variable with the same name exists; at line 3"}
|
||||
return {_[1]}
|
||||
--[[
|
||||
{ "error", "trying to define function define override variable.a, but a variable with the same name exists; at line 3" }
|
||||
]]--
|
||||
5
test/tests/define override.ans
Normal file
5
test/tests/define override.ans
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
:5 a
|
||||
|
||||
:2 a
|
||||
|
||||
a: {a}
|
||||
14
test/tests/define override.lua
Normal file
14
test/tests/define override.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
local _={}
|
||||
_[5]={}
|
||||
_[4]={data="a: 5",tags=_[5]}
|
||||
_[3]={_[4]}
|
||||
_[2]={"return"}
|
||||
_[1]={"text",_[3]}
|
||||
return {_[1],_[2]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "a: 5",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
1
test/tests/define.ans
Normal file
1
test/tests/define.ans
Normal file
|
|
@ -0,0 +1 @@
|
|||
:5 a
|
||||
6
test/tests/define.lua
Normal file
6
test/tests/define.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
local _={}
|
||||
_[1]={"return"}
|
||||
return {_[1]}
|
||||
--[[
|
||||
{ "return" }
|
||||
]]--
|
||||
5
test/tests/function arg vararg.ans
Normal file
5
test/tests/function arg vararg.ans
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
$ f(a, l...)
|
||||
{a}
|
||||
{l}
|
||||
|
||||
~ f("ok", "o", "k")
|
||||
19
test/tests/function arg vararg.lua
Normal file
19
test/tests/function arg vararg.lua
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
local _={}
|
||||
_[7]={}
|
||||
_[6]={}
|
||||
_[5]={data="[o, k]",tags=_[7]}
|
||||
_[4]={data="ok",tags=_[6]}
|
||||
_[3]={_[4],_[5]}
|
||||
_[2]={"return"}
|
||||
_[1]={"text",_[3]}
|
||||
return {_[1],_[2]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "ok",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "[o, k]",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
4
test/tests/function arg.ans
Normal file
4
test/tests/function arg.ans
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
$ f(a)
|
||||
{a}
|
||||
|
||||
~ f("ok")
|
||||
14
test/tests/function arg.lua
Normal file
14
test/tests/function arg.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
local _={}
|
||||
_[5]={}
|
||||
_[4]={data="ok",tags=_[5]}
|
||||
_[3]={_[4]}
|
||||
_[2]={"return"}
|
||||
_[1]={"text",_[3]}
|
||||
return {_[1],_[2]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "ok",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
4
test/tests/function args arity check fail.ans
Normal file
4
test/tests/function args arity check fail.ans
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
$ f(a, b)
|
||||
{a}{b}
|
||||
|
||||
~ f("ok")
|
||||
6
test/tests/function args arity check fail.lua
Normal file
6
test/tests/function args arity check fail.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
local _={}
|
||||
_[1]={"error","function \"function args arity check fail.f\" expected 2 arguments but received 1; at line 4"}
|
||||
return {_[1]}
|
||||
--[[
|
||||
{ "error", 'function "function args arity check fail.f" expected 2 arguments but received 1; at line 4' }
|
||||
]]--
|
||||
5
test/tests/function args vararg empty.ans
Normal file
5
test/tests/function args vararg empty.ans
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
$ f(a, b, l...)
|
||||
{a}{b}
|
||||
{l}
|
||||
|
||||
~ f("o","k")
|
||||
19
test/tests/function args vararg empty.lua
Normal file
19
test/tests/function args vararg empty.lua
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
local _={}
|
||||
_[7]={}
|
||||
_[6]={}
|
||||
_[5]={data="[]",tags=_[7]}
|
||||
_[4]={data="ok",tags=_[6]}
|
||||
_[3]={_[4],_[5]}
|
||||
_[2]={"return"}
|
||||
_[1]={"text",_[3]}
|
||||
return {_[1],_[2]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "ok",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "[]",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
5
test/tests/function args vararg.ans
Normal file
5
test/tests/function args vararg.ans
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
$ f(a, b, l...)
|
||||
{a}{b}
|
||||
{l}
|
||||
|
||||
~ f("o", "k", "o", "k")
|
||||
19
test/tests/function args vararg.lua
Normal file
19
test/tests/function args vararg.lua
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
local _={}
|
||||
_[7]={}
|
||||
_[6]={}
|
||||
_[5]={data="[o, k]",tags=_[7]}
|
||||
_[4]={data="ok",tags=_[6]}
|
||||
_[3]={_[4],_[5]}
|
||||
_[2]={"return"}
|
||||
_[1]={"text",_[3]}
|
||||
return {_[1],_[2]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "ok",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "[o, k]",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
4
test/tests/function args.ans
Normal file
4
test/tests/function args.ans
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
$ f(a, b)
|
||||
{a}{b}
|
||||
|
||||
~ f("o", "k")
|
||||
14
test/tests/function args.lua
Normal file
14
test/tests/function args.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
local _={}
|
||||
_[5]={}
|
||||
_[4]={data="ok",tags=_[5]}
|
||||
_[3]={_[4]}
|
||||
_[2]={"return"}
|
||||
_[1]={"text",_[3]}
|
||||
return {_[1],_[2]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "ok",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
5
test/tests/function arity conflict.ans
Normal file
5
test/tests/function arity conflict.ans
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
$ f(a, b)
|
||||
|
||||
$ f(x)
|
||||
|
||||
$ f(u, v)
|
||||
6
test/tests/function arity conflict.lua
Normal file
6
test/tests/function arity conflict.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
local _={}
|
||||
_[1]={"error","trying to define function function arity conflict.f with arity [2;2], but another function with the arity exist; at line 5"}
|
||||
return {_[1]}
|
||||
--[[
|
||||
{ "error", "trying to define function function arity conflict.f with arity [2;2], but another function with the arity exist; at line 5" }
|
||||
]]--
|
||||
14
test/tests/function cycle.ans
Normal file
14
test/tests/function cycle.ans
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
$ f
|
||||
$ a
|
||||
a
|
||||
$ b
|
||||
b
|
||||
$ c
|
||||
c
|
||||
~ cycle("a","b","c")
|
||||
|
||||
~ f
|
||||
~ f
|
||||
~ f
|
||||
~ f
|
||||
~ f
|
||||
46
test/tests/function cycle.lua
Normal file
46
test/tests/function cycle.lua
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
local _={}
|
||||
_[21]={}
|
||||
_[20]={}
|
||||
_[19]={}
|
||||
_[18]={}
|
||||
_[17]={}
|
||||
_[16]={data="b",tags=_[21]}
|
||||
_[15]={data="a",tags=_[20]}
|
||||
_[14]={data="c",tags=_[19]}
|
||||
_[13]={data="b",tags=_[18]}
|
||||
_[12]={data="a",tags=_[17]}
|
||||
_[11]={_[16]}
|
||||
_[10]={_[15]}
|
||||
_[9]={_[14]}
|
||||
_[8]={_[13]}
|
||||
_[7]={_[12]}
|
||||
_[6]={"return"}
|
||||
_[5]={"text",_[11]}
|
||||
_[4]={"text",_[10]}
|
||||
_[3]={"text",_[9]}
|
||||
_[2]={"text",_[8]}
|
||||
_[1]={"text",_[7]}
|
||||
return {_[1],_[2],_[3],_[4],_[5],_[6]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "a",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "b",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "c",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "a",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "b",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
14
test/tests/function next.ans
Normal file
14
test/tests/function next.ans
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
$ f
|
||||
$ a
|
||||
a
|
||||
$ b
|
||||
b
|
||||
$ c
|
||||
c
|
||||
~ next("a","b","c")
|
||||
|
||||
~ f
|
||||
~ f
|
||||
~ f
|
||||
~ f
|
||||
~ f
|
||||
46
test/tests/function next.lua
Normal file
46
test/tests/function next.lua
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
local _={}
|
||||
_[21]={}
|
||||
_[20]={}
|
||||
_[19]={}
|
||||
_[18]={}
|
||||
_[17]={}
|
||||
_[16]={data="c",tags=_[21]}
|
||||
_[15]={data="c",tags=_[20]}
|
||||
_[14]={data="c",tags=_[19]}
|
||||
_[13]={data="b",tags=_[18]}
|
||||
_[12]={data="a",tags=_[17]}
|
||||
_[11]={_[16]}
|
||||
_[10]={_[15]}
|
||||
_[9]={_[14]}
|
||||
_[8]={_[13]}
|
||||
_[7]={_[12]}
|
||||
_[6]={"return"}
|
||||
_[5]={"text",_[11]}
|
||||
_[4]={"text",_[10]}
|
||||
_[3]={"text",_[9]}
|
||||
_[2]={"text",_[8]}
|
||||
_[1]={"text",_[7]}
|
||||
return {_[1],_[2],_[3],_[4],_[5],_[6]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "a",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "b",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "c",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "c",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "c",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
14
test/tests/function random.ans
Normal file
14
test/tests/function random.ans
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
$ f
|
||||
$ a
|
||||
a
|
||||
$ b
|
||||
b
|
||||
$ c
|
||||
c
|
||||
~ random("a","b","c")
|
||||
|
||||
~ f
|
||||
~ f
|
||||
~ f
|
||||
~ f
|
||||
~ f
|
||||
46
test/tests/function random.lua
Normal file
46
test/tests/function random.lua
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
local _={}
|
||||
_[21]={}
|
||||
_[20]={}
|
||||
_[19]={}
|
||||
_[18]={}
|
||||
_[17]={}
|
||||
_[16]={data="a",tags=_[21]}
|
||||
_[15]={data="c",tags=_[20]}
|
||||
_[14]={data="c",tags=_[19]}
|
||||
_[13]={data="c",tags=_[18]}
|
||||
_[12]={data="b",tags=_[17]}
|
||||
_[11]={_[16]}
|
||||
_[10]={_[15]}
|
||||
_[9]={_[14]}
|
||||
_[8]={_[13]}
|
||||
_[7]={_[12]}
|
||||
_[6]={"return"}
|
||||
_[5]={"text",_[11]}
|
||||
_[4]={"text",_[10]}
|
||||
_[3]={"text",_[9]}
|
||||
_[2]={"text",_[8]}
|
||||
_[1]={"text",_[7]}
|
||||
return {_[1],_[2],_[3],_[4],_[5],_[6]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "b",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "c",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "c",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "c",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "a",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
7
test/tests/function return nested.ans
Normal file
7
test/tests/function return nested.ans
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
$ hey
|
||||
§ foo
|
||||
@2
|
||||
@5
|
||||
|
||||
{hey}
|
||||
{hey.foo}
|
||||
19
test/tests/function return nested.lua
Normal file
19
test/tests/function return nested.lua
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
local _={}
|
||||
_[7]={}
|
||||
_[6]={}
|
||||
_[5]={data="2",tags=_[7]}
|
||||
_[4]={data="5",tags=_[6]}
|
||||
_[3]={_[4],_[5]}
|
||||
_[2]={"return"}
|
||||
_[1]={"text",_[3]}
|
||||
return {_[1],_[2]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "5",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "2",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
4
test/tests/function return.ans
Normal file
4
test/tests/function return.ans
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
$ hey
|
||||
@5
|
||||
|
||||
{hey}
|
||||
14
test/tests/function return.lua
Normal file
14
test/tests/function return.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
local _={}
|
||||
_[5]={}
|
||||
_[4]={data="5",tags=_[5]}
|
||||
_[3]={_[4]}
|
||||
_[2]={"return"}
|
||||
_[1]={"text",_[3]}
|
||||
return {_[1],_[2]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "5",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
4
test/tests/function scope wrong.ans
Normal file
4
test/tests/function scope wrong.ans
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
$ a
|
||||
:5 b
|
||||
|
||||
a: {b}
|
||||
6
test/tests/function scope wrong.lua
Normal file
6
test/tests/function scope wrong.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
local _={}
|
||||
_[1]={"error","unknown identifier \"b\"; at line 4"}
|
||||
return {_[1]}
|
||||
--[[
|
||||
{ "error", 'unknown identifier "b"; at line 4' }
|
||||
]]--
|
||||
4
test/tests/function scope.ans
Normal file
4
test/tests/function scope.ans
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
$ a
|
||||
:5 b
|
||||
|
||||
a: {a.b}
|
||||
14
test/tests/function scope.lua
Normal file
14
test/tests/function scope.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
local _={}
|
||||
_[5]={}
|
||||
_[4]={data="a: 5",tags=_[5]}
|
||||
_[3]={_[4]}
|
||||
_[2]={"return"}
|
||||
_[1]={"text",_[3]}
|
||||
return {_[1],_[2]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "a: 5",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
4
test/tests/function ufcs arg.ans
Normal file
4
test/tests/function ufcs arg.ans
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
$ f(a)
|
||||
{a}
|
||||
|
||||
~ "ok".f()
|
||||
14
test/tests/function ufcs arg.lua
Normal file
14
test/tests/function ufcs arg.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
local _={}
|
||||
_[5]={}
|
||||
_[4]={data="ok",tags=_[5]}
|
||||
_[3]={_[4]}
|
||||
_[2]={"return"}
|
||||
_[1]={"text",_[3]}
|
||||
return {_[1],_[2]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "ok",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
4
test/tests/function ufcs args.ans
Normal file
4
test/tests/function ufcs args.ans
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
$ f(a, b)
|
||||
{a}{b}
|
||||
|
||||
~ "o".f("k")
|
||||
14
test/tests/function ufcs args.lua
Normal file
14
test/tests/function ufcs args.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
local _={}
|
||||
_[5]={}
|
||||
_[4]={data="ok",tags=_[5]}
|
||||
_[3]={_[4]}
|
||||
_[2]={"return"}
|
||||
_[1]={"text",_[3]}
|
||||
return {_[1],_[2]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "ok",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
4
test/tests/function vararg empty.ans
Normal file
4
test/tests/function vararg empty.ans
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
$ f(l...)
|
||||
{l}
|
||||
|
||||
~ f()
|
||||
14
test/tests/function vararg empty.lua
Normal file
14
test/tests/function vararg empty.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
local _={}
|
||||
_[5]={}
|
||||
_[4]={data="[]",tags=_[5]}
|
||||
_[3]={_[4]}
|
||||
_[2]={"return"}
|
||||
_[1]={"text",_[3]}
|
||||
return {_[1],_[2]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "[]",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
4
test/tests/function vararg.ans
Normal file
4
test/tests/function vararg.ans
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
$ f(l...)
|
||||
{l}
|
||||
|
||||
~ f("o", "k")
|
||||
14
test/tests/function vararg.lua
Normal file
14
test/tests/function vararg.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
local _={}
|
||||
_[5]={}
|
||||
_[4]={data="[o, k]",tags=_[5]}
|
||||
_[3]={_[4]}
|
||||
_[2]={"return"}
|
||||
_[1]={"text",_[3]}
|
||||
return {_[1],_[2]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "[o, k]",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
4
test/tests/function.ans
Normal file
4
test/tests/function.ans
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
$ f
|
||||
ok
|
||||
|
||||
~ f
|
||||
14
test/tests/function.lua
Normal file
14
test/tests/function.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
local _={}
|
||||
_[5]={}
|
||||
_[4]={data="ok",tags=_[5]}
|
||||
_[3]={_[4]}
|
||||
_[2]={"return"}
|
||||
_[1]={"text",_[3]}
|
||||
return {_[1],_[2]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "ok",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
19
test/tests/interrupt callback nested paragraph.ans
Normal file
19
test/tests/interrupt callback nested paragraph.ans
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
$ oh
|
||||
§ leave
|
||||
in interrupt: {bar.var}
|
||||
no
|
||||
$ bar
|
||||
:5 var
|
||||
|
||||
~ var := 2
|
||||
|
||||
before: {var}
|
||||
|
||||
~ interrupt("leave")
|
||||
|
||||
§ foo
|
||||
checkpoint
|
||||
|
||||
after: {var}
|
||||
|
||||
~ oh.bar
|
||||
29
test/tests/interrupt callback nested paragraph.lua
Normal file
29
test/tests/interrupt callback nested paragraph.lua
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
local _={}
|
||||
_[12]={}
|
||||
_[11]={}
|
||||
_[10]={}
|
||||
_[9]={data="no",tags=_[12]}
|
||||
_[8]={data="in interrupt: 5",tags=_[11]}
|
||||
_[7]={data="before: 2",tags=_[10]}
|
||||
_[6]={_[8],_[9]}
|
||||
_[5]={_[7]}
|
||||
_[4]={"return"}
|
||||
_[3]={"text",_[6]}
|
||||
_[2]={"wait",0}
|
||||
_[1]={"text",_[5]}
|
||||
return {_[1],_[2],_[3],_[4]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "before: 2",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "wait", 0 }
|
||||
{ "text", { {
|
||||
data = "in interrupt: 5",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "no",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
20
test/tests/interrupt callback nested.ans
Normal file
20
test/tests/interrupt callback nested.ans
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
$ leave
|
||||
in interrupt: {oh.bar.var}
|
||||
|
||||
$ oh
|
||||
no
|
||||
$ bar
|
||||
:5 var
|
||||
|
||||
~ var := 2
|
||||
|
||||
before: {var}
|
||||
|
||||
~ interrupt("leave")
|
||||
|
||||
§ foo
|
||||
checkpoint
|
||||
|
||||
after: {var}
|
||||
|
||||
~ oh.bar
|
||||
24
test/tests/interrupt callback nested.lua
Normal file
24
test/tests/interrupt callback nested.lua
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
local _={}
|
||||
_[10]={}
|
||||
_[9]={}
|
||||
_[8]={data="in interrupt: 5",tags=_[10]}
|
||||
_[7]={data="before: 2",tags=_[9]}
|
||||
_[6]={_[8]}
|
||||
_[5]={_[7]}
|
||||
_[4]={"return"}
|
||||
_[3]={"text",_[6]}
|
||||
_[2]={"wait",0}
|
||||
_[1]={"text",_[5]}
|
||||
return {_[1],_[2],_[3],_[4]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "before: 2",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "wait", 0 }
|
||||
{ "text", { {
|
||||
data = "in interrupt: 5",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
18
test/tests/interrupt callback.ans
Normal file
18
test/tests/interrupt callback.ans
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
$ bar
|
||||
:5 var
|
||||
|
||||
~ var := 2
|
||||
|
||||
$ leave
|
||||
in interrupt: {var}
|
||||
|
||||
before: {var}
|
||||
|
||||
~ interrupt("leave")
|
||||
|
||||
§ foo
|
||||
checkpoint
|
||||
|
||||
after: {var}
|
||||
|
||||
~ bar
|
||||
24
test/tests/interrupt callback.lua
Normal file
24
test/tests/interrupt callback.lua
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
local _={}
|
||||
_[10]={}
|
||||
_[9]={}
|
||||
_[8]={data="in interrupt: 5",tags=_[10]}
|
||||
_[7]={data="before: 2",tags=_[9]}
|
||||
_[6]={_[8]}
|
||||
_[5]={_[7]}
|
||||
_[4]={"return"}
|
||||
_[3]={"text",_[6]}
|
||||
_[2]={"wait",0}
|
||||
_[1]={"text",_[5]}
|
||||
return {_[1],_[2],_[3],_[4]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "before: 2",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "wait", 0 }
|
||||
{ "text", { {
|
||||
data = "in interrupt: 5",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
18
test/tests/interrupt no callback.ans
Normal file
18
test/tests/interrupt no callback.ans
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
$ bar
|
||||
:5 var
|
||||
|
||||
~ var := 2
|
||||
|
||||
$ leave
|
||||
in interrupt: {var}
|
||||
|
||||
before: {var}
|
||||
|
||||
~ interrupt()
|
||||
|
||||
§ foo
|
||||
checkpoint
|
||||
|
||||
after: {var}
|
||||
|
||||
~ bar
|
||||
16
test/tests/interrupt no callback.lua
Normal file
16
test/tests/interrupt no callback.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
local _={}
|
||||
_[6]={}
|
||||
_[5]={data="before: 2",tags=_[6]}
|
||||
_[4]={_[5]}
|
||||
_[3]={"return",""}
|
||||
_[2]={"wait",0}
|
||||
_[1]={"text",_[4]}
|
||||
return {_[1],_[2],_[3]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "before: 2",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "wait", 0 }
|
||||
{ "return", "" }
|
||||
]]--
|
||||
3
test/tests/paragraph decorator scope explicit call.ans
Normal file
3
test/tests/paragraph decorator scope explicit call.ans
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
a.👁️: {a.👁️} § a
|
||||
|
||||
~ a()
|
||||
22
test/tests/paragraph decorator scope explicit call.lua
Normal file
22
test/tests/paragraph decorator scope explicit call.lua
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
local _={}
|
||||
_[9]={}
|
||||
_[8]={}
|
||||
_[7]={data="a.\240\159\145\129\239\184\143: 1",tags=_[9]}
|
||||
_[6]={data="a.\240\159\145\129\239\184\143: 0",tags=_[8]}
|
||||
_[5]={_[7]}
|
||||
_[4]={_[6]}
|
||||
_[3]={"return"}
|
||||
_[2]={"text",_[5]}
|
||||
_[1]={"text",_[4]}
|
||||
return {_[1],_[2],_[3]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "a.👁️: 0",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "a.👁️: 1",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
6
test/tests/paragraph decorator scope implicit call.ans
Normal file
6
test/tests/paragraph decorator scope implicit call.ans
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
$ f
|
||||
ko
|
||||
a.👁️: {a.👁️} § a
|
||||
ok
|
||||
|
||||
~ f.a
|
||||
19
test/tests/paragraph decorator scope implicit call.lua
Normal file
19
test/tests/paragraph decorator scope implicit call.lua
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
local _={}
|
||||
_[7]={}
|
||||
_[6]={}
|
||||
_[5]={data="ok",tags=_[7]}
|
||||
_[4]={data="a.\240\159\145\129\239\184\143: 0",tags=_[6]}
|
||||
_[3]={_[4],_[5]}
|
||||
_[2]={"return"}
|
||||
_[1]={"text",_[3]}
|
||||
return {_[1],_[2]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "a.👁️: 0",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "ok",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
1
test/tests/paragraph decorator scope.ans
Normal file
1
test/tests/paragraph decorator scope.ans
Normal file
|
|
@ -0,0 +1 @@
|
|||
a.👁️: {a.👁️} § a
|
||||
14
test/tests/paragraph decorator scope.lua
Normal file
14
test/tests/paragraph decorator scope.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
local _={}
|
||||
_[5]={}
|
||||
_[4]={data="a.\240\159\145\129\239\184\143: 0",tags=_[5]}
|
||||
_[3]={_[4]}
|
||||
_[2]={"return"}
|
||||
_[1]={"text",_[3]}
|
||||
return {_[1],_[2]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "a.👁️: 0",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
14
test/tests/paragraph run force.ans
Normal file
14
test/tests/paragraph run force.ans
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
$ f
|
||||
x
|
||||
§ p
|
||||
a
|
||||
b
|
||||
|
||||
Force run checkpoint:
|
||||
~ f.p()
|
||||
|
||||
From checkpoint:
|
||||
~ f
|
||||
|
||||
Force no checkpoint:
|
||||
~ f()
|
||||
55
test/tests/paragraph run force.lua
Normal file
55
test/tests/paragraph run force.lua
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
local _={}
|
||||
_[23]={}
|
||||
_[22]={}
|
||||
_[21]={}
|
||||
_[20]={}
|
||||
_[19]={}
|
||||
_[18]={}
|
||||
_[17]={}
|
||||
_[16]={}
|
||||
_[15]={data="b",tags=_[23]}
|
||||
_[14]={data="x",tags=_[22]}
|
||||
_[13]={data="Force no checkpoint:",tags=_[21]}
|
||||
_[12]={data="b",tags=_[20]}
|
||||
_[11]={data="a",tags=_[19]}
|
||||
_[10]={data="From checkpoint:",tags=_[18]}
|
||||
_[9]={data="a",tags=_[17]}
|
||||
_[8]={data="Force run checkpoint:",tags=_[16]}
|
||||
_[7]={_[13],_[14],_[15]}
|
||||
_[6]={_[10],_[11],_[12]}
|
||||
_[5]={_[8],_[9]}
|
||||
_[4]={"return"}
|
||||
_[3]={"text",_[7]}
|
||||
_[2]={"text",_[6]}
|
||||
_[1]={"text",_[5]}
|
||||
return {_[1],_[2],_[3],_[4]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "Force run checkpoint:",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "a",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "From checkpoint:",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "a",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "b",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "Force no checkpoint:",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "x",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "b",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
14
test/tests/paragraph run from.ans
Normal file
14
test/tests/paragraph run from.ans
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
$ f
|
||||
x
|
||||
§ p
|
||||
a
|
||||
b
|
||||
|
||||
Force run from checkpoint:
|
||||
~ f.p
|
||||
|
||||
From checkpoint:
|
||||
~ f
|
||||
|
||||
Force no checkpoint:
|
||||
~ f()
|
||||
60
test/tests/paragraph run from.lua
Normal file
60
test/tests/paragraph run from.lua
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
local _={}
|
||||
_[25]={}
|
||||
_[24]={}
|
||||
_[23]={}
|
||||
_[22]={}
|
||||
_[21]={}
|
||||
_[20]={}
|
||||
_[19]={}
|
||||
_[18]={}
|
||||
_[17]={}
|
||||
_[16]={data="b",tags=_[25]}
|
||||
_[15]={data="x",tags=_[24]}
|
||||
_[14]={data="Force no checkpoint:",tags=_[23]}
|
||||
_[13]={data="b",tags=_[22]}
|
||||
_[12]={data="a",tags=_[21]}
|
||||
_[11]={data="From checkpoint:",tags=_[20]}
|
||||
_[10]={data="b",tags=_[19]}
|
||||
_[9]={data="a",tags=_[18]}
|
||||
_[8]={data="Force run from checkpoint:",tags=_[17]}
|
||||
_[7]={_[14],_[15],_[16]}
|
||||
_[6]={_[11],_[12],_[13]}
|
||||
_[5]={_[8],_[9],_[10]}
|
||||
_[4]={"return"}
|
||||
_[3]={"text",_[7]}
|
||||
_[2]={"text",_[6]}
|
||||
_[1]={"text",_[5]}
|
||||
return {_[1],_[2],_[3],_[4]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "Force run from checkpoint:",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "a",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "b",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "From checkpoint:",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "a",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "b",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "Force no checkpoint:",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "x",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "b",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
14
test/tests/paragraph run.ans
Normal file
14
test/tests/paragraph run.ans
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
$ f
|
||||
x
|
||||
§ p
|
||||
a
|
||||
b
|
||||
|
||||
No checkpoint:
|
||||
~ f
|
||||
|
||||
From checkpoint:
|
||||
~ f
|
||||
|
||||
Force no checkpoint:
|
||||
~ f()
|
||||
60
test/tests/paragraph run.lua
Normal file
60
test/tests/paragraph run.lua
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
local _={}
|
||||
_[25]={}
|
||||
_[24]={}
|
||||
_[23]={}
|
||||
_[22]={}
|
||||
_[21]={}
|
||||
_[20]={}
|
||||
_[19]={}
|
||||
_[18]={}
|
||||
_[17]={}
|
||||
_[16]={data="b",tags=_[25]}
|
||||
_[15]={data="x",tags=_[24]}
|
||||
_[14]={data="Force no checkpoint:",tags=_[23]}
|
||||
_[13]={data="b",tags=_[22]}
|
||||
_[12]={data="a",tags=_[21]}
|
||||
_[11]={data="From checkpoint:",tags=_[20]}
|
||||
_[10]={data="b",tags=_[19]}
|
||||
_[9]={data="x",tags=_[18]}
|
||||
_[8]={data="No checkpoint:",tags=_[17]}
|
||||
_[7]={_[14],_[15],_[16]}
|
||||
_[6]={_[11],_[12],_[13]}
|
||||
_[5]={_[8],_[9],_[10]}
|
||||
_[4]={"return"}
|
||||
_[3]={"text",_[7]}
|
||||
_[2]={"text",_[6]}
|
||||
_[1]={"text",_[5]}
|
||||
return {_[1],_[2],_[3],_[4]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "No checkpoint:",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "x",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "b",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "From checkpoint:",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "a",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "b",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "Force no checkpoint:",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "x",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "b",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
3
test/tests/paragraph.ans
Normal file
3
test/tests/paragraph.ans
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
§ p
|
||||
a
|
||||
b
|
||||
14
test/tests/paragraph.lua
Normal file
14
test/tests/paragraph.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
local _={}
|
||||
_[5]={}
|
||||
_[4]={data="b",tags=_[5]}
|
||||
_[3]={_[4]}
|
||||
_[2]={"return"}
|
||||
_[1]={"text",_[3]}
|
||||
return {_[1],_[2]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "b",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
4
test/tests/tag decorator empty.ans
Normal file
4
test/tests/tag decorator empty.ans
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# 1
|
||||
foo
|
||||
~ 1 #
|
||||
bar
|
||||
18
test/tests/tag decorator empty.lua
Normal file
18
test/tests/tag decorator empty.lua
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
local _={}
|
||||
_[6]={1}
|
||||
_[5]={data="bar",tags=_[6]}
|
||||
_[4]={data="foo",tags=_[6]}
|
||||
_[3]={_[4],_[5]}
|
||||
_[2]={"return"}
|
||||
_[1]={"text",_[3]}
|
||||
return {_[1],_[2]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "foo",
|
||||
tags = <1>{ 1 }
|
||||
}, {
|
||||
data = "bar",
|
||||
tags = <table 1>
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
4
test/tests/tag decorator nested.ans
Normal file
4
test/tests/tag decorator nested.ans
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# 1
|
||||
foo
|
||||
~ 1 # "a": [2,3]
|
||||
bar
|
||||
22
test/tests/tag decorator nested.lua
Normal file
22
test/tests/tag decorator nested.lua
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
local _={}
|
||||
_[8]={2,3}
|
||||
_[7]={1,a=_[8]}
|
||||
_[6]={1}
|
||||
_[5]={data="bar",tags=_[7]}
|
||||
_[4]={data="foo",tags=_[6]}
|
||||
_[3]={_[4],_[5]}
|
||||
_[2]={"return"}
|
||||
_[1]={"text",_[3]}
|
||||
return {_[1],_[2]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "foo",
|
||||
tags = { 1 }
|
||||
}, {
|
||||
data = "bar",
|
||||
tags = { 1,
|
||||
a = { 2, 3 }
|
||||
}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue