aboutsummaryrefslogtreecommitdiff
path: root/engines/director/lingo/lingo-lex.l
diff options
context:
space:
mode:
authorEugene Sandulenko2016-07-11 22:46:09 +0200
committerEugene Sandulenko2016-08-03 23:40:36 +0200
commite15915b6a30d56a77c99eb9b3871cc75b4034b9c (patch)
tree1c951a5755229f44a29db5e220b18b66b8206e03 /engines/director/lingo/lingo-lex.l
parent8136267ada2c346510baa1258cd12dd436974365 (diff)
downloadscummvm-rg350-e15915b6a30d56a77c99eb9b3871cc75b4034b9c.tar.gz
scummvm-rg350-e15915b6a30d56a77c99eb9b3871cc75b4034b9c.tar.bz2
scummvm-rg350-e15915b6a30d56a77c99eb9b3871cc75b4034b9c.zip
DIRECTOR: Lingo: Process simple 'the' entities
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; }