diff options
Diffstat (limited to 'llex.c')
-rw-r--r-- | llex.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: $ | 2 | ** $Id: llex.c,v 1.1 1997/09/16 19:25:59 roberto Exp roberto $ |
3 | ** Lexical Analizer | 3 | ** Lexical Analizer |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -8,7 +8,6 @@ | |||
8 | #include <ctype.h> | 8 | #include <ctype.h> |
9 | #include <string.h> | 9 | #include <string.h> |
10 | 10 | ||
11 | #include "lglobal.h" | ||
12 | #include "llex.h" | 11 | #include "llex.h" |
13 | #include "lmem.h" | 12 | #include "lmem.h" |
14 | #include "lobject.h" | 13 | #include "lobject.h" |
@@ -48,7 +47,7 @@ static void addReserved (void) | |||
48 | firsttime = 0; | 47 | firsttime = 0; |
49 | for (i=0; i<(sizeof(reserved)/sizeof(reserved[0])); i++) { | 48 | for (i=0; i<(sizeof(reserved)/sizeof(reserved[0])); i++) { |
50 | TaggedString *ts = luaS_new(reserved[i].name); | 49 | TaggedString *ts = luaS_new(reserved[i].name); |
51 | ts->marked = reserved[i].token; /* reserved word (always > 255) */ | 50 | ts->head.marked = reserved[i].token; /* reserved word (always > 255) */ |
52 | } | 51 | } |
53 | } | 52 | } |
54 | } | 53 | } |
@@ -120,7 +119,7 @@ static int checkcond (char *buff) | |||
120 | int i = luaO_findstring(buff, opts); | 119 | int i = luaO_findstring(buff, opts); |
121 | if (i >= 0) return i; | 120 | if (i >= 0) return i; |
122 | else if (isalpha((unsigned char)buff[0]) || buff[0] == '_') | 121 | else if (isalpha((unsigned char)buff[0]) || buff[0] == '_') |
123 | return luaG_globaldefined(buff); | 122 | return luaS_globaldefined(buff); |
124 | else { | 123 | else { |
125 | luaY_syntaxerror("invalid $if condition", buff); | 124 | luaY_syntaxerror("invalid $if condition", buff); |
126 | return 0; /* to avoid warnings */ | 125 | return 0; /* to avoid warnings */ |
@@ -451,8 +450,8 @@ int luaY_lex (void) | |||
451 | } while (isalnum(current) || current == '_'); | 450 | } while (isalnum(current) || current == '_'); |
452 | save(0); | 451 | save(0); |
453 | ts = luaS_new(textbuff.text); | 452 | ts = luaS_new(textbuff.text); |
454 | if (ts->marked > 255) | 453 | if (ts->head.marked > 255) |
455 | return ts->marked; /* reserved word */ | 454 | return ts->head.marked; /* reserved word */ |
456 | luaY_lval.pTStr = ts; | 455 | luaY_lval.pTStr = ts; |
457 | return NAME; | 456 | return NAME; |
458 | } | 457 | } |