aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LuaSL_lexer.l
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-17 13:39:35 +1000
committerDavid Walter Seikel2012-01-17 13:39:35 +1000
commit7d9c4da112a2c97f32c734393256498c023a0ebb (patch)
treec72efa9f13e30aaed1224280b286c4f51b0c4219 /LuaSL/src/LuaSL_lexer.l
parentCleanups for EFL. (diff)
downloadSledjHamr-7d9c4da112a2c97f32c734393256498c023a0ebb.zip
SledjHamr-7d9c4da112a2c97f32c734393256498c023a0ebb.tar.gz
SledjHamr-7d9c4da112a2c97f32c734393256498c023a0ebb.tar.bz2
SledjHamr-7d9c4da112a2c97f32c734393256498c023a0ebb.tar.xz
Change that butt ugly name.
Diffstat (limited to 'LuaSL/src/LuaSL_lexer.l')
-rw-r--r--LuaSL/src/LuaSL_lexer.l30
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
6int common(YYSTYPE *lval, char *text, LuaSL_yyparseParam *param, boolean checkIgnorable, int type); 6int 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
17HEX [[:xdigit:]] 17HEX [[:xdigit:]]
18DECIMAL [[:digit:]] 18DECIMAL [[:digit:]]
@@ -113,7 +113,7 @@ STRING \"(\\.|[^\\"\n])*\"
113 113
114%% 114%%
115 115
116int common(YYSTYPE *lval, char *text, LuaSL_yyparseParam *param, boolean checkIgnorable, int type) 116int 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;