diff options
author | Eugene Sandulenko | 2017-02-06 19:10:51 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2017-02-06 19:10:51 +0100 |
commit | 293d59f6ada41d8c942717a0248d6aef62765a29 (patch) | |
tree | e932d17e1536f893f05d0eeb423b563904919da3 /engines/director/lingo/lingo-lex.l | |
parent | 7f5ff6cac066a0505fd4aacc211a2627e0c0f8ce (diff) | |
download | scummvm-rg350-293d59f6ada41d8c942717a0248d6aef62765a29.tar.gz scummvm-rg350-293d59f6ada41d8c942717a0248d6aef62765a29.tar.bz2 scummvm-rg350-293d59f6ada41d8c942717a0248d6aef62765a29.zip |
DIRECTOR: Lingo: Further work on improved built-in grammar
Diffstat (limited to 'engines/director/lingo/lingo-lex.l')
-rw-r--r-- | engines/director/lingo/lingo-lex.l | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/engines/director/lingo/lingo-lex.l b/engines/director/lingo/lingo-lex.l index 00750c4523..ec9d6319bd 100644 --- a/engines/director/lingo/lingo-lex.l +++ b/engines/director/lingo/lingo-lex.l @@ -267,21 +267,22 @@ whitespace [\t ] } if (g_lingo->_builtins.contains(yytext)) { - if (g_lingo->_builtins[yytext]->type == BLTIN && g_lingo->_builtins[yytext]->parens == false) { + int type = g_lingo->_builtins[yytext]->type; + if ((type == BLTIN || type == FBLTIN) && g_lingo->_builtins[yytext]->parens == false) { if (g_lingo->_builtins[yytext]->nargs == 0) { if (g_lingo->_builtins[yytext]->maxArgs == 0) - return BLTINNOARGS; + return type == BLTIN ? BLTINNOARGS : FBLTINNOARGS; else if (g_lingo->_builtins[yytext]->maxArgs == 1) - return BLTINNOARGSORONE; + return type == BLTINNOARGSORONE; else - error("Incorrect setup for builtin: %s", yytext); + return type == BLTINARGLIST; } else if (g_lingo->_builtins[yytext]->nargs == 1 && g_lingo->_builtins[yytext]->maxArgs == 1) { - return BLTINONEARG; + return type == BLTIN ? BLTINONEARG : FBLTINONEARG; } else if (g_lingo->_builtins[yytext]->nargs == -1) { - return BLTINARGLIST; + return type == BLTINARGLIST; } else { - error("Incorrect setup for builtin: %s", yytext); + return type == BLTINARGLIST; } } } |