aboutsummaryrefslogtreecommitdiff
path: root/engines/director/lingo/lingo-lex.l
diff options
context:
space:
mode:
authorEugene Sandulenko2017-02-12 11:12:54 +0100
committerEugene Sandulenko2017-02-12 11:12:54 +0100
commite76fec67a13ccc433de6eb41e45649e68a2865cc (patch)
tree17a2cc7d56c8c29b9eb925df0e304c53ceba13ac /engines/director/lingo/lingo-lex.l
parentd1a08b5145ea822c106e34043bf9b0a0be16c90d (diff)
downloadscummvm-rg350-e76fec67a13ccc433de6eb41e45649e68a2865cc.tar.gz
scummvm-rg350-e76fec67a13ccc433de6eb41e45649e68a2865cc.tar.bz2
scummvm-rg350-e76fec67a13ccc433de6eb41e45649e68a2865cc.zip
DIRECTOR: Lingo: Fixing position count in lexer
Diffstat (limited to 'engines/director/lingo/lingo-lex.l')
-rw-r--r--engines/director/lingo/lingo-lex.l23
1 files changed, 4 insertions, 19 deletions
diff --git a/engines/director/lingo/lingo-lex.l b/engines/director/lingo/lingo-lex.l
index 93b57a079a..b69e3d0328 100644
--- a/engines/director/lingo/lingo-lex.l
+++ b/engines/director/lingo/lingo-lex.l
@@ -37,6 +37,9 @@ using namespace Director;
int yyparse();
static void count() {
+ if (debugChannelSet(-1, kDebugLingoCompile))
+ debug("LEXER: Read '%s' at %d:%d", yytext, g_lingo->_linenumber, g_lingo->_colnumber);
+
g_lingo->_colnumber += strlen(yytext);
}
@@ -143,9 +146,6 @@ whitespace [\t ]
(?i:the[ \t]+last[\t ]+of[\t ]+) {
count();
- if (debugChannelSet(-1, kDebugLingoCompile))
- debug("LEXER: the last: Read '%s'", yytext);
-
yylval.e[0] = g_lingo->_theEntities["last"]->entity;
yylval.e[1] = 0; // No field
@@ -154,9 +154,6 @@ 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
@@ -165,9 +162,6 @@ 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++;
@@ -208,9 +202,6 @@ 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++;
@@ -242,9 +233,6 @@ 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++;
@@ -279,9 +267,6 @@ 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;
@@ -322,7 +307,7 @@ whitespace [\t ]
{operator} { count(); return *yytext; }
{newline} { return '\n'; }
{conststring} { count(); yylval.s = new Common::String(&yytext[1]); yylval.s->deleteLastChar(); return STRING; }
-.
+. { count(); }
%%