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

Add text buffer syntax

This commit is contained in:
Étienne Fildadut 2022-09-27 17:05:06 +09:00
parent ccaa40a99d
commit e9606cdee0
13 changed files with 345 additions and 145 deletions

View file

@ -0,0 +1,8 @@
:$ f
lol # 1
d
:a = %[a {f} [t # 2] b]
@a

View file

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

View file

@ -0,0 +1,8 @@
:$ f
lol
d
:a = %[a {f} b]
@a

View file

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