diff options
Diffstat (limited to 'lua.c')
-rw-r--r-- | lua.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.c,v 1.26 1999/11/16 12:50:48 roberto Exp roberto $ | 2 | ** $Id: lua.c,v 1.27 1999/11/22 13:12:07 roberto Exp roberto $ |
3 | ** Lua stand-alone interpreter | 3 | ** Lua stand-alone interpreter |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -91,6 +91,7 @@ static void assign (char *arg) { | |||
91 | 91 | ||
92 | 92 | ||
93 | static void getargs (int argc, char *argv[]) { | 93 | static void getargs (int argc, char *argv[]) { |
94 | lua_beginblock(); { | ||
94 | int i, j; | 95 | int i, j; |
95 | lua_Object args = lua_createtable(); | 96 | lua_Object args = lua_createtable(); |
96 | lua_pushobject(args); | 97 | lua_pushobject(args); |
@@ -108,6 +109,7 @@ static void getargs (int argc, char *argv[]) { | |||
108 | /* arg.nn = minimum index in table `arg' */ | 109 | /* arg.nn = minimum index in table `arg' */ |
109 | lua_pushobject(args); lua_pushstring("nn"); | 110 | lua_pushobject(args); lua_pushstring("nn"); |
110 | lua_pushnumber(-i); lua_settable(); | 111 | lua_pushnumber(-i); lua_settable(); |
112 | } lua_endblock(); | ||
111 | } | 113 | } |
112 | 114 | ||
113 | 115 | ||
@@ -146,7 +148,7 @@ static void manual_input (int prompt) { | |||
146 | 148 | ||
147 | int main (int argc, char *argv[]) { | 149 | int main (int argc, char *argv[]) { |
148 | int i; | 150 | int i; |
149 | lua_open(); | 151 | lua_state = lua_newstate("stack", 1024, "builtin", 1, NULL); |
150 | lua_pushstring("> "); lua_setglobal("_PROMPT"); | 152 | lua_pushstring("> "); lua_setglobal("_PROMPT"); |
151 | lua_userinit(); | 153 | lua_userinit(); |
152 | getargs(argc, argv); | 154 | getargs(argc, argv); |