aboutsummaryrefslogtreecommitdiff
path: root/engines/director/lingo/lingo-gr.y
diff options
context:
space:
mode:
Diffstat (limited to 'engines/director/lingo/lingo-gr.y')
-rw-r--r--engines/director/lingo/lingo-gr.y15
1 files changed, 12 insertions, 3 deletions
diff --git a/engines/director/lingo/lingo-gr.y b/engines/director/lingo/lingo-gr.y
index 9a374d0d0d..9bdb29ed39 100644
--- a/engines/director/lingo/lingo-gr.y
+++ b/engines/director/lingo/lingo-gr.y
@@ -82,7 +82,7 @@ void yyerror(char *s) {
%token<s> BLTIN ID STRING HANDLER
%token tDOWN tELSE tNLELSIF tEND tEXIT tFRAME tGLOBAL tGO tIF tINTO tLOOP tMACRO
%token tMCI tMCIWAIT tMOVIE tNEXT tOF tPREVIOUS tPUT tREPEAT tSET tTHEN tTO
-%token tWITH tWHILE tNLELSE
+%token tWITH tWHILE tNLELSE tFACTORY tMETHOD
%token tGE tLE tGT tLT tEQ tNEQ tAND tOR tNOT
%token tCONCAT tCONTAINS tSTARTS
@@ -477,12 +477,20 @@ gotomovie: tOF tMOVIE STRING { $$ = $3; }
// See also:
// on keyword
defn: tMACRO ID { g_lingo->_indef = true; }
- begin argdef nl argstore stmtlist {
+ begin argdef nl argstore stmtlist {
g_lingo->code2(g_lingo->c_constpush, (inst)0); // Push fake value on stack
g_lingo->code1(g_lingo->c_procret);
g_lingo->define(*$2, $4, $5);
g_lingo->_indef = false; }
- ;
+ | tFACTORY ID {
+ g_lingo->codeFactory(*$2);
+ }
+ | tMETHOD ID { g_lingo->_indef = true; }
+ begin argdef nl argstore stmtlist {
+ g_lingo->code2(g_lingo->c_constpush, (inst)0); // Push fake value on stack
+ g_lingo->code1(g_lingo->c_procret);
+ g_lingo->define(*$2, $4, $5, &g_lingo->_currentFactory);
+ g_lingo->_indef = false; } ;
argdef: /* nothing */ { $$ = 0; }
| ID { g_lingo->codeArg($1); $$ = 1; }
| argdef ',' ID { g_lingo->codeArg($3); $$ = $1 + 1; }
@@ -491,6 +499,7 @@ argdef: /* nothing */ { $$ = 0; }
argstore: /* nothing */ { g_lingo->codeArgStore(); }
;
+
macro: ID begin arglist {
g_lingo->code1(g_lingo->c_call);
g_lingo->codeString($1->c_str());