diff options
Diffstat (limited to 'engines/director/lingo/lingo-gr.y')
-rw-r--r-- | engines/director/lingo/lingo-gr.y | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/engines/director/lingo/lingo-gr.y b/engines/director/lingo/lingo-gr.y index 8e7a60d40e..5686187b82 100644 --- a/engines/director/lingo/lingo-gr.y +++ b/engines/director/lingo/lingo-gr.y @@ -520,17 +520,16 @@ defn: tMACRO ID { g_lingo->_indef = true; g_lingo->_currentFactory.clear(); } g_lingo->define(*$2, $4, $5 + 1, &g_lingo->_currentFactory); g_lingo->_indef = false; } ; | tON ID { g_lingo->_indef = true; g_lingo->_currentFactory.clear(); } - begin nl stmtlist tEND { + begin argdef nl argstore stmtlist tEND ID { g_lingo->codeConst(0); // Push fake value on stack g_lingo->code1(g_lingo->c_procret); - g_lingo->define(*$2, $4, 0); - g_lingo->_indef = false; } - | tON ID { g_lingo->_indef = true; g_lingo->_currentFactory.clear(); } - begin tME nl stmtlist tEND { - g_lingo->codeConst(0); // Push fake value on stack - g_lingo->code1(g_lingo->c_procret); - g_lingo->define(*$2, $4, 0); - g_lingo->_indef = false; } + g_lingo->define(*$2, $4, $5); + g_lingo->_indef = false; + + if (*$2 != *$10) { + yyerror("on vs end handler mismatch"); + } + } argdef: /* nothing */ { $$ = 0; } | ID { g_lingo->codeArg($1); $$ = 1; } |