diff options
Diffstat (limited to 'LuaSL/src/LuaSL_lexer.l')
-rw-r--r-- | LuaSL/src/LuaSL_lexer.l | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/LuaSL/src/LuaSL_lexer.l b/LuaSL/src/LuaSL_lexer.l index 8a5e8ad..591dfdc 100644 --- a/LuaSL/src/LuaSL_lexer.l +++ b/LuaSL/src/LuaSL_lexer.l | |||
@@ -3,7 +3,7 @@ | |||
3 | #define excludeLexer | 3 | #define excludeLexer |
4 | #include "LuaSL.h" | 4 | #include "LuaSL.h" |
5 | 5 | ||
6 | int common(YYSTYPE *lval, char *text, LuaSL_yyparseParam *param, boolean checkIgnorable, int type); | 6 | int common(YYSTYPE *lval, char *text, LuaSL_compiler *compiler, boolean checkIgnorable, int type); |
7 | 7 | ||
8 | %} | 8 | %} |
9 | 9 | ||
@@ -12,7 +12,7 @@ int common(YYSTYPE *lval, char *text, LuaSL_yyparseParam *param, boolean checkIg | |||
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 |
15 | %option extra-type="LuaSL_yyparseParam *" | 15 | %option extra-type="LuaSL_compiler *" |
16 | 16 | ||
17 | HEX [[:xdigit:]] | 17 | HEX [[:xdigit:]] |
18 | DECIMAL [[:digit:]] | 18 | DECIMAL [[:digit:]] |
@@ -113,7 +113,7 @@ STRING \"(\\.|[^\\"\n])*\" | |||
113 | 113 | ||
114 | %% | 114 | %% |
115 | 115 | ||
116 | int common(YYSTYPE *lval, char *text, LuaSL_yyparseParam *param, boolean checkIgnorable, int type) | 116 | int common(YYSTYPE *lval, char *text, LuaSL_compiler *compiler, boolean checkIgnorable, int type) |
117 | { | 117 | { |
118 | char *p; | 118 | char *p; |
119 | 119 | ||
@@ -121,33 +121,33 @@ int common(YYSTYPE *lval, char *text, LuaSL_yyparseParam *param, boolean checkIg | |||
121 | { | 121 | { |
122 | if ('\n' == *p) | 122 | if ('\n' == *p) |
123 | { | 123 | { |
124 | param->line++; | 124 | compiler->line++; |
125 | param->column = 1; | 125 | compiler->column = 1; |
126 | } | 126 | } |
127 | else | 127 | else |
128 | param->column++; | 128 | compiler->column++; |
129 | } | 129 | } |
130 | lval->token = tokens[type - lowestToken]; | 130 | lval->token = tokens[type - lowestToken]; |
131 | lval->line = param->line; | 131 | lval->line = compiler->line; |
132 | lval->column = param->column; | 132 | lval->column = compiler->column; |
133 | 133 | ||
134 | if (checkIgnorable) | 134 | if (checkIgnorable) |
135 | { | 135 | { |
136 | lval->ignorableText = param->ignorableText; | 136 | lval->ignorableText = compiler->ignorableText; |
137 | param->ignorableText = NULL; | 137 | compiler->ignorableText = NULL; |
138 | } | 138 | } |
139 | else | 139 | else |
140 | { | 140 | { |
141 | if (param->ignorableText) | 141 | if (compiler->ignorableText) |
142 | { | 142 | { |
143 | int lenI = strlen(param->ignorableText); | 143 | int lenI = strlen(compiler->ignorableText); |
144 | int lenT = strlen(text); | 144 | int lenT = strlen(text); |
145 | 145 | ||
146 | param->ignorableText = realloc(param->ignorableText, lenI + lenT + 1); | 146 | compiler->ignorableText = realloc(compiler->ignorableText, lenI + lenT + 1); |
147 | sprintf(&(param->ignorableText[lenI]), "%s", text); | 147 | sprintf(&(compiler->ignorableText[lenI]), "%s", text); |
148 | } | 148 | } |
149 | else | 149 | else |
150 | param->ignorableText = strdup(text); | 150 | compiler->ignorableText = strdup(text); |
151 | } | 151 | } |
152 | 152 | ||
153 | return type; | 153 | return type; |