diff options
author | Eugene Sandulenko | 2016-07-15 19:21:48 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | 78b198cee9920e62ea19879959316b426fe1834c (patch) | |
tree | 8045537b4f555a671a7919b792bdaf06ca7b6f17 /engines/director/lingo/lingo-lex.cpp | |
parent | 5f0f0193f921008bf2deb5e249e40936aada8483 (diff) | |
download | scummvm-rg350-78b198cee9920e62ea19879959316b426fe1834c.tar.gz scummvm-rg350-78b198cee9920e62ea19879959316b426fe1834c.tar.bz2 scummvm-rg350-78b198cee9920e62ea19879959316b426fe1834c.zip |
DIRECTOR: Lingo: Added support for parameter-less built-ins
Diffstat (limited to 'engines/director/lingo/lingo-lex.cpp')
-rw-r--r-- | engines/director/lingo/lingo-lex.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/engines/director/lingo/lingo-lex.cpp b/engines/director/lingo/lingo-lex.cpp index 111574c6e9..f630dfd769 100644 --- a/engines/director/lingo/lingo-lex.cpp +++ b/engines/director/lingo/lingo-lex.cpp @@ -1205,49 +1205,53 @@ YY_RULE_SETUP count(); yylval.s = new Common::String(yytext); - if (g_lingo->_builtins.contains(yytext)) - return BLTIN; + if (g_lingo->_builtins.contains(yytext)) { + if (g_lingo->_builtins[yytext]->nargs == -1) + return BLTINNOARGS; + else + return BLTIN; + } return ID; } YY_BREAK case 44: YY_RULE_SETUP -#line 173 "engines/director/lingo/lingo-lex.l" +#line 177 "engines/director/lingo/lingo-lex.l" { count(); yylval.f = atof(yytext); return FLOAT; } YY_BREAK case 45: YY_RULE_SETUP -#line 174 "engines/director/lingo/lingo-lex.l" +#line 178 "engines/director/lingo/lingo-lex.l" { count(); yylval.i = strtol(yytext, NULL, 10); return INT; } YY_BREAK case 46: YY_RULE_SETUP -#line 175 "engines/director/lingo/lingo-lex.l" +#line 179 "engines/director/lingo/lingo-lex.l" { count(); return *yytext; } YY_BREAK case 47: /* rule 47 can match eol */ YY_RULE_SETUP -#line 176 "engines/director/lingo/lingo-lex.l" +#line 180 "engines/director/lingo/lingo-lex.l" { return '\n'; } YY_BREAK case 48: YY_RULE_SETUP -#line 177 "engines/director/lingo/lingo-lex.l" +#line 181 "engines/director/lingo/lingo-lex.l" { count(); yylval.s = new Common::String(&yytext[1]); yylval.s->deleteLastChar(); return STRING; } YY_BREAK case 49: YY_RULE_SETUP -#line 178 "engines/director/lingo/lingo-lex.l" +#line 182 "engines/director/lingo/lingo-lex.l" YY_BREAK case 50: YY_RULE_SETUP -#line 180 "engines/director/lingo/lingo-lex.l" +#line 184 "engines/director/lingo/lingo-lex.l" ECHO; YY_BREAK -#line 1251 "engines/director/lingo/lingo-lex.cpp" +#line 1255 "engines/director/lingo/lingo-lex.cpp" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2247,7 +2251,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 180 "engines/director/lingo/lingo-lex.l" +#line 184 "engines/director/lingo/lingo-lex.l" |