diff options
author | Eugene Sandulenko | 2019-12-06 23:54:16 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2019-12-06 23:54:16 +0100 |
commit | 2d7f1209b3bb5c584f850f650c06b7724bce1fee (patch) | |
tree | 7380f0e2791ec50c7728d988d19c03f2097725a7 /engines/director/lingo/lingo-lex.l | |
parent | 458ad2a86f2abbcdc521cbee15ca293052fd4b1f (diff) | |
download | scummvm-rg350-2d7f1209b3bb5c584f850f650c06b7724bce1fee.tar.gz scummvm-rg350-2d7f1209b3bb5c584f850f650c06b7724bce1fee.tar.bz2 scummvm-rg350-2d7f1209b3bb5c584f850f650c06b7724bce1fee.zip |
DIRECTOR: LINGO: Finally fix 'if' grammar with prepocessing
Diffstat (limited to 'engines/director/lingo/lingo-lex.l')
-rw-r--r-- | engines/director/lingo/lingo-lex.l | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/engines/director/lingo/lingo-lex.l b/engines/director/lingo/lingo-lex.l index d5ca6b6383..b1801bda78 100644 --- a/engines/director/lingo/lingo-lex.l +++ b/engines/director/lingo/lingo-lex.l @@ -99,8 +99,7 @@ whitespace [\t ] (?i:done) { count(); return tDONE; } (?i:down) { count(); return tDOWN; } (?i:if) { count(); return tIF; } -(?i:[\n\r]+[\t ]*else[\t ]+if) { count(); return tNLELSIF; } -(?i:[\n\r]+[\t ]*else) { count(); return tNLELSE; } +(?i:else[\t ]+if) { count(); return tELSIF; } (?i:else) { count(); return tELSE; } (?i:end)([\t ]*{identifier})? { count(); @@ -109,6 +108,13 @@ whitespace [\t ] while (*ptr == ' ' || *ptr == '\t') ptr++; + if (!scumm_stricmp(ptr, "if")) + return tENDIF; + else if (!scumm_stricmp(ptr, "repeat")) + return tENDREPEAT; + else if (!scumm_stricmp(ptr, "tell")) + return tENDTELL; + yylval.s = new Common::String(ptr); return ENDCLAUSE; @@ -258,7 +264,6 @@ whitespace [\t ] warning("Unhandled the entity %s", ptr); } (?i:then) { count(); return tTHEN; } -(?i:then[\n\r]+) { count(); return tTHENNL; } (?i:to) { count(); return tTO; } (?i:sprite) { count(); return tSPRITE; } (?i:with) { count(); return tWITH; } |