DIRECTOR: LINGO: Implement extened 'on' clause syntax

This commit is contained in:
Eugene Sandulenko 2019-12-01 23:22:26 +01:00
parent 9084dcc70d
commit c33a4f9d8d
3 changed files with 412 additions and 396 deletions

File diff suppressed because it is too large Load Diff

View File

@ -646,7 +646,7 @@ defn: tMACRO ID { g_lingo->_indef = true; g_lingo->_currentFactory.clear(); }
g_lingo->code1(g_lingo->c_procret);
g_lingo->define(*$2, $4, $5 + 1, &g_lingo->_currentFactory);
g_lingo->_indef = false; }
| on begin argdef nl argstore stmtlist ENDCLAUSE { // D3
| on begin argdef nl argstore stmtlist ENDCLAUSE endargdef { // D3
g_lingo->code1(g_lingo->c_procret);
g_lingo->define(*$1, $2, $3);
g_lingo->_indef = false;
@ -667,6 +667,11 @@ argdef: /* nothing */ { $$ = 0; }
| argdef nl ',' ID { g_lingo->codeArg($4); $$ = $1 + 1; }
;
endargdef: /* nothing */
| ID
| endargdef ',' ID
;
argstore: /* nothing */ { g_lingo->codeArgStore(); }
;

View File

@ -10,3 +10,8 @@ on annoy howMuch
beep random(howMuch)
alert "Aren't handlers fun?"
end annoy
on annoy2 howMuch
beep random(howMuch)
alert "Aren't handlers fun?"
end annoy2 howMuch