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

[language] automatically call text when they appear directly as a statement; remove autocalling of every text returned by a statement

The previous behavior, where any Text value returned by a line in a Block would be automatically called, may lead to unexpected Text event being written as it is not obvious which line can return a Text value after evaluation.

The new behavior only triggers if a Text node directly appear in the original script as a statement.
This commit is contained in:
Étienne Fildadut 2024-04-23 19:57:36 +02:00
parent 991f9fed35
commit b534a3c4a2
21 changed files with 80 additions and 40 deletions

View file

@ -0,0 +1,11 @@
--# run #--
--- text ---
| {}"Hello" |
--- text ---
| {}"Hello" |
--- text ---
| {}"Wor" {}"ld" |
--- return ---
()
--# saved #--
{}

View file

@ -0,0 +1,7 @@
| Hello
| Wor | + | ld |
(| Hello)!
(| Wor | + | ld |)!

View file

@ -1,7 +1,8 @@
:@choice=1
:$ jump button
1 # |A
1 #
|A
*| Suprise choice!
()
return("JOIN")

View file

@ -1,7 +1,8 @@
:@choice=1
:$ jump button
1 # | a
1 #
| a
return("SPLIT")

View file

@ -2,7 +2,8 @@
return(1 # | A)
:$ move axis
1 # | left
1 #
| left
return(" joystick")
*| Press {jump button!} to jump.

View file

@ -1,3 +1,3 @@
if((), $|ko)
if(1, $|ok)
if(1, $|ok bis)
if((), $|ko|!)
if(1, $|ok|!)
if(1, $|ok bis|!)

View file

@ -4,7 +4,8 @@
if(1, $()("x":"x" # _))
"b":"b" #
#p!checkpoint($_)
"c":"c"# |b
"c":"c"#
|b
|c

View file

@ -1,4 +1,4 @@
1 #
|foo
if(1, $()("b":[1,2] # _))
if(1, $()("a":[2,3] # | bar))
if(1, $()("a":[2,3] # | bar |!))

View file

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

View file

@ -1,5 +1,6 @@
:$ f
1 # | lol
1 #
| lol
return(2 # |d)

View file

@ -2,4 +2,4 @@
:b = ("b":"c" # | world and { "x":"y" # |friends })
a+b
(a+b)!

View file

@ -1,12 +1,14 @@
:@choice = 1
:$ jump button
1 # | A
1 #
| A
*| Surprise choice!
| ok
:$ move axis
1 # | left
1 #
| left
*| Surprise choice!
| ok2
return(" joystick")

View file

@ -1,10 +1,12 @@
:$ jump button
1 # | A
1 #
| A
return!
:$ move axis
1 # | left
1 #
| left
return(" joystick")

View file

@ -2,7 +2,8 @@
return(1 # | A)
:$ move axis
2 # | left
2 #
| left
return(" joystick")
| Press {jump button!} to jump.

View file

@ -1,6 +1,7 @@
: x = "x"!script($_)
|a
if(run == 0, $|seen only once)
if(run == 0)
|seen only once
|b
x!