aboutsummaryrefslogtreecommitdiff
path: root/lex.c
diff options
context:
space:
mode:
Diffstat (limited to 'lex.c')
-rw-r--r--lex.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/lex.c b/lex.c
index 96f6851f..bdc81cf7 100644
--- a/lex.c
+++ b/lex.c
@@ -1,10 +1,9 @@
1char *rcs_lex = "$Id: lex.c,v 2.20 1995/10/25 13:05:51 roberto Exp roberto $"; 1char *rcs_lex = "$Id: lex.c,v 2.21 1995/11/16 20:46:24 roberto Exp roberto $";
2 2
3 3
4#include <ctype.h> 4#include <ctype.h>
5#include <stdio.h>
6#include <stdlib.h>
7#include <string.h> 5#include <string.h>
6#include <stdio.h>
8 7
9#include "mem.h" 8#include "mem.h"
10#include "tree.h" 9#include "tree.h"
@@ -144,7 +143,7 @@ static int read_long_string (void)
144} 143}
145 144
146 145
147int yylex (void) 146int luaY_lex (void)
148{ 147{
149 float a; 148 float a;
150 static int linelasttoken = 0; 149 static int linelasttoken = 0;
@@ -176,12 +175,12 @@ int yylex (void)
176 *yytextLast = 0; 175 *yytextLast = 0;
177 if (lua_strcmp(yytext, "debug") == 0) 176 if (lua_strcmp(yytext, "debug") == 0)
178 { 177 {
179 yylval.vInt = 1; 178 luaY_lval.vInt = 1;
180 return DEBUG; 179 return DEBUG;
181 } 180 }
182 else if (lua_strcmp(yytext, "nodebug") == 0) 181 else if (lua_strcmp(yytext, "nodebug") == 0)
183 { 182 {
184 yylval.vInt = 0; 183 luaY_lval.vInt = 0;
185 return DEBUG; 184 return DEBUG;
186 } 185 }
187 return WRONGTOKEN; 186 return WRONGTOKEN;
@@ -203,7 +202,7 @@ int yylex (void)
203 return WRONGTOKEN; 202 return WRONGTOKEN;
204 save_and_next(); /* pass the second ']' */ 203 save_and_next(); /* pass the second ']' */
205 *(yytextLast-2) = 0; /* erases ']]' */ 204 *(yytextLast-2) = 0; /* erases ']]' */
206 yylval.vWord = luaI_findconstantbyname(yytext+2); 205 luaY_lval.vWord = luaI_findconstantbyname(yytext+2);
207 return STRING; 206 return STRING;
208 } 207 }
209 208
@@ -263,7 +262,7 @@ int yylex (void)
263 } 262 }
264 next(); /* skip the delimiter */ 263 next(); /* skip the delimiter */
265 *yytextLast = 0; 264 *yytextLast = 0;
266 yylval.vWord = luaI_findconstantbyname(yytext); 265 luaY_lval.vWord = luaI_findconstantbyname(yytext);
267 return STRING; 266 return STRING;
268 } 267 }
269 268
@@ -286,7 +285,7 @@ int yylex (void)
286 *yytextLast = 0; 285 *yytextLast = 0;
287 res = findReserved(yytext); 286 res = findReserved(yytext);
288 if (res) return res; 287 if (res) return res;
289 yylval.pNode = lua_constcreate(yytext); 288 luaY_lval.pNode = lua_constcreate(yytext);
290 return NAME; 289 return NAME;
291 } 290 }
292 291
@@ -327,7 +326,7 @@ fraction:
327 ea*=ea; 326 ea*=ea;
328 } 327 }
329 } 328 }
330 yylval.vFloat = a; 329 luaY_lval.vFloat = a;
331 return NUMBER; 330 return NUMBER;
332 } 331 }
333 332