From a9fb3e3225dac382318f7c1ef09e7c61aeb2ac4c Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 7 Feb 2017 11:09:06 +0100 Subject: DIRECTOR: Lingo: Added debug output to lexer and fixed builtin.lingo test --- engines/director/lingo/lingo-lex.l | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'engines/director/lingo/lingo-lex.l') 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; -- cgit v1.2.3