aboutsummaryrefslogtreecommitdiff
path: root/engines/director/lingo/lingo-lex.l
diff options
context:
space:
mode:
authorEugene Sandulenko2017-01-10 11:06:42 +0100
committerEugene Sandulenko2017-01-10 11:06:42 +0100
commit66624ef9274248afe640ec16d80de84d479fff18 (patch)
tree95c381c1926cac2f75ef2adc666388df3994a0e5 /engines/director/lingo/lingo-lex.l
parent5df6cdca6ee6101839bfbdb9da53b43a65dd6029 (diff)
downloadscummvm-rg350-66624ef9274248afe640ec16d80de84d479fff18.tar.gz
scummvm-rg350-66624ef9274248afe640ec16d80de84d479fff18.tar.bz2
scummvm-rg350-66624ef9274248afe640ec16d80de84d479fff18.zip
DIRECTOR: Smarter checks for 'end' clause in grammar/lexer
Diffstat (limited to 'engines/director/lingo/lingo-lex.l')
-rw-r--r--engines/director/lingo/lingo-lex.l12
1 files changed, 11 insertions, 1 deletions
diff --git a/engines/director/lingo/lingo-lex.l b/engines/director/lingo/lingo-lex.l
index f6be12d7e3..43c9bc392c 100644
--- a/engines/director/lingo/lingo-lex.l
+++ b/engines/director/lingo/lingo-lex.l
@@ -85,7 +85,17 @@ whitespace [\t ]
(?i:[\n\r]+[\t ]*else[\t ]+if) { countnl(); return tNLELSIF; }
(?i:[\n\r]+[\t ]*else) { countnl(); return tNLELSE; }
(?i:else) { count(); return tELSE; }
-(?i:end) { count(); return tEND; }
+(?i:end)([\t ]*{identifier})? {
+ count();
+
+ const char *ptr = &yytext[4]; // Skip 'end '
+ while (*ptr == ' ' || *ptr == '\t')
+ ptr++;
+
+ yylval.s = new Common::String(ptr);
+
+ return ENDCLAUSE;
+ }
(?i:factory) { count(); return tFACTORY; }
(?i:exit) { count(); return tEXIT; }
(?i:frame) { count(); return tFRAME; }