1
0
Fork 0
mirror of https://github.com/Reuh/anselme.git synced 2025-10-28 00:59:31 +00:00
This commit is contained in:
Étienne Fildadut 2020-05-24 20:31:09 +02:00
parent 7a5a05ff34
commit b233d7fa1e
138 changed files with 4369 additions and 1611 deletions

View file

@ -0,0 +1,11 @@
> ye
no
> ne
ok
~ choose(2)
> ho
plop
> oh
plup
~ choose(1)

View 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" }
]]--

View file

@ -0,0 +1,11 @@
$ f
> neol
nah
> ho
plop
~ f
> oh
ok
~ f
~ choose(3)

View 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" }
]]--

View file

@ -0,0 +1,5 @@
> ye
no
> ne
ok
~ choose(2)

View 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" }
]]--

View file

@ -0,0 +1,7 @@
(hey couic + 5)
other stuff
CHAZOUM
OO
k

View file

@ -0,0 +1,6 @@
local _={}
_[1]={"return"}
return {_[1]}
--[[
{ "return" }
]]--

1
test/tests/comment.ans Normal file
View file

@ -0,0 +1 @@
(hey couic + 5)

6
test/tests/comment.lua Normal file
View file

@ -0,0 +1,6 @@
local _={}
_[1]={"return"}
return {_[1]}
--[[
{ "return" }
]]--

20
test/tests/commit.ans Normal file
View 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
View 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" }
]]--

View file

@ -0,0 +1,3 @@
ko ~ 0
ok ~ 1
ok bis ~

View 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" }
]]--

View file

@ -0,0 +1,6 @@
:5 a
~ a = 2
ko
~~
ok

View 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" }
]]--

View file

@ -0,0 +1,6 @@
:5 a
~ a = 5
ok
~~
ko

View 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" }
]]--

View file

@ -0,0 +1,8 @@
:5 a
~ a = 2
ko
~~ 0
ko
~~
ok

View 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" }
]]--

View file

@ -0,0 +1,8 @@
:5 a
~ a = 2
ko
~~ 1
ok
~~
ko

View 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" }
]]--

View file

@ -0,0 +1,4 @@
:5 a
~ a = 2
ko

View file

@ -0,0 +1,6 @@
local _={}
_[1]={"return"}
return {_[1]}
--[[
{ "return" }
]]--

View file

@ -0,0 +1,4 @@
:5 a
~ a = 5
ok

View 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" }
]]--

View file

@ -0,0 +1,3 @@
ah
~ wait(5)
ho

View 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" }
]]--

View file

@ -0,0 +1,3 @@
$ a
:2 a

View 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" }
]]--

View file

@ -0,0 +1,3 @@
:2 a
$ a

View 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" }
]]--

View file

@ -0,0 +1,5 @@
:5 a
:2 a
a: {a}

View 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
View file

@ -0,0 +1 @@
:5 a

6
test/tests/define.lua Normal file
View file

@ -0,0 +1,6 @@
local _={}
_[1]={"return"}
return {_[1]}
--[[
{ "return" }
]]--

View file

@ -0,0 +1,5 @@
$ f(a, l...)
{a}
{l}
~ f("ok", "o", "k")

View 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" }
]]--

View file

@ -0,0 +1,4 @@
$ f(a)
{a}
~ f("ok")

View 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" }
]]--

View file

@ -0,0 +1,4 @@
$ f(a, b)
{a}{b}
~ f("ok")

View 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' }
]]--

View file

@ -0,0 +1,5 @@
$ f(a, b, l...)
{a}{b}
{l}
~ f("o","k")

View 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" }
]]--

View file

@ -0,0 +1,5 @@
$ f(a, b, l...)
{a}{b}
{l}
~ f("o", "k", "o", "k")

View 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" }
]]--

View file

@ -0,0 +1,4 @@
$ f(a, b)
{a}{b}
~ f("o", "k")

View 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" }
]]--

View file

@ -0,0 +1,5 @@
$ f(a, b)
$ f(x)
$ f(u, v)

View 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" }
]]--

View file

@ -0,0 +1,14 @@
$ f
$ a
a
$ b
b
$ c
c
~ cycle("a","b","c")
~ f
~ f
~ f
~ f
~ f

View 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" }
]]--

View file

@ -0,0 +1,14 @@
$ f
$ a
a
$ b
b
$ c
c
~ next("a","b","c")
~ f
~ f
~ f
~ f
~ f

View 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" }
]]--

View file

@ -0,0 +1,14 @@
$ f
$ a
a
$ b
b
$ c
c
~ random("a","b","c")
~ f
~ f
~ f
~ f
~ f

View 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" }
]]--

View file

@ -0,0 +1,7 @@
$ hey
§ foo
@2
@5
{hey}
{hey.foo}

View 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" }
]]--

View file

@ -0,0 +1,4 @@
$ hey
@5
{hey}

View 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" }
]]--

View file

@ -0,0 +1,4 @@
$ a
:5 b
a: {b}

View file

@ -0,0 +1,6 @@
local _={}
_[1]={"error","unknown identifier \"b\"; at line 4"}
return {_[1]}
--[[
{ "error", 'unknown identifier "b"; at line 4' }
]]--

View file

@ -0,0 +1,4 @@
$ a
:5 b
a: {a.b}

View 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" }
]]--

View file

@ -0,0 +1,4 @@
$ f(a)
{a}
~ "ok".f()

View 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" }
]]--

View file

@ -0,0 +1,4 @@
$ f(a, b)
{a}{b}
~ "o".f("k")

View 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" }
]]--

View file

@ -0,0 +1,4 @@
$ f(l...)
{l}
~ f()

View 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" }
]]--

View file

@ -0,0 +1,4 @@
$ f(l...)
{l}
~ f("o", "k")

View 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
View file

@ -0,0 +1,4 @@
$ f
ok
~ f

14
test/tests/function.lua Normal file
View 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" }
]]--

View 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

View 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" }
]]--

View 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

View 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" }
]]--

View file

@ -0,0 +1,18 @@
$ bar
:5 var
~ var := 2
$ leave
in interrupt: {var}
before: {var}
~ interrupt("leave")
§ foo
checkpoint
after: {var}
~ bar

View 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" }
]]--

View file

@ -0,0 +1,18 @@
$ bar
:5 var
~ var := 2
$ leave
in interrupt: {var}
before: {var}
~ interrupt()
§ foo
checkpoint
after: {var}
~ bar

View 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", "" }
]]--

View file

@ -0,0 +1,3 @@
a.👁️: {a.👁️} § a
~ a()

View 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" }
]]--

View file

@ -0,0 +1,6 @@
$ f
ko
a.👁️: {a.👁️} § a
ok
~ f.a

View 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" }
]]--

View file

@ -0,0 +1 @@
a.👁️: {a.👁️} § a

View 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" }
]]--

View file

@ -0,0 +1,14 @@
$ f
x
§ p
a
b
Force run checkpoint:
~ f.p()
From checkpoint:
~ f
Force no checkpoint:
~ f()

View 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" }
]]--

View file

@ -0,0 +1,14 @@
$ f
x
§ p
a
b
Force run from checkpoint:
~ f.p
From checkpoint:
~ f
Force no checkpoint:
~ f()

View 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" }
]]--

View file

@ -0,0 +1,14 @@
$ f
x
§ p
a
b
No checkpoint:
~ f
From checkpoint:
~ f
Force no checkpoint:
~ f()

View 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
View file

@ -0,0 +1,3 @@
§ p
a
b

14
test/tests/paragraph.lua Normal file
View 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" }
]]--

View file

@ -0,0 +1,4 @@
# 1
foo
~ 1 #
bar

View 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" }
]]--

View file

@ -0,0 +1,4 @@
# 1
foo
~ 1 # "a": [2,3]
bar

View 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