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

Merge behavior of : and = into single = operator for pairs; add assignment with _._ operator in function references

This commit is contained in:
Étienne Fildadut 2021-12-14 02:37:09 +01:00
parent 48cabbf4c0
commit 88157b04b9
19 changed files with 104 additions and 38 deletions

View file

@ -7,7 +7,7 @@ $ f
> c
~ choose(1)
# "k":"v"
# "k"="v"
~ f
> d
~ choose(1)

View file

@ -1,10 +1,10 @@
:a = [1:2]
:a = [1=2]
0 = {a == [5:2]}
0 = {a == [5=2]}
0 = {a == [1:3]}
0 = {a == [1=3]}
1 = {a == [1:2]}
1 = {a == [1=2]}
:b = [1,2,3]

View file

@ -0,0 +1,10 @@
$ f
:a = 12
:x = &f
{x.a}
~ x.a := 52
{x.a}

View file

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

View file

@ -8,11 +8,11 @@ _[32]={}
_[31]={}
_[30]={}
_[29]={}
_[28]={tags=_[37],text="[3, 2, foo:c, bar:b]"}
_[28]={tags=_[37],text="[3, 2, foo=c, bar=b]"}
_[27]={tags=_[36],text="c"}
_[26]={tags=_[35],text="[3, 2, foo:a, bar:b]"}
_[26]={tags=_[35],text="[3, 2, foo=a, bar=b]"}
_[25]={tags=_[34],text="b"}
_[24]={tags=_[33],text="[3, 2, foo:a]"}
_[24]={tags=_[33],text="[3, 2, foo=a]"}
_[23]={tags=_[32],text="a"}
_[22]={tags=_[31],text="[3, 2]"}
_[21]={tags=_[30],text="3"}
@ -56,7 +56,7 @@ return {_[1],_[2],_[3],_[4],_[5],_[6],_[7],_[8],_[9],_[10]}
} } }
{ "text", { {
tags = {},
text = "[3, 2, foo:a]"
text = "[3, 2, foo=a]"
} } }
{ "text", { {
tags = {},
@ -64,7 +64,7 @@ return {_[1],_[2],_[3],_[4],_[5],_[6],_[7],_[8],_[9],_[10]}
} } }
{ "text", { {
tags = {},
text = "[3, 2, foo:a, bar:b]"
text = "[3, 2, foo=a, bar=b]"
} } }
{ "text", { {
tags = {},
@ -72,7 +72,7 @@ return {_[1],_[2],_[3],_[4],_[5],_[6],_[7],_[8],_[9],_[10]}
} } }
{ "text", { {
tags = {},
text = "[3, 2, foo:c, bar:b]"
text = "[3, 2, foo=c, bar=b]"
} } }
{ "return" }
]]--

View file

@ -0,0 +1,3 @@
:name = "test"
{[name=1, 3="p", (name)="foo", "ho"="ah", name=name]}

View file

@ -0,0 +1,14 @@
local _={}
_[5]={}
_[4]={tags=_[5],text="[name=1, 3=p, test=foo, ho=ah, name=test]"}
_[3]={_[4]}
_[2]={"return"}
_[1]={"text",_[3]}
return {_[1],_[2]}
--[[
{ "text", { {
tags = {},
text = "[name=1, 3=p, test=foo, ho=ah, name=test]"
} } }
{ "return" }
]]--

View file

@ -1,10 +1,10 @@
$ f
# "a":"a"
# "a"="a"
a
~ 1 # "x":"x"
# "b":"b"
~ 1 # "x"="x"
# "b"="b"
§ p
b # "c":"c"
b # "c"="c"
c

View file

@ -1,5 +1,5 @@
$ button
A # 2:2
A # 2=2
Press
A # 5
@ -9,4 +9,4 @@ Press [A#5] to jump.
Press [{button}#1] to jump.
Press [-[button#3:3]-#1] to jump.
Press [-[button#3=3]-#1] to jump.

View file

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

View file

@ -1,3 +1,3 @@
# 1
foo
bar # "a": [2,3]
bar # a=[2,3]

View file

@ -3,5 +3,5 @@ $ f
a {f # 5} c
# 2:2
# 2=2
a {f # 5} c

View file

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