aboutsummaryrefslogtreecommitdiff
path: root/engines/director/lingo/lingo-lex.l
diff options
context:
space:
mode:
Diffstat (limited to 'engines/director/lingo/lingo-lex.l')
-rw-r--r--engines/director/lingo/lingo-lex.l16
1 files changed, 14 insertions, 2 deletions
diff --git a/engines/director/lingo/lingo-lex.l b/engines/director/lingo/lingo-lex.l
index 40f66a6e34..1f1cd76661 100644
--- a/engines/director/lingo/lingo-lex.l
+++ b/engines/director/lingo/lingo-lex.l
@@ -90,14 +90,26 @@ whitespace [\t ]
(?i:repeat) { count(); return tREPEAT; }
(?i:set) { count(); return tSET; }
(?i:starts) { count(); return tSTARTS; }
-(?i:the[ \t]+[:alpha:]+) {
+(?i:the[ \t]+[[:alpha:]]+) {
count();
const char *ptr = &yytext[4]; // Skip 'the '
while (*ptr == ' ' || *ptr == '\t')
ptr++;
- return tTHEN;
+ if (g_lingo->_theEntities.contains(ptr)) {
+ yylval.i = g_lingo->_theEntities[ptr]->entity;
+
+ if (g_lingo->_theEntities[ptr]->hasId)
+ return THEENTITYWITHID;
+ else
+ return THEENTITY;
+ } else if (g_lingo->_theEntityFields.contains(ptr)) {
+ yylval.i = g_lingo->_theEntityFields[ptr]->field;
+ return THEFIELD;
+ }
+
+ error("Unhandled the entity %s", ptr);
}
(?i:then) { count(); return tTHEN; }
(?i:to) { count(); return tTO; }