aboutsummaryrefslogtreecommitdiff
path: root/engines/director/lingo/lingo-lex.l
diff options
context:
space:
mode:
authorEugene Sandulenko2017-02-07 11:09:06 +0100
committerEugene Sandulenko2017-02-07 11:09:06 +0100
commita9fb3e3225dac382318f7c1ef09e7c61aeb2ac4c (patch)
treeb12b7869840d9a1b37046847a3f9a7aa3456be8c /engines/director/lingo/lingo-lex.l
parentcf503789850b628cbf0e7aeeed837370ca1439de (diff)
downloadscummvm-rg350-a9fb3e3225dac382318f7c1ef09e7c61aeb2ac4c.tar.gz
scummvm-rg350-a9fb3e3225dac382318f7c1ef09e7c61aeb2ac4c.tar.bz2
scummvm-rg350-a9fb3e3225dac382318f7c1ef09e7c61aeb2ac4c.zip
DIRECTOR: Lingo: Added debug output to lexer and fixed builtin.lingo test
Diffstat (limited to 'engines/director/lingo/lingo-lex.l')
-rw-r--r--engines/director/lingo/lingo-lex.l15
1 files changed, 15 insertions, 0 deletions
diff --git a/engines/director/lingo/lingo-lex.l b/engines/director/lingo/lingo-lex.l
index a4134b81c0..d6bf59ad5d 100644
--- a/engines/director/lingo/lingo-lex.l
+++ b/engines/director/lingo/lingo-lex.l
@@ -142,6 +142,9 @@ whitespace [\t ]
(?i:the[ \t]+sqrt[\t ]+of[\t ]+) {
count();
+ if (debugChannelSet(-1, kDebugLingoCompile))
+ debug("LEXER: the sqrt: Read '%s'", yytext);
+
yylval.e[0] = g_lingo->_theEntities["sqrt"]->entity;
yylval.e[1] = 0; // No field
@@ -150,6 +153,9 @@ whitespace [\t ]
(?i:the[ \t]+[[:alpha:]]+[\t ]+of[\t ]+[[:alpha:]]+) {
count();
+ if (debugChannelSet(-1, kDebugLingoCompile))
+ debug("LEXER: the of: Read '%s'", yytext);
+
const char *ptr = &yytext[4]; // Skip 'the '
while (*ptr == ' ' || *ptr == '\t')
ptr++;
@@ -190,6 +196,9 @@ whitespace [\t ]
(?i:the[ \t]+[[:alpha:]]+[ \t+](date|time)) {
count();
+ if (debugChannelSet(-1, kDebugLingoCompile))
+ debug("LEXER: the date: Read '%s'", yytext);
+
const char *ptr = &yytext[4]; // Skip 'the '
while (*ptr == ' ' || *ptr == '\t')
ptr++;
@@ -221,6 +230,9 @@ whitespace [\t ]
(?i:the[ \t]+[[:alpha:]]+) {
count();
+ if (debugChannelSet(-1, kDebugLingoCompile))
+ debug("LEXER: the: Read '%s'", yytext);
+
const char *ptr = &yytext[4]; // Skip 'the '
while (*ptr == ' ' || *ptr == '\t')
ptr++;
@@ -255,6 +267,9 @@ whitespace [\t ]
count();
yylval.s = new Common::String(yytext);
+ if (debugChannelSet(-1, kDebugLingoCompile))
+ debug("LEXER: identifier: Read '%s'", yytext);
+
if (g_lingo->_ignoreMe && yylval.s->equalsIgnoreCase("me"))
return ID;