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

Anselme v2.0.0-alpha rewrite

Woke up and felt like changing a couple things. It's actually been worked on for a while, little at a time...

The goal was to make the language and implementation much simpler. Well I don't know if it really ended up being simpler but it sure is more robust.

Main changes:
* proper first class functions and closures supports! proper scoping rules! no more namespace shenanigans!
* everything is an expression, no more statements! make the implementation both simpler and more complex, but it's much more consistent now! the syntax has massively changed as a result though.
* much more organized and easy to modify codebase: one file for each AST node, no more random fields or behavior set by some random node exceptionally, everything should now follow the same API defined in ast.abstract.Node

Every foundational feature should be implemented right now. The vast majority of things that were possible in v2 are possible now; some things aren't, but that's usually because v2 is a bit more sane.
The main missing things before a proper release are tests and documentation. There's a few other things that might be implemented later, see the ideas.md file.
This commit is contained in:
Étienne Fildadut 2023-12-17 17:15:16 +01:00
parent 2ff494d108
commit fe351b5ca4
484 changed files with 7099 additions and 18084 deletions

View file

@ -1,21 +0,0 @@
:f = $(x)x*x
:$g(x)
@x*x
{f(5)} = {g(5)}
{f(2)} = {g(2)}
:y = 5
:h = $(x)x*x+y
{h(3)} == 14
~ y := 7
{h(5)} == 32
:i = $y*y
{i} == 49

View file

@ -1,81 +0,0 @@
local _={}
_[35]={}
_[34]={}
_[33]={}
_[32]={}
_[31]={}
_[30]={}
_[29]={}
_[28]={}
_[27]={}
_[26]={}
_[25]={}
_[24]={}
_[23]={tags=_[35],text=" == 49"}
_[22]={tags=_[34],text="49"}
_[21]={tags=_[33],text=" == 32"}
_[20]={tags=_[32],text="32"}
_[19]={tags=_[31],text=" == 14"}
_[18]={tags=_[30],text="14"}
_[17]={tags=_[29],text="4"}
_[16]={tags=_[28],text=" = "}
_[15]={tags=_[27],text="4"}
_[14]={tags=_[26],text="25"}
_[13]={tags=_[25],text=" = "}
_[12]={tags=_[24],text="25"}
_[11]={_[22],_[23]}
_[10]={_[20],_[21]}
_[9]={_[18],_[19]}
_[8]={_[15],_[16],_[17]}
_[7]={_[12],_[13],_[14]}
_[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", { {
tags = {},
text = "25"
}, {
tags = {},
text = " = "
}, {
tags = {},
text = "25"
} } }
{ "text", { {
tags = {},
text = "4"
}, {
tags = {},
text = " = "
}, {
tags = {},
text = "4"
} } }
{ "text", { {
tags = {},
text = "14"
}, {
tags = {},
text = " == 14"
} } }
{ "text", { {
tags = {},
text = "32"
}, {
tags = {},
text = " == 32"
} } }
{ "text", { {
tags = {},
text = "49"
}, {
tags = {},
text = " == 49"
} } }
{ "return" }
]]--

View file

@ -1,4 +0,0 @@
:$ f(str: foo)
@str + foo
{f("bi")} = {f(foo="bi")}

View file

@ -1,22 +0,0 @@
local _={}
_[7]={}
_[6]={tags=_[7],text="bibi"}
_[5]={tags=_[7],text=" = "}
_[4]={tags=_[7],text="bibi"}
_[3]={_[4],_[5],_[6]}
_[2]={"return"}
_[1]={"text",_[3]}
return {_[1],_[2]}
--[[
{ "text", { {
tags = <1>{},
text = "bibi"
}, {
tags = <table 1>,
text = " = "
}, {
tags = <table 1>,
text = "bibi"
} } }
{ "return" }
]]--

View file

@ -1,11 +0,0 @@
:$ _-_(a, b)
@"generic minus"
:$ _-_(a::string, b::string)
@a + " minus " + b
{2-5}
{"heh"-"lol"}
{[]-[]}

View file

@ -1,30 +0,0 @@
local _={}
_[13]={}
_[12]={}
_[11]={}
_[10]={tags=_[13],text="generic minus"}
_[9]={tags=_[12],text="heh minus lol"}
_[8]={tags=_[11],text="-3"}
_[7]={_[10]}
_[6]={_[9]}
_[5]={_[8]}
_[4]={"return"}
_[3]={"text",_[7]}
_[2]={"text",_[6]}
_[1]={"text",_[5]}
return {_[1],_[2],_[3],_[4]}
--[[
{ "text", { {
tags = {},
text = "-3"
} } }
{ "text", { {
tags = {},
text = "heh minus lol"
} } }
{ "text", { {
tags = {},
text = "generic minus"
} } }
{ "return" }
]]--

View file

@ -1,7 +0,0 @@
:c = 1
{c}
~ c += 2
{c}

View file

@ -1,22 +0,0 @@
local _={}
_[9]={}
_[8]={}
_[7]={tags=_[9],text="3"}
_[6]={tags=_[8],text="1"}
_[5]={_[7]}
_[4]={_[6]}
_[3]={"return"}
_[2]={"text",_[5]}
_[1]={"text",_[4]}
return {_[1],_[2],_[3]}
--[[
{ "text", { {
tags = {},
text = "1"
} } }
{ "text", { {
tags = {},
text = "3"
} } }
{ "return" }
]]--

View file

@ -1,33 +0,0 @@
:$ f
x
:! p
a
:! q
b
c
d
From start:
~ f
From p checkpoint:
~ f
From q checkpoint:
~ f
From q checkpoint again:
~ f
Force p checkpoint:
~ f.p()
From q again:
~ f
Go to p again by setting checkpoint manually:
~ f.checkpoint := &f.p
~ f

View file

@ -1,193 +0,0 @@
local _={}
_[91]={}
_[90]={}
_[89]={}
_[88]={}
_[87]={}
_[86]={}
_[85]={}
_[84]={}
_[83]={}
_[82]={}
_[81]={}
_[80]={}
_[79]={}
_[78]={}
_[77]={}
_[76]={}
_[75]={}
_[74]={}
_[73]={}
_[72]={}
_[71]={}
_[70]={}
_[69]={}
_[68]={}
_[67]={}
_[66]={}
_[65]={tags=_[91],text="d"}
_[64]={tags=_[90],text="c"}
_[63]={tags=_[89],text="a"}
_[62]={tags=_[88],text="Go to p again by setting checkpoint manually:"}
_[61]={tags=_[87],text="d"}
_[60]={tags=_[86],text="c"}
_[59]={tags=_[85],text="b"}
_[58]={tags=_[84],text="From q again:"}
_[57]={tags=_[83],text="c"}
_[56]={tags=_[82],text="a"}
_[55]={tags=_[81],text="Force p checkpoint:"}
_[54]={tags=_[80],text="d"}
_[53]={tags=_[79],text="c"}
_[52]={tags=_[78],text="b"}
_[51]={tags=_[77],text="From q checkpoint again:"}
_[50]={tags=_[76],text="d"}
_[49]={tags=_[75],text="c"}
_[48]={tags=_[74],text="b"}
_[47]={tags=_[73],text="From q checkpoint:"}
_[46]={tags=_[72],text="d"}
_[45]={tags=_[71],text="c"}
_[44]={tags=_[70],text="a"}
_[43]={tags=_[69],text="From p checkpoint:"}
_[42]={tags=_[68],text="d"}
_[41]={tags=_[67],text="x"}
_[40]={tags=_[66],text="From start:"}
_[39]={_[65]}
_[38]={_[64]}
_[37]={_[62],_[63]}
_[36]={_[61]}
_[35]={_[60]}
_[34]={_[58],_[59]}
_[33]={_[57]}
_[32]={_[55],_[56]}
_[31]={_[54]}
_[30]={_[53]}
_[29]={_[51],_[52]}
_[28]={_[50]}
_[27]={_[49]}
_[26]={_[47],_[48]}
_[25]={_[46]}
_[24]={_[45]}
_[23]={_[43],_[44]}
_[22]={_[42]}
_[21]={_[40],_[41]}
_[20]={"return"}
_[19]={"text",_[39]}
_[18]={"text",_[38]}
_[17]={"text",_[37]}
_[16]={"text",_[36]}
_[15]={"text",_[35]}
_[14]={"text",_[34]}
_[13]={"text",_[33]}
_[12]={"text",_[32]}
_[11]={"text",_[31]}
_[10]={"text",_[30]}
_[9]={"text",_[29]}
_[8]={"text",_[28]}
_[7]={"text",_[27]}
_[6]={"text",_[26]}
_[5]={"text",_[25]}
_[4]={"text",_[24]}
_[3]={"text",_[23]}
_[2]={"text",_[22]}
_[1]={"text",_[21]}
return {_[1],_[2],_[3],_[4],_[5],_[6],_[7],_[8],_[9],_[10],_[11],_[12],_[13],_[14],_[15],_[16],_[17],_[18],_[19],_[20]}
--[[
{ "text", { {
tags = {},
text = "From start:"
}, {
tags = {},
text = "x"
} } }
{ "text", { {
tags = {},
text = "d"
} } }
{ "text", { {
tags = {},
text = "From p checkpoint:"
}, {
tags = {},
text = "a"
} } }
{ "text", { {
tags = {},
text = "c"
} } }
{ "text", { {
tags = {},
text = "d"
} } }
{ "text", { {
tags = {},
text = "From q checkpoint:"
}, {
tags = {},
text = "b"
} } }
{ "text", { {
tags = {},
text = "c"
} } }
{ "text", { {
tags = {},
text = "d"
} } }
{ "text", { {
tags = {},
text = "From q checkpoint again:"
}, {
tags = {},
text = "b"
} } }
{ "text", { {
tags = {},
text = "c"
} } }
{ "text", { {
tags = {},
text = "d"
} } }
{ "text", { {
tags = {},
text = "Force p checkpoint:"
}, {
tags = {},
text = "a"
} } }
{ "text", { {
tags = {},
text = "c"
} } }
{ "text", { {
tags = {},
text = "From q again:"
}, {
tags = {},
text = "b"
} } }
{ "text", { {
tags = {},
text = "c"
} } }
{ "text", { {
tags = {},
text = "d"
} } }
{ "text", { {
tags = {},
text = "Go to p again by setting checkpoint manually:"
}, {
tags = {},
text = "a"
} } }
{ "text", { {
tags = {},
text = "c"
} } }
{ "text", { {
tags = {},
text = "d"
} } }
{ "return" }
]]--

View file

@ -1,26 +0,0 @@
:post run = "after error"
:l = [1,2]
1,2: {l}
~ l!insert(3)
1,2,3: {l}
:! a
~ l!insert(4)
1,2,3,4: {l}
:! b
~ l!insert(5)
1,2,3,4,5: {l}
~ error("cancel merge")
:$ after error
1,2,3,4: {l}

View file

@ -1,68 +0,0 @@
local _={}
_[27]={}
_[26]={}
_[25]={}
_[24]={}
_[23]={}
_[22]={tags=_[27],text="[1, 2, 3, 4]"}
_[21]={tags=_[27],text="1,2,3,4: "}
_[20]={tags=_[26],text="[1, 2, 3, 4, 5]"}
_[19]={tags=_[26],text="1,2,3,4,5: "}
_[18]={tags=_[25],text="[1, 2, 3, 4]"}
_[17]={tags=_[25],text="1,2,3,4: "}
_[16]={tags=_[24],text="[1, 2, 3]"}
_[15]={tags=_[24],text="1,2,3: "}
_[14]={tags=_[23],text="[1, 2]"}
_[13]={tags=_[23],text="1,2: "}
_[12]={_[21],_[22]}
_[11]={_[19],_[20]}
_[10]={_[17],_[18]}
_[9]={_[15],_[16]}
_[8]={_[13],_[14]}
_[7]={"return"}
_[6]={"text",_[12]}
_[5]={"error","cancel merge; in Lua function \"error\"; at test/tests/checkpoint merging mutable value.ans:23"}
_[4]={"text",_[11]}
_[3]={"text",_[10]}
_[2]={"text",_[9]}
_[1]={"text",_[8]}
return {_[1],_[2],_[3],_[4],_[5],_[6],_[7]}
--[[
{ "text", { {
tags = <1>{},
text = "1,2: "
}, {
tags = <table 1>,
text = "[1, 2]"
} } }
{ "text", { {
tags = <1>{},
text = "1,2,3: "
}, {
tags = <table 1>,
text = "[1, 2, 3]"
} } }
{ "text", { {
tags = <1>{},
text = "1,2,3,4: "
}, {
tags = <table 1>,
text = "[1, 2, 3, 4]"
} } }
{ "text", { {
tags = <1>{},
text = "1,2,3,4,5: "
}, {
tags = <table 1>,
text = "[1, 2, 3, 4, 5]"
} } }
{ "error", 'cancel merge; in Lua function "error"; at test/tests/checkpoint merging mutable value.ans:23' }
{ "text", { {
tags = <1>{},
text = "1,2,3,4: "
}, {
tags = <table 1>,
text = "[1, 2, 3, 4]"
} } }
{ "return" }
]]--

View file

@ -1,26 +0,0 @@
:post run = "after error"
:l = 1
1: {l}
~ l := 2
2: {l}
:! a
~ l := 3
3: {l}
:! b
~ l := 4
4: {l}
~ error("cancel merge")
:$ after error
3: {l}

View file

@ -1,68 +0,0 @@
local _={}
_[27]={}
_[26]={}
_[25]={}
_[24]={}
_[23]={}
_[22]={tags=_[27],text="3"}
_[21]={tags=_[27],text="3: "}
_[20]={tags=_[26],text="4"}
_[19]={tags=_[26],text="4: "}
_[18]={tags=_[25],text="3"}
_[17]={tags=_[25],text="3: "}
_[16]={tags=_[24],text="2"}
_[15]={tags=_[24],text="2: "}
_[14]={tags=_[23],text="1"}
_[13]={tags=_[23],text="1: "}
_[12]={_[21],_[22]}
_[11]={_[19],_[20]}
_[10]={_[17],_[18]}
_[9]={_[15],_[16]}
_[8]={_[13],_[14]}
_[7]={"return"}
_[6]={"text",_[12]}
_[5]={"error","cancel merge; in Lua function \"error\"; at test/tests/checkpoint merging variable.ans:23"}
_[4]={"text",_[11]}
_[3]={"text",_[10]}
_[2]={"text",_[9]}
_[1]={"text",_[8]}
return {_[1],_[2],_[3],_[4],_[5],_[6],_[7]}
--[[
{ "text", { {
tags = <1>{},
text = "1: "
}, {
tags = <table 1>,
text = "1"
} } }
{ "text", { {
tags = <1>{},
text = "2: "
}, {
tags = <table 1>,
text = "2"
} } }
{ "text", { {
tags = <1>{},
text = "3: "
}, {
tags = <table 1>,
text = "3"
} } }
{ "text", { {
tags = <1>{},
text = "4: "
}, {
tags = <table 1>,
text = "4"
} } }
{ "error", 'cancel merge; in Lua function "error"; at test/tests/checkpoint merging variable.ans:23' }
{ "text", { {
tags = <1>{},
text = "3: "
}, {
tags = <table 1>,
text = "3"
} } }
{ "return" }
]]--

View file

@ -1,8 +0,0 @@
:! p
seen!
Seen: {p.seen}
Reached: {p.reached}
@p ~ !p.seen

View file

@ -1,66 +0,0 @@
local _={}
_[29]={}
_[28]={}
_[27]={}
_[26]={}
_[25]={}
_[24]={}
_[23]={}
_[22]={}
_[21]={}
_[20]={text="1",tags=_[29]}
_[19]={text="Reached: ",tags=_[28]}
_[18]={text="1",tags=_[27]}
_[17]={text="Seen: ",tags=_[26]}
_[16]={text="seen!",tags=_[25]}
_[15]={text="1",tags=_[24]}
_[14]={text="Reached: ",tags=_[23]}
_[13]={text="0",tags=_[22]}
_[12]={text="Seen: ",tags=_[21]}
_[11]={_[19],_[20]}
_[10]={_[17],_[18]}
_[9]={_[16]}
_[8]={_[14],_[15]}
_[7]={_[12],_[13]}
_[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", { {
tags = {},
text = "Seen: "
}, {
tags = {},
text = "0"
} } }
{ "text", { {
tags = {},
text = "Reached: "
}, {
tags = {},
text = "1"
} } }
{ "text", { {
tags = {},
text = "seen!"
} } }
{ "text", { {
tags = {},
text = "Seen: "
}, {
tags = {},
text = "1"
} } }
{ "text", { {
tags = {},
text = "Reached: "
}, {
tags = {},
text = "1"
} } }
{ "return" }
]]--

View file

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

View file

@ -1,50 +0,0 @@
local _={}
_[23]={}
_[22]={}
_[21]={}
_[20]={tags=_[23],text="oh"}
_[19]={tags=_[21],text="ho"}
_[18]={}
_[17]={tags=_[18],text="ne"}
_[16]={tags=_[22],text="ye"}
_[15]={tags=_[21],text="plop"}
_[14]={_[20]}
_[13]={_[19]}
_[12]={tags=_[18],text="ok"}
_[11]={_[17]}
_[10]={_[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", { { {
tags = {},
text = "ye"
} }, { {
tags = {},
text = "ne"
} } } }
{ "text", { {
tags = {},
text = "ok"
} } }
{ "choice", { { {
tags = {},
text = "ho"
} }, { {
tags = {},
text = "oh"
} } } }
{ "text", { {
tags = {},
text = "plop"
} } }
{ "return" }
]]--

View file

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

View file

@ -1,40 +0,0 @@
local _={}
_[18]={}
_[17]={}
_[16]={}
_[15]={}
_[14]={tags=_[18],text="neol"}
_[13]={tags=_[15],text="oh"}
_[12]={tags=_[17],text="neol"}
_[11]={tags=_[16],text="ho"}
_[10]={tags=_[15],text="ok"}
_[9]={_[14]}
_[8]={_[13]}
_[7]={_[12]}
_[6]={_[11]}
_[5]={_[10]}
_[4]={_[6],_[7],_[8],_[9]}
_[3]={"return"}
_[2]={"text",_[5]}
_[1]={"choice",_[4]}
return {_[1],_[2],_[3]}
--[[
{ "choice", { { {
tags = {},
text = "ho"
} }, { {
tags = {},
text = "neol"
} }, { {
tags = {},
text = "oh"
} }, { {
tags = {},
text = "neol"
} } } }
{ "text", { {
tags = {},
text = "ok"
} } }
{ "return" }
]]--

View file

@ -1,10 +0,0 @@
~ choose(1)
> Press {jump button} to jump.
ok
> No
ko
:$ jump button
A # 1
> Suprise choice!
@"JOIN"

View file

@ -1,47 +0,0 @@
local _={}
_[19]={}
_[18]={}
_[17]={1}
_[16]={}
_[15]={text="No",tags=_[19]}
_[14]={text=" to jump.",tags=_[16]}
_[13]={text="JOIN",tags=_[16]}
_[12]={text="Suprise choice!",tags=_[18]}
_[11]={text="A",tags=_[17]}
_[10]={text="Press ",tags=_[16]}
_[9]={text="ok",tags=_[16]}
_[8]={_[15]}
_[7]={_[12],_[13],_[14]}
_[6]={_[10],_[11]}
_[5]={_[9]}
_[4]={_[6],_[7],_[8]}
_[3]={"return"}
_[2]={"text",_[5]}
_[1]={"choice",_[4]}
return {_[1],_[2],_[3]}
--[[
{ "choice", { { {
tags = <1>{},
text = "Press "
}, {
tags = { 1 },
text = "A"
} }, { {
tags = {},
text = "Suprise choice!"
}, {
tags = <table 1>,
text = "JOIN"
}, {
tags = <table 1>,
text = " to jump."
} }, { {
tags = {},
text = "No"
} } } }
{ "text", { {
tags = {},
text = "ok"
} } }
{ "return" }
]]--

View file

@ -1,11 +0,0 @@
~ choose(1)
> Press {jump button} to jump.
ok
~ choose(1)
> No
ko
:$ jump button
A # 1
@"SPLIT"

View file

@ -1,55 +0,0 @@
local _={}
_[22]={}
_[21]={1}
_[20]={tags=_[22],text="No"}
_[19]={text=" to jump."}
_[18]={text="SPLIT"}
_[17]={}
_[16]={tags=_[21],text="A"}
_[15]={tags=_[17],text="Press "}
_[14]={tags=_[17],text="ok"}
_[13]={_[20]}
_[12]={_[18],_[19]}
_[11]={tags=_[17],text="ok"}
_[10]={_[15],_[16]}
_[9]={_[14]}
_[8]={_[12],_[13]}
_[7]={_[11]}
_[6]={_[10]}
_[5]={"return"}
_[4]={"text",_[9]}
_[3]={"choice",_[8]}
_[2]={"text",_[7]}
_[1]={"choice",_[6]}
_[0]={_[1],_[2],_[3],_[4],_[5]}
_[18].tags=_[17]
_[19].tags=_[17]
return _[0]
--[[
{ "choice", { { {
tags = {},
text = "Press "
}, {
tags = { 1 },
text = "A"
} } } }
{ "text", { {
tags = {},
text = "ok"
} } }
{ "choice", { { {
tags = <1>{},
text = "SPLIT"
}, {
tags = <table 1>,
text = " to jump."
} }, { {
tags = {},
text = "No"
} } } }
{ "text", { {
tags = {},
text = "ok"
} } }
{ "return" }
]]--

View file

@ -1,18 +0,0 @@
> Press {jump button} to jump.
ok
> No
ko
~ choose(1)
:$ jump button
A # 1
> Other
ko
> Use {move axis} to move.
ok
~ choose(2)
:$ move axis
left # 1
@" joystick"

View file

@ -1,72 +0,0 @@
local _={}
_[30]={1}
_[29]={}
_[28]={}
_[27]={1}
_[26]={}
_[25]={text=" to move.",tags=_[26]}
_[24]={text="joystick",tags=_[26]}
_[23]={text="left ",tags=_[30]}
_[22]={text="Use ",tags=_[26]}
_[21]={text="Other",tags=_[29]}
_[20]={}
_[19]={text="No",tags=_[28]}
_[18]={text="to jump.",tags=_[20]}
_[17]={text="A ",tags=_[27]}
_[16]={text="Press ",tags=_[20]}
_[15]={text="ok",tags=_[26]}
_[14]={_[22],_[23],_[24],_[25]}
_[13]={_[21]}
_[12]={text="ok",tags=_[20]}
_[11]={_[19]}
_[10]={_[16],_[17],_[18]}
_[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", { { {
tags = <1>{},
text = "Press "
}, {
tags = { 1 },
text = "A "
}, {
tags = <table 1>,
text = "to jump."
} }, { {
tags = {},
text = "No"
} } } }
{ "text", { {
tags = {},
text = "ok"
} } }
{ "choice", { { {
tags = {},
text = "Other"
} }, { {
tags = <1>{},
text = "Use "
}, {
tags = { 1 },
text = "left "
}, {
tags = <table 1>,
text = "joystick"
}, {
tags = <table 1>,
text = " to move."
} } } }
{ "text", { {
tags = {},
text = "ok"
} } }
{ "return" }
]]--

View file

@ -1,16 +0,0 @@
:$ f
# 42
> a
b
~ f
> c
~ choose(1)
# "k"="v"
~ f
> d
~ choose(1)
e
f

View file

@ -1,73 +0,0 @@
local _={}
_[30]={}
_[29]={}
_[28]={k="v"}
_[27]={42,k="v"}
_[26]={tags=_[28],text="d"}
_[25]={tags=_[27],text="a"}
_[24]={42}
_[23]={tags=_[30],text="c"}
_[22]={tags=_[24],text="a"}
_[21]={tags=_[29],text="f"}
_[20]={tags=_[28],text="e"}
_[19]={tags=_[27],text="b"}
_[18]={_[26]}
_[17]={_[25]}
_[16]={tags=_[24],text="b"}
_[15]={_[23]}
_[14]={_[22]}
_[13]={_[21]}
_[12]={_[20]}
_[11]={_[19]}
_[10]={_[17],_[18]}
_[9]={_[16]}
_[8]={_[14],_[15]}
_[7]={"return"}
_[6]={"text",_[13]}
_[5]={"text",_[12]}
_[4]={"text",_[11]}
_[3]={"choice",_[10]}
_[2]={"text",_[9]}
_[1]={"choice",_[8]}
return {_[1],_[2],_[3],_[4],_[5],_[6],_[7]}
--[[
{ "choice", { { {
tags = { 42 },
text = "a"
} }, { {
tags = {},
text = "c"
} } } }
{ "text", { {
tags = { 42 },
text = "b"
} } }
{ "choice", { { {
tags = { 42,
k = "v"
},
text = "a"
} }, { {
tags = {
k = "v"
},
text = "d"
} } } }
{ "text", { {
tags = { 42,
k = "v"
},
text = "b"
} } }
{ "text", { {
tags = {
k = "v"
},
text = "e"
} } }
{ "text", { {
tags = {},
text = "f"
} } }
{ "return" }
]]--

View file

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

View file

@ -1,28 +0,0 @@
local _={}
_[12]={}
_[11]={}
_[10]={tags=_[11],text="ne"}
_[9]={tags=_[12],text="ye"}
_[8]={tags=_[11],text="ok"}
_[7]={_[10]}
_[6]={_[9]}
_[5]={_[8]}
_[4]={_[6],_[7]}
_[3]={"return"}
_[2]={"text",_[5]}
_[1]={"choice",_[4]}
return {_[1],_[2],_[3]}
--[[
{ "choice", { { {
tags = {},
text = "ye"
} }, { {
tags = {},
text = "ne"
} } } }
{ "text", { {
tags = {},
text = "ok"
} } }
{ "return" }
]]--

View file

@ -1,35 +0,0 @@
> a ~ 1
-> a
> b
-> b
~ choose(1)
> a ~ 1
-> a
> b
-> b
~ choose(2)
> a ~ 0
-> a
> b
-> b
~ choose(1)
> a
-> a
> b # 25
-> b
~ choose(2)
> a ~ 0 # 12
-> a
> b # 3
-> b
~ choose(1)
> a ~ 1 # 12
-> a
> b # 3
-> b
~ choose(1)

View file

@ -1,132 +0,0 @@
local _={}
_[67]={3}
_[66]={12}
_[65]={3}
_[64]={25}
_[63]={}
_[62]={}
_[61]={}
_[60]={}
_[59]={}
_[58]={}
_[57]={}
_[56]={text="b",tags=_[67]}
_[55]={text="a",tags=_[66]}
_[54]={}
_[53]={text="b",tags=_[65]}
_[52]={}
_[51]={text="b",tags=_[64]}
_[50]={text="a",tags=_[63]}
_[49]={}
_[48]={text="b",tags=_[62]}
_[47]={}
_[46]={text="b",tags=_[61]}
_[45]={text="a",tags=_[60]}
_[44]={}
_[43]={text="b",tags=_[59]}
_[42]={text="a",tags=_[58]}
_[41]={text="-> a",tags=_[57]}
_[40]={_[56]}
_[39]={_[55]}
_[38]={text="-> b",tags=_[54]}
_[37]={_[53]}
_[36]={text="-> b",tags=_[52]}
_[35]={_[51]}
_[34]={_[50]}
_[33]={text="-> b",tags=_[49]}
_[32]={_[48]}
_[31]={text="-> b",tags=_[47]}
_[30]={_[46]}
_[29]={_[45]}
_[28]={text="-> a",tags=_[44]}
_[27]={_[43]}
_[26]={_[42]}
_[25]={_[41]}
_[24]={_[39],_[40]}
_[23]={_[38]}
_[22]={_[37]}
_[21]={_[36]}
_[20]={_[34],_[35]}
_[19]={_[33]}
_[18]={_[32]}
_[17]={_[31]}
_[16]={_[29],_[30]}
_[15]={_[28]}
_[14]={_[26],_[27]}
_[13]={"return"}
_[12]={"text",_[25]}
_[11]={"choice",_[24]}
_[10]={"text",_[23]}
_[9]={"choice",_[22]}
_[8]={"text",_[21]}
_[7]={"choice",_[20]}
_[6]={"text",_[19]}
_[5]={"choice",_[18]}
_[4]={"text",_[17]}
_[3]={"choice",_[16]}
_[2]={"text",_[15]}
_[1]={"choice",_[14]}
return {_[1],_[2],_[3],_[4],_[5],_[6],_[7],_[8],_[9],_[10],_[11],_[12],_[13]}
--[[
{ "choice", { { {
tags = {},
text = "a"
} }, { {
tags = {},
text = "b"
} } } }
{ "text", { {
tags = {},
text = "-> a"
} } }
{ "choice", { { {
tags = {},
text = "a"
} }, { {
tags = {},
text = "b"
} } } }
{ "text", { {
tags = {},
text = "-> b"
} } }
{ "choice", { { {
tags = {},
text = "b"
} } } }
{ "text", { {
tags = {},
text = "-> b"
} } }
{ "choice", { { {
tags = {},
text = "a"
} }, { {
tags = { 25 },
text = "b"
} } } }
{ "text", { {
tags = {},
text = "-> b"
} } }
{ "choice", { { {
tags = { 3 },
text = "b"
} } } }
{ "text", { {
tags = {},
text = "-> b"
} } }
{ "choice", { { {
tags = { 12 },
text = "a"
} }, { {
tags = { 3 },
text = "b"
} } } }
{ "text", { {
tags = {},
text = "-> a"
} } }
{ "return" }
]]--

View file

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

View file

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

View file

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

View file

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

View file

@ -1,20 +0,0 @@
:$ bar
:var=5
~ var := 2
before: {var}
~ run("parallel")
:! foo
checkpoint
after: {var}
~ run("parallel")
:$ parallel
parallel: {bar.var}
~ bar

View file

@ -1,54 +0,0 @@
local _={}
_[21]={}
_[20]={}
_[19]={}
_[18]={}
_[17]={tags=_[21],text="2"}
_[16]={tags=_[21],text="parallel: "}
_[15]={tags=_[20],text="2"}
_[14]={tags=_[20],text="after: "}
_[13]={tags=_[19],text="5"}
_[12]={tags=_[19],text="parallel: "}
_[11]={tags=_[18],text="2"}
_[10]={tags=_[18],text="before: "}
_[9]={_[16],_[17]}
_[8]={_[14],_[15]}
_[7]={_[12],_[13]}
_[6]={_[10],_[11]}
_[5]={"return"}
_[4]={"text",_[9]}
_[3]={"text",_[8]}
_[2]={"text",_[7]}
_[1]={"text",_[6]}
return {_[1],_[2],_[3],_[4],_[5]}
--[[
{ "text", { {
tags = <1>{},
text = "before: "
}, {
tags = <table 1>,
text = "2"
} } }
{ "text", { {
tags = <1>{},
text = "parallel: "
}, {
tags = <table 1>,
text = "5"
} } }
{ "text", { {
tags = <1>{},
text = "after: "
}, {
tags = <table 1>,
text = "2"
} } }
{ "text", { {
tags = <1>{},
text = "parallel: "
}, {
tags = <table 1>,
text = "2"
} } }
{ "return" }
]]--

View file

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

View file

@ -1,19 +0,0 @@
local _={}
_[7]={}
_[6]={}
_[5]={text="ok bis",tags=_[7]}
_[4]={text="ok ",tags=_[6]}
_[3]={_[4],_[5]}
_[2]={"return"}
_[1]={"text",_[3]}
return {_[1],_[2]}
--[[
{ "text", { {
tags = {},
text = "ok "
}, {
tags = {},
text = "ok bis"
} } }
{ "return" }
]]--

View file

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

View file

@ -1,14 +0,0 @@
local _={}
_[5]={}
_[4]={tags=_[5],text="ok"}
_[3]={_[4]}
_[2]={"return"}
_[1]={"text",_[3]}
return {_[1],_[2]}
--[[
{ "text", { {
tags = {},
text = "ok"
} } }
{ "return" }
]]--

View file

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

View file

@ -1,14 +0,0 @@
local _={}
_[5]={}
_[4]={tags=_[5],text="ok"}
_[3]={_[4]}
_[2]={"return"}
_[1]={"text",_[3]}
return {_[1],_[2]}
--[[
{ "text", { {
tags = {},
text = "ok"
} } }
{ "return" }
]]--

View file

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

View file

@ -1,14 +0,0 @@
local _={}
_[5]={}
_[4]={tags=_[5],text="ok"}
_[3]={_[4]}
_[2]={"return"}
_[1]={"text",_[3]}
return {_[1],_[2]}
--[[
{ "text", { {
tags = {},
text = "ok"
} } }
{ "return" }
]]--

View file

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

View file

@ -1,14 +0,0 @@
local _={}
_[5]={}
_[4]={tags=_[5],text="ok"}
_[3]={_[4]}
_[2]={"return"}
_[1]={"text",_[3]}
return {_[1],_[2]}
--[[
{ "text", { {
tags = {},
text = "ok"
} } }
{ "return" }
]]--

View file

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

View file

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

View file

@ -1,6 +0,0 @@
:$ f
b
a {f ~ 5} c
a {f ~ 0} c

View file

@ -1,35 +0,0 @@
local _={}
_[13]={}
_[12]={}
_[11]={}
_[10]={tags=_[13],text="c"}
_[9]={tags=_[13],text="a "}
_[8]={tags=_[11],text=" c"}
_[7]={tags=_[12],text="b"}
_[6]={tags=_[11],text="a "}
_[5]={_[9],_[10]}
_[4]={_[6],_[7],_[8]}
_[3]={"return"}
_[2]={"text",_[5]}
_[1]={"text",_[4]}
return {_[1],_[2],_[3]}
--[[
{ "text", { {
tags = <1>{},
text = "a "
}, {
tags = {},
text = "b"
}, {
tags = <table 1>,
text = " c"
} } }
{ "text", { {
tags = <1>{},
text = "a "
}, {
tags = <table 1>,
text = "c"
} } }
{ "return" }
]]--

View file

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

View file

@ -1,14 +0,0 @@
local _={}
_[5]={}
_[4]={tags=_[5],text="ok"}
_[3]={_[4]}
_[2]={"return"}
_[1]={"text",_[3]}
return {_[1],_[2]}
--[[
{ "text", { {
tags = {},
text = "ok"
} } }
{ "return" }
]]--

View file

@ -1,8 +0,0 @@
:% obj
::a = 12
:x = obj()
{x.a}
{x.a := 52}

View file

@ -1,14 +0,0 @@
local _={}
_[5]={}
_[4]={tags=_[5],text="12"}
_[3]={_[4]}
_[2]={"error","can't change the value of a constant attribute; in Lua function \"_._\"; at test/tests/constant object attribute.ans:8"}
_[1]={"text",_[3]}
return {_[1],_[2]}
--[[
{ "text", { {
tags = {},
text = "12"
} } }
{ "error", "can't change the value of a constant attribute; in Lua function \"_._\"; at test/tests/constant object attribute.ans:8" }
]]--

View file

@ -1,8 +0,0 @@
:% obj
:a = 12
::x = obj()
{x.a}
{x.a := 52}

View file

@ -1,14 +0,0 @@
local _={}
_[5]={}
_[4]={tags=_[5],text="12"}
_[3]={_[4]}
_[2]={"error","can't change the value of an attribute of a constant object; in Lua function \"_._\"; at test/tests/constant object.ans:8"}
_[1]={"text",_[3]}
return {_[1],_[2]}
--[[
{ "text", { {
tags = {},
text = "12"
} } }
{ "error", "can't change the value of an attribute of a constant object; in Lua function \"_._\"; at test/tests/constant object.ans:8" }
]]--

View file

@ -1,15 +0,0 @@
:l = [1,2,3]
::x = l
{l}
{x}
-----
~ l!remove()
{l}
{x}
~ x!remove()

View file

@ -1,40 +0,0 @@
local _={}
_[17]={}
_[16]={}
_[15]={}
_[14]={}
_[13]={}
_[12]={text="[1, 2, 3]",tags=_[17]}
_[11]={text="[1, 2]",tags=_[16]}
_[10]={text="-----",tags=_[15]}
_[9]={text="[1, 2, 3]",tags=_[14]}
_[8]={text="[1, 2, 3]",tags=_[13]}
_[7]={_[11],_[12]}
_[6]={_[10]}
_[5]={_[8],_[9]}
_[4]={"error","can't remove values from a constant list; in Lua function \"remove\"; at test/tests/constant values variable.ans:15"}
_[3]={"text",_[7]}
_[2]={"text",_[6]}
_[1]={"text",_[5]}
return {_[1],_[2],_[3],_[4]}
--[[
{ "text", { {
tags = {},
text = "[1, 2, 3]"
}, {
tags = {},
text = "[1, 2, 3]"
} } }
{ "text", { {
tags = {},
text = "-----"
} } }
{ "text", { {
tags = {},
text = "[1, 2]"
}, {
tags = {},
text = "[1, 2, 3]"
} } }
{ "error", "can't remove values from a constant list; in Lua function \"remove\"; at test/tests/constant values variable.ans:15" }
]]--

View file

@ -1,15 +0,0 @@
:l = [1,2,3]
:x = constant(l)
{l}
{x}
-----
~ l!remove()
{l}
{x}
~ x!remove()

View file

@ -1,40 +0,0 @@
local _={}
_[17]={}
_[16]={}
_[15]={}
_[14]={}
_[13]={}
_[12]={text="[1, 2, 3]",tags=_[17]}
_[11]={text="[1, 2]",tags=_[16]}
_[10]={text="-----",tags=_[15]}
_[9]={text="[1, 2, 3]",tags=_[14]}
_[8]={text="[1, 2, 3]",tags=_[13]}
_[7]={_[11],_[12]}
_[6]={_[10]}
_[5]={_[8],_[9]}
_[4]={"error","can't remove values from a constant list; in Lua function \"remove\"; at test/tests/constant values.ans:15"}
_[3]={"text",_[7]}
_[2]={"text",_[6]}
_[1]={"text",_[5]}
return {_[1],_[2],_[3],_[4]}
--[[
{ "text", { {
tags = {},
text = "[1, 2, 3]"
}, {
tags = {},
text = "[1, 2, 3]"
} } }
{ "text", { {
tags = {},
text = "-----"
} } }
{ "text", { {
tags = {},
text = "[1, 2]"
}, {
tags = {},
text = "[1, 2, 3]"
} } }
{ "error", "can't remove values from a constant list; in Lua function \"remove\"; at test/tests/constant values.ans:15" }
]]--

View file

@ -1,7 +0,0 @@
::a = [3]
{a}
~ a!insert(52)
{a}

View file

@ -1,14 +0,0 @@
local _={}
_[5]={}
_[4]={tags=_[5],text="[3]"}
_[3]={_[4]}
_[2]={"error","can't insert values into a constant list; in Lua function \"insert\"; at test/tests/constant variable list.ans:5"}
_[1]={"text",_[3]}
return {_[1],_[2]}
--[[
{ "text", { {
tags = {},
text = "[3]"
} } }
{ "error", "can't insert values into a constant list; in Lua function \"insert\"; at test/tests/constant variable list.ans:5" }
]]--

View file

@ -1,7 +0,0 @@
::a = 3
{a}
~ a := 52
{a}

View file

@ -1,14 +0,0 @@
local _={}
_[5]={}
_[4]={tags=_[5],text="3"}
_[3]={_[4]}
_[2]={"error","can't change the value of a constant \"constant variable.a\"; while assigning value to variable \"constant variable.a\"; at test/tests/constant variable.ans:5"}
_[1]={"text",_[3]}
return {_[1],_[2]}
--[[
{ "text", { {
tags = {},
text = "3"
} } }
{ "error", "can't change the value of a constant \"constant variable.a\"; while assigning value to variable \"constant variable.a\"; at test/tests/constant variable.ans:5" }
]]--

View file

@ -1,11 +0,0 @@
:weigh::"kg" = 5::"kg"
{weigh}
~ weigh := 12::"kg"
{weigh}
~ weigh := 32
{weigh}

View file

@ -1,22 +0,0 @@
local _={}
_[9]={}
_[8]={}
_[7]={text="12::kg",tags=_[9]}
_[6]={text="5::kg",tags=_[8]}
_[5]={_[7]}
_[4]={_[6]}
_[3]={"error","constraint check failed; while assigning value to variable \"constrained variable assignement.weigh\"; at test/tests/constrained variable assignement.ans:9"}
_[2]={"text",_[5]}
_[1]={"text",_[4]}
return {_[1],_[2],_[3]}
--[[
{ "text", { {
tags = {},
text = "5::kg"
} } }
{ "text", { {
tags = {},
text = "12::kg"
} } }
{ "error", 'constraint check failed; while assigning value to variable "constrained variable assignement.weigh"; at test/tests/constrained variable assignement.ans:9' }
]]--

View file

@ -1,7 +0,0 @@
:weigh::"kg" = 5::"kg"
{weigh}
:not weigh::"kg" = 12
{not weigh}

View file

@ -1,14 +0,0 @@
local _={}
_[5]={}
_[4]={text="5::kg",tags=_[5]}
_[3]={_[4]}
_[2]={"error","constraint check failed; while assigning value to variable \"constrained variable definition.not weigh\"; at test/tests/constrained variable definition.ans:7"}
_[1]={"text",_[3]}
return {_[1],_[2]}
--[[
{ "text", { {
tags = {},
text = "5::kg"
} } }
{ "error", 'constraint check failed; while assigning value to variable "constrained variable definition.not weigh"; at test/tests/constrained variable definition.ans:7' }
]]--

View file

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

View file

@ -1,21 +0,0 @@
local _={}
_[8]={}
_[7]={}
_[6]={tags=_[8],text="ho"}
_[5]={tags=_[7],text="ah"}
_[4]={_[5],_[6]}
_[3]={"return"}
_[2]={"text",_[4]}
_[1]={"wait",5}
return {_[1],_[2],_[3]}
--[[
{ "wait", 5 }
{ "text", { {
tags = {},
text = "ah"
}, {
tags = {},
text = "ho"
} } }
{ "return" }
]]--

View file

@ -1,11 +0,0 @@
:person = "personne"
:$ Person(name, age)
@{name=name, age=age}::person
:abject = Person("Darmanin", 38)
{abject}
:$ {}(p::person)
@"Name: {p("name")}\nAge: {p("age")}"

View file

@ -1,14 +0,0 @@
local _={}
_[5]={}
_[4]={tags=_[5],text="Name: Darmanin\nAge: 38"}
_[3]={_[4]}
_[2]={"return"}
_[1]={"text",_[3]}
return {_[1],_[2]}
--[[
{ "text", { {
tags = {},
text = "Name: Darmanin\nAge: 38"
} } }
{ "return" }
]]--

View file

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

View file

@ -1,6 +0,0 @@
local _={}
_[1]={"error","trying to define variable \"define override function.a\", but a function with the same name exists; at test/tests/define override function.ans:3"}
return {_[1]}
--[[
{ "error", 'trying to define variable "define override function.a", but a function with the same name exists; at test/tests/define override function.ans:3' }
]]--

View file

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

View file

@ -1,6 +0,0 @@
local _={}
_[1]={"error","trying to define function define override variable.a, but a variable with the same name exists; at test/tests/define override variable.ans:3"}
return {_[1]}
--[[
{ "error", "trying to define function define override variable.a, but a variable with the same name exists; at test/tests/define override variable.ans:3" }
]]--

View file

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

View file

@ -1,6 +0,0 @@
local _={}
_[1]={"error","trying to define variable \"define override.a\" but it is already defined at test/tests/define override.ans:1; at test/tests/define override.ans:3"}
return {_[1]}
--[[
{ "error", 'trying to define variable "define override.a" but it is already defined at test/tests/define override.ans:1; at test/tests/define override.ans:3' }
]]--

View file

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

View file

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

View file

@ -1,29 +0,0 @@
::a = [1=2]
0 = {a == [5=2]!constant}
0 = {a == [1=3]!constant}
1 = {a == [1=2]!constant}
::b = [1,2,3]
0 = {b == a}
0 = {b == []!constant}
0 = {b == [3,1,2]!constant}
0 = {b == [1,2,3,4]!constant}
1 = {b == [1,2,3]!constant}
:c = [1,2,3]
0 = {c == b}
1 = {c!constant == b}
::d = [1,2,3]
1 = {d == b}

View file

@ -1,149 +0,0 @@
local _={}
_[67]={}
_[66]={}
_[65]={}
_[64]={}
_[63]={}
_[62]={}
_[61]={}
_[60]={}
_[59]={}
_[58]={}
_[57]={}
_[56]={}
_[55]={}
_[54]={}
_[53]={}
_[52]={}
_[51]={}
_[50]={}
_[49]={}
_[48]={}
_[47]={}
_[46]={}
_[45]={tags=_[67],text="1"}
_[44]={tags=_[66],text="1 = "}
_[43]={tags=_[65],text="1"}
_[42]={tags=_[64],text="1 = "}
_[41]={tags=_[63],text="0"}
_[40]={tags=_[62],text="0 = "}
_[39]={tags=_[61],text="1"}
_[38]={tags=_[60],text="1 = "}
_[37]={tags=_[59],text="0"}
_[36]={tags=_[58],text="0 = "}
_[35]={tags=_[57],text="0"}
_[34]={tags=_[56],text="0 = "}
_[33]={tags=_[55],text="0"}
_[32]={tags=_[54],text="0 = "}
_[31]={tags=_[53],text="0"}
_[30]={tags=_[52],text="0 = "}
_[29]={tags=_[51],text="1"}
_[28]={tags=_[50],text="1 = "}
_[27]={tags=_[49],text="0"}
_[26]={tags=_[48],text="0 = "}
_[25]={tags=_[47],text="0"}
_[24]={tags=_[46],text="0 = "}
_[23]={_[44],_[45]}
_[22]={_[42],_[43]}
_[21]={_[40],_[41]}
_[20]={_[38],_[39]}
_[19]={_[36],_[37]}
_[18]={_[34],_[35]}
_[17]={_[32],_[33]}
_[16]={_[30],_[31]}
_[15]={_[28],_[29]}
_[14]={_[26],_[27]}
_[13]={_[24],_[25]}
_[12]={"return"}
_[11]={"text",_[23]}
_[10]={"text",_[22]}
_[9]={"text",_[21]}
_[8]={"text",_[20]}
_[7]={"text",_[19]}
_[6]={"text",_[18]}
_[5]={"text",_[17]}
_[4]={"text",_[16]}
_[3]={"text",_[15]}
_[2]={"text",_[14]}
_[1]={"text",_[13]}
return {_[1],_[2],_[3],_[4],_[5],_[6],_[7],_[8],_[9],_[10],_[11],_[12]}
--[[
{ "text", { {
tags = {},
text = "0 = "
}, {
tags = {},
text = "0"
} } }
{ "text", { {
tags = {},
text = "0 = "
}, {
tags = {},
text = "0"
} } }
{ "text", { {
tags = {},
text = "1 = "
}, {
tags = {},
text = "1"
} } }
{ "text", { {
tags = {},
text = "0 = "
}, {
tags = {},
text = "0"
} } }
{ "text", { {
tags = {},
text = "0 = "
}, {
tags = {},
text = "0"
} } }
{ "text", { {
tags = {},
text = "0 = "
}, {
tags = {},
text = "0"
} } }
{ "text", { {
tags = {},
text = "0 = "
}, {
tags = {},
text = "0"
} } }
{ "text", { {
tags = {},
text = "1 = "
}, {
tags = {},
text = "1"
} } }
{ "text", { {
tags = {},
text = "0 = "
}, {
tags = {},
text = "0"
} } }
{ "text", { {
tags = {},
text = "1 = "
}, {
tags = {},
text = "1"
} } }
{ "text", { {
tags = {},
text = "1 = "
}, {
tags = {},
text = "1"
} } }
{ "return" }
]]--

View file

@ -1,8 +0,0 @@
a
> b
~ choose(1)
c
> d
~ choose(1)

View file

@ -1,40 +0,0 @@
local _={}
_[19]={}
_[18]={}
_[17]={tags=_[19],text="d"}
_[16]={}
_[15]={tags=_[18],text="b"}
_[14]={}
_[13]={_[17]}
_[12]={tags=_[16],text="c"}
_[11]={_[15]}
_[10]={tags=_[14],text="a"}
_[9]={_[13]}
_[8]={_[12]}
_[7]={_[11]}
_[6]={_[10]}
_[5]={"return"}
_[4]={"choice",_[9]}
_[3]={"text",_[8]}
_[2]={"choice",_[7]}
_[1]={"text",_[6]}
return {_[1],_[2],_[3],_[4],_[5]}
--[[
{ "text", { {
tags = {},
text = "a"
} } }
{ "choice", { { {
tags = {},
text = "b"
} } } }
{ "text", { {
tags = {},
text = "c"
} } }
{ "choice", { { {
tags = {},
text = "d"
} } } }
{ "return" }
]]--

View file

@ -1,9 +0,0 @@
:$ f : test
@"ok"
{f} = {test}
:$ g : bis(a)
@a
{g("ye")} = {bis("ye")}

View file

@ -1,38 +0,0 @@
local _={}
_[13]={}
_[12]={}
_[11]={tags=_[13],text="ye"}
_[10]={tags=_[13],text=" = "}
_[9]={tags=_[13],text="ye"}
_[8]={tags=_[12],text="ok"}
_[7]={tags=_[12],text=" = "}
_[6]={tags=_[12],text="ok"}
_[5]={_[9],_[10],_[11]}
_[4]={_[6],_[7],_[8]}
_[3]={"return"}
_[2]={"text",_[5]}
_[1]={"text",_[4]}
return {_[1],_[2],_[3]}
--[[
{ "text", { {
tags = <1>{},
text = "ok"
}, {
tags = <table 1>,
text = " = "
}, {
tags = <table 1>,
text = "ok"
} } }
{ "text", { {
tags = <1>{},
text = "ye"
}, {
tags = <table 1>,
text = " = "
}, {
tags = <table 1>,
text = "ye"
} } }
{ "return" }
]]--

View file

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

View file

@ -1,19 +0,0 @@
local _={}
_[7]={}
_[6]={}
_[5]={tags=_[7],text="[o, k]"}
_[4]={tags=_[6],text="ok"}
_[3]={_[4],_[5]}
_[2]={"return"}
_[1]={"text",_[3]}
return {_[1],_[2]}
--[[
{ "text", { {
tags = {},
text = "ok"
}, {
tags = {},
text = "[o, k]"
} } }
{ "return" }
]]--

View file

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

View file

@ -1,14 +0,0 @@
local _={}
_[5]={}
_[4]={tags=_[5],text="ok"}
_[3]={_[4]}
_[2]={"return"}
_[1]={"text",_[3]}
return {_[1],_[2]}
--[[
{ "text", { {
tags = {},
text = "ok"
} } }
{ "return" }
]]--

View file

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

View file

@ -1,6 +0,0 @@
local _={}
_[1]={"error","function \"function args arity check fail.f\" expected 2 arguments but received 1; at test/tests/function args arity check fail.ans:4"}
return {_[1]}
--[[
{ "error", 'function "function args arity check fail.f" expected 2 arguments but received 1; at test/tests/function args arity check fail.ans:4' }
]]--

View file

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

View file

@ -1,23 +0,0 @@
local _={}
_[8]={}
_[7]={}
_[6]={tags=_[8],text="[]"}
_[5]={tags=_[7],text="k"}
_[4]={tags=_[7],text="o"}
_[3]={_[4],_[5],_[6]}
_[2]={"return"}
_[1]={"text",_[3]}
return {_[1],_[2]}
--[[
{ "text", { {
tags = <1>{},
text = "o"
}, {
tags = <table 1>,
text = "k"
}, {
tags = {},
text = "[]"
} } }
{ "return" }
]]--

View file

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

View file

@ -1,23 +0,0 @@
local _={}
_[8]={}
_[7]={}
_[6]={tags=_[8],text="[o, k]"}
_[5]={tags=_[7],text="k"}
_[4]={tags=_[7],text="o"}
_[3]={_[4],_[5],_[6]}
_[2]={"return"}
_[1]={"text",_[3]}
return {_[1],_[2]}
--[[
{ "text", { {
tags = <1>{},
text = "o"
}, {
tags = <table 1>,
text = "k"
}, {
tags = {},
text = "[o, k]"
} } }
{ "return" }
]]--

View file

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

View file

@ -1,18 +0,0 @@
local _={}
_[6]={}
_[5]={tags=_[6],text="k"}
_[4]={tags=_[6],text="o"}
_[3]={_[4],_[5]}
_[2]={"return"}
_[1]={"text",_[3]}
return {_[1],_[2]}
--[[
{ "text", { {
tags = <1>{},
text = "o"
}, {
tags = <table 1>,
text = "k"
} } }
{ "return" }
]]--

Some files were not shown because too many files have changed in this diff Show more