aboutsummaryrefslogtreecommitdiff
path: root/llex.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-11-04 13:27:53 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-11-04 13:27:53 -0200
commit45cad43c3fedb13a5e424429fe94dc78ba01a118 (patch)
treee5dae021aa66accc06b6941add38bf2d495c6440 /llex.c
parentdad5a01fb07e8a654f195ec3a9ca271cd5ee32e3 (diff)
downloadlua-45cad43c3fedb13a5e424429fe94dc78ba01a118.tar.gz
lua-45cad43c3fedb13a5e424429fe94dc78ba01a118.tar.bz2
lua-45cad43c3fedb13a5e424429fe94dc78ba01a118.zip
"lua_open": now lua has an explicit open operation.
Diffstat (limited to 'llex.c')
-rw-r--r--llex.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/llex.c b/llex.c
index d8fb39a6..9ab8ae5c 100644
--- a/llex.c
+++ b/llex.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: llex.c,v 1.2 1997/09/26 15:02:26 roberto Exp roberto $ 2** $Id: llex.c,v 1.3 1997/10/13 22:10:45 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*/
@@ -30,7 +30,7 @@ int lua_debug=0;
30 30
31 31
32 32
33static void addReserved (void) 33void luaX_init (void)
34{ 34{
35 static struct { 35 static struct {
36 char *name; 36 char *name;
@@ -41,14 +41,10 @@ static void addReserved (void)
41 {"nil", NIL}, {"not", NOT}, {"or", OR}, {"repeat", REPEAT}, 41 {"nil", NIL}, {"not", NOT}, {"or", OR}, {"repeat", REPEAT},
42 {"return", RETURN}, {"then", THEN}, {"until", UNTIL}, {"while", WHILE} 42 {"return", RETURN}, {"then", THEN}, {"until", UNTIL}, {"while", WHILE}
43 }; 43 };
44 static int firsttime = 1; 44 int i;
45 if (firsttime) { 45 for (i=0; i<(sizeof(reserved)/sizeof(reserved[0])); i++) {
46 int i; 46 TaggedString *ts = luaS_new(reserved[i].name);
47 firsttime = 0; 47 ts->head.marked = reserved[i].token; /* reserved word (always > 255) */
48 for (i=0; i<(sizeof(reserved)/sizeof(reserved[0])); i++) {
49 TaggedString *ts = luaS_new(reserved[i].name);
50 ts->head.marked = reserved[i].token; /* reserved word (always > 255) */
51 }
52 } 48 }
53} 49}
54 50
@@ -85,7 +81,6 @@ static void firstline (void)
85 81
86void luaX_setinput (ZIO *z) 82void luaX_setinput (ZIO *z)
87{ 83{
88 addReserved();
89 current = '\n'; 84 current = '\n';
90 luaX_linenumber = 0; 85 luaX_linenumber = 0;
91 iflevel = 0; 86 iflevel = 0;