DIRECTOR: Support "me(blah 1, 2)" syntax, e.g. no comma after the method name

This is used in totaldistortion-win

   --start-movie="ATD\HD\bdDREAML.DXR"

When the bulb explodes, the Lingo tries to execute a constructed
   do("me(bubdie2 5, 75)")

which then leads to syntax error.

The original allowed this broken Lingo syntax
This commit is contained in:
Eugene Sandulenko 2023-07-19 13:02:38 +02:00
parent 0d585896ed
commit 9153ec4f52
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
3 changed files with 1615 additions and 1590 deletions

File diff suppressed because it is too large Load Diff

View File

@ -462,6 +462,10 @@ cmdargs: /* empty */ {
// This matches `cmd(args, ...)`
$args->insert_at(0, $expr);
$$ = $args; }
| '(' tVARID nonemptyexprlist[args] trailingcomma ')' {
// This matches `cmd(args ...)`
$args->insert_at(0, new VarNode($tVARID));
$$ = $args; }
;
trailingcomma: /* empty */ | ',' ;

View File

@ -20,6 +20,7 @@ method callPerform
set retval to me(mPerform, "callMe")
me(mPerform, "callMe2")
me(mPerform, "callMe3")
me(mPerform "callMe3")
put "returned" && retval
scummvmAssertEqual(retval, "a1")