diff options
author | Eugene Sandulenko | 2016-08-08 20:10:20 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-08 20:11:07 +0200 |
commit | 9985d076602d46ff3fed1288f65c7d4d4d01e8c3 (patch) | |
tree | e3f1cf44009bb66bc8720da98008d37a31fe7971 /engines/director/lingo/lingo-gr.y | |
parent | b9badf61bfca47fdfe45495a199c72c3fba08039 (diff) | |
download | scummvm-rg350-9985d076602d46ff3fed1288f65c7d4d4d01e8c3.tar.gz scummvm-rg350-9985d076602d46ff3fed1288f65c7d4d4d01e8c3.tar.bz2 scummvm-rg350-9985d076602d46ff3fed1288f65c7d4d4d01e8c3.zip |
DIRECTOR: Lingo: Improve 'go to' command
Diffstat (limited to 'engines/director/lingo/lingo-gr.y')
-rw-r--r-- | engines/director/lingo/lingo-gr.y | 47 |
1 files changed, 16 insertions, 31 deletions
diff --git a/engines/director/lingo/lingo-gr.y b/engines/director/lingo/lingo-gr.y index 117b3ea50c..84dd5db80d 100644 --- a/engines/director/lingo/lingo-gr.y +++ b/engines/director/lingo/lingo-gr.y @@ -90,7 +90,6 @@ void yyerror(char *s) { %token tSPRITE tINTERSECTS tWITHIN %type<code> asgn begin elseif elsestmtoneliner end expr if repeatwhile repeatwith stmtlist -%type<s> gotoframe gotomovie %type<narg> argdef arglist %right '=' @@ -434,48 +433,34 @@ gotofunc: tGO tLOOP { g_lingo->code1(g_lingo->c_gotoloop); } | tGO tNEXT { g_lingo->code1(g_lingo->c_gotonext); } | tGO tPREVIOUS { g_lingo->code1(g_lingo->c_gotoprevious); } | tGO gotoframe { - g_lingo->code1(g_lingo->c_goto); - g_lingo->codeString($2->c_str()); - g_lingo->codeString(""); - delete $2; } + g_lingo->codeConst(1); + g_lingo->code1(g_lingo->c_goto); } | tGO gotoframe gotomovie { - g_lingo->code1(g_lingo->c_goto); - g_lingo->codeString($2->c_str()); - g_lingo->codeString($3->c_str()); - delete $2; - delete $3; } + g_lingo->codeConst(3); + g_lingo->code1(g_lingo->c_goto); } | tGO gotomovie { - g_lingo->code1(g_lingo->c_goto); - g_lingo->codeString(""); - g_lingo->codeString($2->c_str()); - delete $2; } + g_lingo->codeConst(2); + g_lingo->code1(g_lingo->c_goto); } ; -gotoframe: tFRAME STRING { $$ = $2; } - | STRING { $$ = $1; } +gotoframe: tFRAME expr + | expr ; -gotomovie: tOF tMOVIE STRING { $$ = $3; } - | tMOVIE STRING { $$ = $2; } +gotomovie: tOF tMOVIE expr + | tMOVIE expr ; playfunc: tPLAY tDONE { g_lingo->code1(g_lingo->c_playdone); } | tPLAY gotoframe { - g_lingo->code1(g_lingo->c_play); - g_lingo->codeString($2->c_str()); - g_lingo->codeString(""); - delete $2; } + g_lingo->codeConst(1); + g_lingo->code1(g_lingo->c_play); } | tPLAY gotoframe gotomovie { - g_lingo->code1(g_lingo->c_play); - g_lingo->codeString($2->c_str()); - g_lingo->codeString($3->c_str()); - delete $2; - delete $3; } + g_lingo->codeConst(3); + g_lingo->code1(g_lingo->c_play); } | tPLAY gotomovie { - g_lingo->code1(g_lingo->c_play); - g_lingo->codeString(""); - g_lingo->codeString($2->c_str()); - delete $2; } + g_lingo->codeConst(2); + g_lingo->code1(g_lingo->c_play); } ; // macro |