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

Fix a lot of issues when resuming from a paragraph in a choice or expression block

This commit is contained in:
Étienne Fildadut 2021-04-10 14:33:32 +02:00
parent f93d6fab6b
commit dde89502da
67 changed files with 762 additions and 173 deletions

View file

@ -5,12 +5,12 @@ _[19]={}
_[18]={}
_[17]={}
_[16]={}
_[15]={tags=_[21],data="plop"}
_[14]={tags=_[20],data="oh"}
_[13]={tags=_[19],data="ho"}
_[12]={tags=_[18],data="ok"}
_[11]={tags=_[17],data="ne"}
_[10]={tags=_[16],data="ye"}
_[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]}

View file

@ -4,11 +4,11 @@ _[14]={}
_[13]={}
_[12]={}
_[11]={}
_[10]={tags=_[15],data="ok"}
_[9]={tags=_[14],data="neol"}
_[8]={tags=_[13],data="oh"}
_[7]={tags=_[12],data="neol"}
_[6]={tags=_[11],data="ho"}
_[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"}

View file

@ -2,9 +2,9 @@ local _={}
_[11]={}
_[10]={}
_[9]={}
_[8]={tags=_[11],data="ok"}
_[7]={tags=_[10],data="ne"}
_[6]={tags=_[9],data="ye"}
_[8]={data="ok",tags=_[11]}
_[7]={data="ne",tags=_[10]}
_[6]={data="ye",tags=_[9]}
_[5]={_[8]}
_[4]={_[6],_[7]}
_[3]={"return"}

View file

@ -3,10 +3,10 @@ _[17]={}
_[16]={}
_[15]={}
_[14]={}
_[13]={tags=_[17],data="parallel: 2"}
_[12]={tags=_[16],data="after: 2"}
_[11]={tags=_[15],data="parallel: 5"}
_[10]={tags=_[14],data="before: 2"}
_[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]}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,6 +1,6 @@
local _={}
_[5]={}
_[4]={tags=_[5],data="a: 5"}
_[4]={data="a: 5",tags=_[5]}
_[3]={_[4]}
_[2]={"return"}
_[1]={"text",_[3]}

View file

@ -7,14 +7,14 @@ _[29]={}
_[28]={}
_[27]={}
_[26]={}
_[25]={tags=_[33],data="1 = 1"}
_[24]={tags=_[32],data="0 = 0"}
_[23]={tags=_[31],data="0 = 0"}
_[22]={tags=_[30],data="0 = 0"}
_[21]={tags=_[29],data="0 = 0"}
_[20]={tags=_[28],data="1 = 1"}
_[19]={tags=_[27],data="0 = 0"}
_[18]={tags=_[26],data="0 = 0"}
_[25]={data="1 = 1",tags=_[33]}
_[24]={data="0 = 0",tags=_[32]}
_[23]={data="0 = 0",tags=_[31]}
_[22]={data="0 = 0",tags=_[30]}
_[21]={data="0 = 0",tags=_[29]}
_[20]={data="1 = 1",tags=_[28]}
_[19]={data="0 = 0",tags=_[27]}
_[18]={data="0 = 0",tags=_[26]}
_[17]={_[25]}
_[16]={_[24]}
_[15]={_[23]}

8
test/tests/flush.ans Normal file
View file

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

38
test/tests/flush.lua Normal file
View file

@ -0,0 +1,38 @@
local _={}
_[17]={}
_[16]={}
_[15]={}
_[14]={}
_[13]={data="d",tags=_[17]}
_[12]={data="c",tags=_[16]}
_[11]={data="b",tags=_[15]}
_[10]={data="a",tags=_[14]}
_[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", { {
data = "a",
tags = {}
} } }
{ "choice", { {
data = "b",
tags = {}
} } }
{ "text", { {
data = "c",
tags = {}
} } }
{ "choice", { {
data = "d",
tags = {}
} } }
{ "return" }
]]--

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -4,11 +4,11 @@ _[20]={}
_[19]={}
_[18]={}
_[17]={}
_[16]={tags=_[21],data="b"}
_[15]={tags=_[20],data="a"}
_[14]={tags=_[19],data="c"}
_[13]={tags=_[18],data="b"}
_[12]={tags=_[17],data="a"}
_[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]}

View file

@ -4,11 +4,11 @@ _[20]={}
_[19]={}
_[18]={}
_[17]={}
_[16]={tags=_[21],data="c"}
_[15]={tags=_[20],data="c"}
_[14]={tags=_[19],data="c"}
_[13]={tags=_[18],data="b"}
_[12]={tags=_[17],data="a"}
_[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]}

View file

@ -4,11 +4,11 @@ _[20]={}
_[19]={}
_[18]={}
_[17]={}
_[16]={tags=_[21],data="a"}
_[15]={tags=_[20],data="a"}
_[14]={tags=_[19],data="b"}
_[13]={tags=_[18],data="a"}
_[12]={tags=_[17],data="b"}
_[16]={data="a",tags=_[21]}
_[15]={data="a",tags=_[20]}
_[14]={data="b",tags=_[19]}
_[13]={data="a",tags=_[18]}
_[12]={data="b",tags=_[17]}
_[11]={_[16]}
_[10]={_[15]}
_[9]={_[14]}

View file

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

View file

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

View file

@ -1,6 +1,6 @@
local _={}
_[5]={}
_[4]={tags=_[5],data="a: 5"}
_[4]={data="a: 5",tags=_[5]}
_[3]={_[4]}
_[2]={"return"}
_[1]={"text",_[3]}

View file

@ -1,8 +1,8 @@
local _={}
_[9]={}
_[8]={}
_[7]={tags=_[9],data="ok"}
_[6]={tags=_[8],data="ok"}
_[7]={data="ok",tags=_[9]}
_[6]={data="ok",tags=_[8]}
_[5]={_[7]}
_[4]={_[6]}
_[3]={"return"}

View file

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

View file

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

View file

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

View file

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

View file

@ -2,9 +2,9 @@ local _={}
_[12]={}
_[11]={}
_[10]={}
_[9]={tags=_[12],data="no"}
_[8]={tags=_[11],data="in interrupt: 5"}
_[7]={tags=_[10],data="before: 2"}
_[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"}

View file

@ -1,8 +1,8 @@
local _={}
_[10]={}
_[9]={}
_[8]={tags=_[10],data="in interrupt: 5"}
_[7]={tags=_[9],data="before: 2"}
_[8]={data="in interrupt: 5",tags=_[10]}
_[7]={data="before: 2",tags=_[9]}
_[6]={_[8]}
_[5]={_[7]}
_[4]={"return"}

View file

@ -1,8 +1,8 @@
local _={}
_[10]={}
_[9]={}
_[8]={tags=_[10],data="in interrupt: 5"}
_[7]={tags=_[9],data="before: 2"}
_[8]={data="in interrupt: 5",tags=_[10]}
_[7]={data="before: 2",tags=_[9]}
_[6]={_[8]}
_[5]={_[7]}
_[4]={"return"}

View file

@ -1,6 +1,6 @@
local _={}
_[6]={}
_[5]={tags=_[6],data="before: 2"}
_[5]={data="before: 2",tags=_[6]}
_[4]={_[5]}
_[3]={"return",""}
_[2]={"wait",0}

View file

@ -0,0 +1,19 @@
~ 1
yes
~ 0
no
~~
nope
~ 1
hai
~ 0
still no
~~
nein
~ 0
nah
~~
ye
~~
da

View file

@ -0,0 +1,27 @@
local _={}
_[11]={}
_[10]={}
_[9]={}
_[8]={data="da",tags=_[11]}
_[7]={data="ye",tags=_[10]}
_[6]={data="yes",tags=_[9]}
_[5]={_[7],_[8]}
_[4]={_[6]}
_[3]={"return"}
_[2]={"text",_[5]}
_[1]={"text",_[4]}
return {_[1],_[2],_[3]}
--[[
{ "text", { {
data = "yes",
tags = {}
} } }
{ "text", { {
data = "ye",
tags = {}
}, {
data = "da",
tags = {}
} } }
{ "return" }
]]--

View file

@ -0,0 +1,19 @@
~ 1
a
b
~ 1
c
d
~ 1
e
> f
~ choose(1)
~ 1
g
> h
~ choose(1)

View file

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

View file

@ -1,8 +1,8 @@
local _={}
_[9]={}
_[8]={}
_[7]={tags=_[9],data="a.\240\159\145\129\239\184\143: 1"}
_[6]={tags=_[8],data="a.\240\159\145\129\239\184\143: 0"}
_[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"}

View file

@ -1,8 +1,8 @@
local _={}
_[7]={}
_[6]={}
_[5]={tags=_[7],data="ok"}
_[4]={tags=_[6],data="a.\240\159\145\129\239\184\143: 0"}
_[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]}

View file

@ -1,6 +1,6 @@
local _={}
_[5]={}
_[4]={tags=_[5],data="a.\240\159\145\129\239\184\143: 0"}
_[4]={data="a.\240\159\145\129\239\184\143: 0",tags=_[5]}
_[3]={_[4]}
_[2]={"return"}
_[1]={"text",_[3]}

View file

@ -7,14 +7,14 @@ _[19]={}
_[18]={}
_[17]={}
_[16]={}
_[15]={tags=_[23],data="b"}
_[14]={tags=_[22],data="x"}
_[13]={tags=_[21],data="Force no checkpoint:"}
_[12]={tags=_[20],data="b"}
_[11]={tags=_[19],data="a"}
_[10]={tags=_[18],data="From checkpoint:"}
_[9]={tags=_[17],data="a"}
_[8]={tags=_[16],data="Force run checkpoint:"}
_[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]}

View file

@ -8,15 +8,15 @@ _[20]={}
_[19]={}
_[18]={}
_[17]={}
_[16]={tags=_[25],data="b"}
_[15]={tags=_[24],data="x"}
_[14]={tags=_[23],data="Force no checkpoint:"}
_[13]={tags=_[22],data="b"}
_[12]={tags=_[21],data="a"}
_[11]={tags=_[20],data="From checkpoint:"}
_[10]={tags=_[19],data="b"}
_[9]={tags=_[18],data="a"}
_[8]={tags=_[17],data="Force run from checkpoint:"}
_[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]}

View file

@ -8,15 +8,15 @@ _[20]={}
_[19]={}
_[18]={}
_[17]={}
_[16]={tags=_[25],data="b"}
_[15]={tags=_[24],data="x"}
_[14]={tags=_[23],data="Force no checkpoint:"}
_[13]={tags=_[22],data="b"}
_[12]={tags=_[21],data="a"}
_[11]={tags=_[20],data="From checkpoint:"}
_[10]={tags=_[19],data="b"}
_[9]={tags=_[18],data="x"}
_[8]={tags=_[17],data="No checkpoint:"}
_[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]}

View file

@ -1,6 +1,6 @@
local _={}
_[5]={}
_[4]={tags=_[5],data="b"}
_[4]={data="b",tags=_[5]}
_[3]={_[4]}
_[2]={"return"}
_[1]={"text",_[3]}

View file

@ -0,0 +1,77 @@
$ f
> a
-> a
§ p
> aa
-> aa
> ab
-> ab
> b
-> b
~ choose(2)
> c
-> c
~ choose(1)
~ f
~ f.p
$ g
> a
-> a
§ p
> aa
-> aa
> ab
-> ab
> b
-> b
~ choose(2)
autoflush
> c
-> c
~ choose(1)
~ g
~ g.p
$ h
~ 1
> a
-> a
§ p
> aa
-> aa
> ab
-> ab
~ choose(1)
> b
-> b
> c
-> c
~ choose(1)
~ h
~ h.p
$ i
> a
-> a
§ p
> aa
-> aa
> ab
-> ab
> b
-> b
~ 1
> c
-> c
~ i
~ i.p

View file

@ -0,0 +1,256 @@
local _={}
_[121]={}
_[120]={}
_[119]={}
_[118]={}
_[117]={}
_[116]={}
_[115]={}
_[114]={}
_[113]={}
_[112]={}
_[111]={}
_[110]={}
_[109]={}
_[108]={}
_[107]={}
_[106]={}
_[105]={}
_[104]={}
_[103]={}
_[102]={}
_[101]={}
_[100]={}
_[99]={}
_[98]={}
_[97]={}
_[96]={}
_[95]={}
_[94]={}
_[93]={}
_[92]={}
_[91]={}
_[90]={}
_[89]={}
_[88]={}
_[87]={}
_[86]={data="c",tags=_[121]}
_[85]={data="b",tags=_[120]}
_[84]={data="a",tags=_[119]}
_[83]={data="-> aa",tags=_[118]}
_[82]={data="ab",tags=_[117]}
_[81]={data="aa",tags=_[116]}
_[80]={data="-> aa",tags=_[115]}
_[79]={data="ab",tags=_[114]}
_[78]={data="aa",tags=_[113]}
_[77]={data="-> a",tags=_[112]}
_[76]={data="c",tags=_[111]}
_[75]={data="b",tags=_[110]}
_[74]={data="a",tags=_[109]}
_[73]={data="-> c",tags=_[108]}
_[72]={data="c",tags=_[107]}
_[71]={data="autoflush",tags=_[106]}
_[70]={data="-> ab",tags=_[105]}
_[69]={data="ab",tags=_[104]}
_[68]={data="aa",tags=_[103]}
_[67]={data="-> c",tags=_[102]}
_[66]={data="c",tags=_[101]}
_[65]={data="autoflush",tags=_[100]}
_[64]={data="-> b",tags=_[99]}
_[63]={data="b",tags=_[98]}
_[62]={data="a",tags=_[97]}
_[61]={data="-> c",tags=_[96]}
_[60]={data="c",tags=_[95]}
_[59]={data="-> ab",tags=_[94]}
_[58]={data="ab",tags=_[93]}
_[57]={data="aa",tags=_[92]}
_[56]={data="-> c",tags=_[91]}
_[55]={data="c",tags=_[90]}
_[54]={data="-> b",tags=_[89]}
_[53]={data="b",tags=_[88]}
_[52]={data="a",tags=_[87]}
_[51]={_[84],_[85],_[86]}
_[50]={_[83]}
_[49]={_[81],_[82]}
_[48]={_[80]}
_[47]={_[78],_[79]}
_[46]={_[77]}
_[45]={_[74],_[75],_[76]}
_[44]={_[73]}
_[43]={_[72]}
_[42]={_[71]}
_[41]={_[70]}
_[40]={_[68],_[69]}
_[39]={_[67]}
_[38]={_[66]}
_[37]={_[65]}
_[36]={_[64]}
_[35]={_[62],_[63]}
_[34]={_[61]}
_[33]={_[60]}
_[32]={_[59]}
_[31]={_[57],_[58]}
_[30]={_[56]}
_[29]={_[55]}
_[28]={_[54]}
_[27]={_[52],_[53]}
_[26]={"error","invalid choice"}
_[25]={"choice",_[51]}
_[24]={"text",_[50]}
_[23]={"choice",_[49]}
_[22]={"text",_[48]}
_[21]={"choice",_[47]}
_[20]={"text",_[46]}
_[19]={"choice",_[45]}
_[18]={"text",_[44]}
_[17]={"choice",_[43]}
_[16]={"text",_[42]}
_[15]={"text",_[41]}
_[14]={"choice",_[40]}
_[13]={"text",_[39]}
_[12]={"choice",_[38]}
_[11]={"text",_[37]}
_[10]={"text",_[36]}
_[9]={"choice",_[35]}
_[8]={"text",_[34]}
_[7]={"choice",_[33]}
_[6]={"text",_[32]}
_[5]={"choice",_[31]}
_[4]={"text",_[30]}
_[3]={"choice",_[29]}
_[2]={"text",_[28]}
_[1]={"choice",_[27]}
return {_[1],_[2],_[3],_[4],_[5],_[6],_[7],_[8],_[9],_[10],_[11],_[12],_[13],_[14],_[15],_[16],_[17],_[18],_[19],_[20],_[21],_[22],_[23],_[24],_[25],_[26]}
--[[
{ "choice", { {
data = "a",
tags = {}
}, {
data = "b",
tags = {}
} } }
{ "text", { {
data = "-> b",
tags = {}
} } }
{ "choice", { {
data = "c",
tags = {}
} } }
{ "text", { {
data = "-> c",
tags = {}
} } }
{ "choice", { {
data = "aa",
tags = {}
}, {
data = "ab",
tags = {}
} } }
{ "text", { {
data = "-> ab",
tags = {}
} } }
{ "choice", { {
data = "c",
tags = {}
} } }
{ "text", { {
data = "-> c",
tags = {}
} } }
{ "choice", { {
data = "a",
tags = {}
}, {
data = "b",
tags = {}
} } }
{ "text", { {
data = "-> b",
tags = {}
} } }
{ "text", { {
data = "autoflush",
tags = {}
} } }
{ "choice", { {
data = "c",
tags = {}
} } }
{ "text", { {
data = "-> c",
tags = {}
} } }
{ "choice", { {
data = "aa",
tags = {}
}, {
data = "ab",
tags = {}
} } }
{ "text", { {
data = "-> ab",
tags = {}
} } }
{ "text", { {
data = "autoflush",
tags = {}
} } }
{ "choice", { {
data = "c",
tags = {}
} } }
{ "text", { {
data = "-> c",
tags = {}
} } }
{ "choice", { {
data = "a",
tags = {}
}, {
data = "b",
tags = {}
}, {
data = "c",
tags = {}
} } }
{ "text", { {
data = "-> a",
tags = {}
} } }
{ "choice", { {
data = "aa",
tags = {}
}, {
data = "ab",
tags = {}
} } }
{ "text", { {
data = "-> aa",
tags = {}
} } }
{ "choice", { {
data = "aa",
tags = {}
}, {
data = "ab",
tags = {}
} } }
{ "text", { {
data = "-> aa",
tags = {}
} } }
{ "choice", { {
data = "a",
tags = {}
}, {
data = "b",
tags = {}
}, {
data = "c",
tags = {}
} } }
{ "error", "invalid choice" }
]]--

View file

@ -0,0 +1,21 @@
$ f
~ 1
§ p
x
~~
y
~ f
~ f.p
$ g
~ 0
§ p
x
~~
y
~ g
~ g.p

View file

@ -0,0 +1,38 @@
local _={}
_[17]={}
_[16]={}
_[15]={}
_[14]={}
_[13]={data="x",tags=_[17]}
_[12]={data="y",tags=_[16]}
_[11]={data="x",tags=_[15]}
_[10]={data="x",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 = "x",
tags = {}
} } }
{ "text", { {
data = "x",
tags = {}
} } }
{ "text", { {
data = "y",
tags = {}
} } }
{ "text", { {
data = "x",
tags = {}
} } }
{ "return" }
]]--

View file

@ -1,7 +1,7 @@
local _={}
_[6]={1}
_[5]={tags=_[6],data="bar"}
_[4]={tags=_[6],data="foo"}
_[5]={data="bar",tags=_[6]}
_[4]={data="foo",tags=_[6]}
_[3]={_[4],_[5]}
_[2]={"return"}
_[1]={"text",_[3]}

View file

@ -2,8 +2,8 @@ local _={}
_[8]={2,3}
_[7]={1,a=_[8]}
_[6]={1}
_[5]={tags=_[7],data="bar"}
_[4]={tags=_[6],data="foo"}
_[5]={data="bar",tags=_[7]}
_[4]={data="foo",tags=_[6]}
_[3]={_[4],_[5]}
_[2]={"return"}
_[1]={"text",_[3]}

View file

@ -2,8 +2,8 @@ local _={}
_[8]={2,3}
_[7]={1,a=_[8]}
_[6]={1}
_[5]={tags=_[7],data="bar"}
_[4]={tags=_[6],data="foo"}
_[5]={data="bar",tags=_[7]}
_[4]={data="foo",tags=_[6]}
_[3]={_[4],_[5]}
_[2]={"return"}
_[1]={"text",_[3]}

View file

@ -1,7 +1,7 @@
local _={}
_[6]={1}
_[5]={tags=_[6],data="bar"}
_[4]={tags=_[6],data="foo"}
_[5]={data="bar",tags=_[6]}
_[4]={data="foo",tags=_[6]}
_[3]={_[4],_[5]}
_[2]={"return"}
_[1]={"text",_[3]}

View file

@ -2,8 +2,8 @@ local _={}
_[8]={2,3}
_[7]={1,a=_[8]}
_[6]={1}
_[5]={tags=_[7],data="bar"}
_[4]={tags=_[6],data="foo"}
_[5]={data="bar",tags=_[7]}
_[4]={data="foo",tags=_[6]}
_[3]={_[4],_[5]}
_[2]={"return"}
_[1]={"text",_[3]}

View file

@ -1,8 +1,8 @@
local _={}
_[7]={}
_[6]={}
_[5]={tags=_[7],data="b c"}
_[4]={tags=_[6],data="a"}
_[5]={data="b c",tags=_[7]}
_[4]={data="a",tags=_[6]}
_[3]={_[4],_[5]}
_[2]={"return"}
_[1]={"text",_[3]}

View file

@ -1,8 +1,8 @@
local _={}
_[9]={}
_[8]={}
_[7]={tags=_[9],data="b c"}
_[6]={tags=_[8],data="a"}
_[7]={data="b c",tags=_[9]}
_[6]={data="a",tags=_[8]}
_[5]={_[7]}
_[4]={_[6]}
_[3]={"return"}

View file

@ -1,6 +1,6 @@
local _={}
_[5]={}
_[4]={tags=_[5],data="a: 5"}
_[4]={data="a: 5",tags=_[5]}
_[3]={_[4]}
_[2]={"return"}
_[1]={"text",_[3]}

View file

@ -1,6 +1,6 @@
local _={}
_[5]={}
_[4]={tags=_[5],data="a"}
_[4]={data="a",tags=_[5]}
_[3]={_[4]}
_[2]={"return"}
_[1]={"text",_[3]}

View file

@ -4,11 +4,11 @@ _[12]={}
_[11]={}
_[10]={}
_[9]={}
_[8]={tags=_[13],data="b"}
_[7]={tags=_[12],data="a"}
_[6]={tags=_[11],data="b"}
_[5]={tags=_[10],data="seen only once"}
_[4]={tags=_[9],data="a"}
_[8]={data="b",tags=_[13]}
_[7]={data="a",tags=_[12]}
_[6]={data="b",tags=_[11]}
_[5]={data="seen only once",tags=_[10]}
_[4]={data="a",tags=_[9]}
_[3]={_[4],_[5],_[6],_[7],_[8]}
_[2]={"return"}
_[1]={"text",_[3]}