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:
parent
991f9fed35
commit
b534a3c4a2
21 changed files with 80 additions and 40 deletions
11
test/results/autocall text statement.ans
Normal file
11
test/results/autocall text statement.ans
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
--# run #--
|
||||
--- text ---
|
||||
| {}"Hello" |
|
||||
--- text ---
|
||||
| {}"Hello" |
|
||||
--- text ---
|
||||
| {}"Wor" {}"ld" |
|
||||
--- return ---
|
||||
()
|
||||
--# saved #--
|
||||
{}
|
||||
7
test/tests/autocall text statement.ans
Normal file
7
test/tests/autocall text statement.ans
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
| Hello
|
||||
|
||||
| Wor | + | ld |
|
||||
|
||||
(| Hello)!
|
||||
|
||||
(| Wor | + | ld |)!
|
||||
|
|
@ -1,7 +1,8 @@
|
|||
:@choice=1
|
||||
|
||||
:$ jump button
|
||||
1 # |A
|
||||
1 #
|
||||
|A
|
||||
*| Suprise choice!
|
||||
()
|
||||
return("JOIN")
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
:@choice=1
|
||||
|
||||
:$ jump button
|
||||
1 # | a
|
||||
1 #
|
||||
| a
|
||||
|
||||
return("SPLIT")
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
return(1 # | A)
|
||||
|
||||
:$ move axis
|
||||
1 # | left
|
||||
1 #
|
||||
| left
|
||||
return(" joystick")
|
||||
|
||||
*| Press {jump button!} to jump.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
if((), $|ko)
|
||||
if(1, $|ok)
|
||||
if(1, $|ok bis)
|
||||
if((), $|ko|!)
|
||||
if(1, $|ok|!)
|
||||
if(1, $|ok bis|!)
|
||||
|
|
@ -4,7 +4,8 @@
|
|||
if(1, $()("x":"x" # _))
|
||||
"b":"b" #
|
||||
#p!checkpoint($_)
|
||||
"c":"c"# |b
|
||||
"c":"c"#
|
||||
|b
|
||||
|
||||
|c
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
1 #
|
||||
|foo
|
||||
if(1, $()("b":[1,2] # _))
|
||||
if(1, $()("a":[2,3] # | bar))
|
||||
if(1, $()("a":[2,3] # | bar |!))
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
1 #
|
||||
| foo
|
||||
"a":[2,3] # | bar
|
||||
"a":[2,3] #
|
||||
| bar
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
:$ f
|
||||
1 # | lol
|
||||
1 #
|
||||
| lol
|
||||
|
||||
return(2 # |d)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
:b = ("b":"c" # | world and { "x":"y" # |friends })
|
||||
|
||||
a+b
|
||||
(a+b)!
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
:$ jump button
|
||||
1 # | A
|
||||
1 #
|
||||
| A
|
||||
|
||||
return!
|
||||
|
||||
:$ move axis
|
||||
1 # | left
|
||||
1 #
|
||||
| left
|
||||
|
||||
return(" joystick")
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
return(1 # | A)
|
||||
|
||||
:$ move axis
|
||||
2 # | left
|
||||
2 #
|
||||
| left
|
||||
return(" joystick")
|
||||
|
||||
| Press {jump button!} to jump.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
: x = "x"!script($_)
|
||||
|a
|
||||
if(run == 0, $|seen only once)
|
||||
if(run == 0)
|
||||
|seen only once
|
||||
|b
|
||||
|
||||
x!
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue