diff options
Diffstat (limited to 'LuaSL/src/LuaSL_lexer.l')
-rw-r--r-- | LuaSL/src/LuaSL_lexer.l | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/LuaSL/src/LuaSL_lexer.l b/LuaSL/src/LuaSL_lexer.l index c805659..afc99ce 100644 --- a/LuaSL/src/LuaSL_lexer.l +++ b/LuaSL/src/LuaSL_lexer.l | |||
@@ -8,7 +8,7 @@ int common(YYSTYPE *lval, char *text, LuaSL_yyparseParam *param, boolean checkIg | |||
8 | %} | 8 | %} |
9 | 9 | ||
10 | %option reentrant never-interactive batch | 10 | %option reentrant never-interactive batch |
11 | %option bison-bridge yylineno 8bit | 11 | %option bison-bridge 8bit |
12 | %option noreject noyymore | 12 | %option noreject noyymore |
13 | %option backup debug perf-report perf-report verbose warn | 13 | %option backup debug perf-report perf-report verbose warn |
14 | %option align full | 14 | %option align full |
@@ -115,9 +115,22 @@ STRING \"(\\.|[^\\"\n])*\" | |||
115 | 115 | ||
116 | int common(YYSTYPE *lval, char *text, LuaSL_yyparseParam *param, boolean checkIgnorable, int type) | 116 | int common(YYSTYPE *lval, char *text, LuaSL_yyparseParam *param, boolean checkIgnorable, int type) |
117 | { | 117 | { |
118 | char *p; | ||
119 | |||
120 | for (p = text; *p; p++) | ||
121 | { | ||
122 | if ('\n' == *p) | ||
123 | { | ||
124 | param->line++; | ||
125 | param->column = 1; | ||
126 | } | ||
127 | else | ||
128 | param->column++; | ||
129 | } | ||
130 | |||
118 | lval->token = tokens[type - lowestToken]; | 131 | lval->token = tokens[type - lowestToken]; |
119 | lval->line = yyget_lineno(param->scanner); | 132 | lval->line = param->line; |
120 | lval->column = yyget_column(param->scanner); | 133 | lval->column = param->column; |
121 | 134 | ||
122 | if (checkIgnorable) | 135 | if (checkIgnorable) |
123 | { | 136 | { |