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

Preprend every definition line type with a colon, remove function decorator, add immediately ran definition line

This commit is contained in:
Étienne Fildadut 2022-09-14 15:28:58 +09:00
parent 7b756ad092
commit d1f49d1894
117 changed files with 686 additions and 658 deletions

View file

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

View file

@ -1,7 +1,7 @@
$ _-_(a, b)
:$ _-_(a, b)
@"generic minus"
$ _-_(a::string, b::string)
:$ _-_(a::string, b::string)
@a + " minus " + b
{2-5}

View file

@ -1,9 +1,9 @@
$ f
:$ f
x
§ p
:! p
a
§ q
:! q
b
c

View file

@ -8,13 +8,13 @@
1,2,3: {l}
§ a
:! a
~ l!insert(4)
1,2,3,4: {l}
§ b
:! b
~ l!insert(5)
@ -22,5 +22,5 @@
~ error("cancel merge")
$ after error
:$ after error
1,2,3,4: {l}

View file

@ -8,13 +8,13 @@
2: {l}
§ a
:! a
~ l := 3
3: {l}
§ b
:! b
~ l := 4
@ -22,5 +22,5 @@
~ error("cancel merge")
$ after error
:$ after error
3: {l}

View file

@ -1,4 +1,4 @@
§ p
:! p
seen!
Seen: {p.seen}

View file

@ -1,4 +1,4 @@
$ f
:$ f
> neol
nah

View file

@ -4,7 +4,7 @@
> No
ko
$ jump button
:$ jump button
A # 1
> Suprise choice!
@"JOIN"

View file

@ -5,7 +5,7 @@
> No
ko
$ jump button
:$ jump button
A # 1
@"SPLIT"

View file

@ -4,7 +4,7 @@
ko
~ choose(1)
$ jump button
:$ jump button
A # 1
> Other
@ -13,6 +13,6 @@ $ jump button
ok
~ choose(2)
$ move axis
:$ move axis
left # 1
@" joystick"

View file

@ -1,4 +1,4 @@
$ f
:$ f
# 42
> a
b

View file

@ -1,4 +1,4 @@
$ bar
:$ bar
:var=5
~ var := 2
@ -7,14 +7,14 @@ $ bar
~ run("parallel")
§ foo
:! foo
checkpoint
after: {var}
~ run("parallel")
$ parallel
:$ parallel
parallel: {bar.var}
~ bar

View file

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

View file

@ -1,4 +1,4 @@
% obj
:% obj
::a = 12
:x = obj()

View file

@ -1,4 +1,4 @@
% obj
:% obj
:a = 12
::x = obj()

View file

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

View file

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

View file

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

View file

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

View file

@ -1,4 +1,4 @@
$ f(a, l...)
:$ f(a, l...)
{a}
{l}

View file

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

View file

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

View file

@ -1,4 +1,4 @@
$ f(a, b, l...)
:$ f(a, b, l...)
{a}{b}
{l}

View file

@ -1,4 +1,4 @@
$ f(a, b, l...)
:$ f(a, b, l...)
{a}{b}
{l}

View file

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

View file

@ -1,13 +1,13 @@
:a = 5
$ f(p)
:$ f(p)
@a
$ f(p) := v
:$ f(p) := v
v={v}
~ a := v
$ f(p) := v::string
:$ f(p) := v::string
v2={v}
~ a := p

View file

@ -1,5 +1,5 @@
$ f(a, b)
:$ f(a, b)
$ f(x)
:$ f(x)
$ f(a, b)
:$ f(a, b)

View file

@ -2,10 +2,10 @@
:french name="french"::name
:esperanto name="esperanto"::name
$ a(name::string)
:$ a(name::string)
{name} is english or generic
$ a(name:nom::french name)
:$ a(name:nom::french name)
{nom} is french
~ a("bob"::name)

View file

@ -2,10 +2,10 @@
:french name="french"::name
:esperanto name="esperanto"::name
$ a(name)
:$ a(name)
{name} is english or generic
$ a(name:nom::french name)
:$ a(name:nom::french name)
{nom} is french
~ a("bob"::name)

View file

@ -1,9 +1,9 @@
$ f
$ a
:$ f
:$ a
a
$ b
:$ b
b
$ c
:$ c
c
~ cycle(&a,&b,&c)

View file

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

View file

@ -1,9 +0,0 @@
$ f
ko
a.👁️: {a.👁️} $ a
ok
~ f.a
In function:
~ f

View file

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

View file

@ -1,7 +1,7 @@
$ fn(x)
:$ fn(x)
x
$ fn(a)
:$ fn(a)
a
~ fn(a=5)

View file

@ -1,9 +1,9 @@
$ f
$ a
:$ f
:$ a
a
$ b
:$ b
b
$ c
:$ c
c
~ next(&a, &b, &c)

View file

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

View file

@ -1,9 +1,9 @@
$ f
$ a
:$ f
:$ a
a
$ b
:$ b
b
$ c
:$ c
c
~ random(&a,&b,&c)

View file

@ -1,6 +1,6 @@
$ fn
:$ fn
1
§ c
:! c
2
:c = &fn

View file

@ -1,7 +1,7 @@
$ f(x)
:$ f(x)
@x+2
$ g(x)
:$ g(x)
@x+3
:a = &f

View file

@ -1,7 +1,7 @@
$ fn
:$ fn
@1
$ add(x)
:$ add(x)
@x+2
:c = &fn

View file

@ -1,5 +1,5 @@
$ f
$ a
:$ f
:$ a
@12
:x = &f

View file

@ -1,4 +1,4 @@
$ f
:$ f
:a = 12
:x = &f

View file

@ -1,5 +1,5 @@
$ hey
§ foo
:$ hey
:! foo
@2
@3
@5

View file

@ -1,4 +1,4 @@
$ hey
:$ hey
@5
a
@2

View file

@ -1,5 +1,5 @@
$ hey
§ foo
:$ hey
:! foo
@2
@5

View file

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

View file

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

View file

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

View file

@ -1,6 +1,6 @@
:n = 0
$ f(c=1)
:$ f(c=1)
:a = []
start: {a}
@ -20,7 +20,7 @@ new list each time:
~ f
$ g(c=1, a=[])
:$ g(c=1, a=[])
start: {a}
~ a!insert(c)

View file

@ -1,6 +1,6 @@
:n = 0
$ f(c=1)
:$ f(c=1)
:a = 1
start: {a}

View file

@ -1,11 +1,11 @@
$ f()
:$ f()
:a = 1
{a}
~ a := a + 1
$ g
:$ g
:a = 1
{a}

View file

@ -1,8 +1,8 @@
$ a(x::number)
:$ a(x::number)
@x + 2
$ x
$ a(x::string)
:$ x
:$ a(x::string)
@x + "heh"
{a("plop")}

View file

@ -1,10 +1,10 @@
$ f
:$ f
:a = 2
$ f(x)
:$ f(x)
:a = 5
$ f(b)
:$ f(b)
:a = 10
{f.a} = 2

View file

@ -1,7 +1,7 @@
$ fn(x::number)
:$ fn(x::number)
x
$ fn(a::number)
:$ fn(a::number)
a
~ fn(5)

View file

@ -1,7 +1,7 @@
$ fn(x::number)
:$ fn(x::number)
x
$ fn(a="o"::string)
:$ fn(a="o"::string)
a
~ fn("s")
@ -10,10 +10,10 @@ $ fn(a="o"::string)
~ fn()
$ g(n="s", a=5::number)
:$ g(n="s", a=5::number)
@"gn"
$ g(n="s", a="lol"::string)
:$ g(n="s", a="lol"::string)
@"gs"
{g(n="k", a="l")}

View file

@ -1,7 +1,7 @@
$ fn(x::number)
:$ fn(x::number)
x
$ fn(a::string)
:$ fn(a::string)
a
~ fn("s")

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -0,0 +1,10 @@
:$ f
ko
:~$ a
a.👁️: {a.👁️}
ok
~ f.a
In function:
~ f

View file

@ -0,0 +1,2 @@
:~$ a
a.👁️: {a.👁️}

View file

@ -0,0 +1,4 @@
:$ a
a.👁️: {a.👁️}
:~ b = &a

View file

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

View file

@ -1,14 +1,14 @@
Function with argument:
$ f(x)
:$ f(x)
{&f}
Function without argument:
$ a
:$ a
lol
$ b
:$ b
hihi
a: {a}
@ -39,8 +39,8 @@ ref.b(): {ref.b()}
Objects:
% A
$ b
:% A
:$ b
KK
@1

View file

@ -1,8 +1,8 @@
$ oh
§ leave
:$ oh
:! leave
in interrupt: {bar.var}
no
$ bar
:$ bar
:var = 5
~ var := 2
@ -11,7 +11,7 @@ $ oh
~ interrupt("leave")
§ foo
:! foo
checkpoint
after: {var}

View file

@ -1,9 +1,9 @@
$ leave
:$ leave
in interrupt: {oh.bar.var}
$ oh
:$ oh
no
$ bar
:$ bar
:var = 5
~ var := 2
@ -12,7 +12,7 @@ $ oh
~ interrupt("leave")
§ foo
:! foo
checkpoint
after: {var}

View file

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

View file

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

View file

@ -1,8 +1,8 @@
$ a
:$ a
a
@1
$ b
:$ b
b
@0

View file

@ -10,17 +10,17 @@ x={x}
a(x)={a(x)}
§ ch a
:! ch a
a(x)={a(x)}
§ ch b
:! ch b
~ x(2) := 3
a(x)={a(x)}
§ ch c
:! ch c
a(x)={a(x)}

View file

@ -5,13 +5,13 @@
~ a!insert(b)
§ c
:! c
~ b!insert(3)
§ d
:! d
~ b!insert(4)
$ check
:$ check
\[1,\[2,3,4]]: {a}

View file

@ -5,15 +5,15 @@
~ a!insert(b)
§ c
:! c
~ b!insert(3)
§ d
:! d
~ b!insert(4)
~ error("abort")
$ check
:$ check
\[1,\[2,3]]: {a}

View file

@ -5,15 +5,15 @@
~ a!insert(b)
§ c
:! c
~ b!insert(3)
§ d
:! d
~ a!insert(4)
~ error("abort")
$ check
:$ check
\[1,\[2,3]]: {a}

View file

@ -5,13 +5,13 @@
~ a!insert(b)
§ c
:! c
~ b!insert(3)
§ d
:! d
~ a!insert(4)
$ check
:$ check
\[1,\[2,3],4]: {a}

View file

@ -1,4 +1,4 @@
$ f(a, b, c)
:$ f(a, b, c)
@a + b + c
{f("a", "b", "c")} = {f(a="a", b="b", c="c")} = {f(c="c", a="a", b="b")}

View file

@ -1,4 +1,4 @@
$ f(l...)
:$ f(l...)
~ l!len
:a = 0
~ a := l(1)

View file

@ -1,4 +1,4 @@
% class
:% class
:a:b = "foo"
:c = "bar"

View file

@ -1,8 +1,8 @@
% class
:% class
:a:b = "foo"
:c = "bar"
$ new(o::&class, x)
:$ new(o::&class, x)
~ o.c := x
@o

View file

@ -1,4 +1,4 @@
% class
:% class
:a:b = "foo"
:c = "bar"

View file

@ -1,4 +1,4 @@
% class
:% class
:a:b = "foo"
:c = "bar"

View file

@ -1,4 +1,4 @@
$ f(a, b, c="c")
:$ f(a, b, c="c")
@a + b + c
{f("a", "b")} = {f("a", "b", "c")} = {f(b="b", a="a")}

View file

@ -1,4 +1,4 @@
§ f : test
:! f : test
@"ok"
{f} = {test}

View file

@ -1,6 +1,6 @@
$ f
:$ f
x
§ p
:! p
a
b

View file

@ -1,6 +1,6 @@
$ f
:$ f
x
§ p
:! p
a
b

View file

@ -1,6 +1,6 @@
$ f
:$ f
x
§ p
:! p
a
b

View file

@ -1,3 +1,3 @@
§ p
:! p
a
b

View file

@ -1,9 +1,9 @@
$ f
:$ f
x
§ p
:! p
a
§ q
:! q
b
c

View file

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

View file

@ -1,7 +1,7 @@
$ f
:$ f
> a
-> a
§ p
:! p
> aa
-> aa
> ab
@ -18,10 +18,10 @@ $ f
~ f.p
$ g
:$ g
> a
-> a
§ p
:! p
> aa
-> aa
> ab
@ -38,11 +38,11 @@ $ g
~ g.p
$ h
:$ h
~ 1
> a
-> a
§ p
:! p
> aa
-> aa
> ab
@ -58,10 +58,10 @@ $ h
~ h.p
$ i
:$ i
> a
-> a
§ p
:! p
> aa
-> aa
> ab

View file

@ -1,6 +1,6 @@
$ f
:$ f
~ 1
§ p
:! p
x
~~
y
@ -9,9 +9,9 @@ $ f
~ f.p
$ g
:$ g
~ 0
§ p
:! p
x
~~
y

View file

@ -1,4 +1,4 @@
$ fn
:$ fn
:i=0
@i
~ i:=5
@ -6,7 +6,7 @@ $ fn
{fn} = 50
$ g
:$ g
@0
@3

View file

@ -1,4 +1,4 @@
$ f
:$ f
> a
x
@1

View file

@ -6,13 +6,13 @@
:n = 0
$ f(t)
:$ f(t)
~ t!insert(len(l)+1)
f1: {l} {t}
CHECK
§ c
:! c
~ n < 1
REC
@ -25,7 +25,7 @@ $ f(t)
f2: {l}
CHECK 2
§ d
:! d
~ t!insert(len(t)+1)
@ -43,7 +43,7 @@ l: {l}
x: {x}
$ check
:$ check
AFTER ERROR
l: {l}

View file

@ -4,13 +4,13 @@
:n = 0
$ f(t)
:$ f(t)
~ t!insert(len(l)+1)
f1: {l} {t}
CHECK
§ c
:! c
~ n < 1
REC
@ -23,7 +23,7 @@ $ f(t)
f2: {l}
CHECK 2
§ d
:! d
~ t!insert(len(t)+1)

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