aboutsummaryrefslogtreecommitdiff
path: root/lbaselib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-03-10 14:14:37 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-03-10 14:14:37 -0300
commitba484b9eb16dd62a7c3a5400a66eb952b654d3f0 (patch)
tree31692ddf85265e5a46eab0cd55a0b0757a225e68 /lbaselib.c
parentf9d015523ef48266cea37e13717c223c16941b23 (diff)
downloadlua-ba484b9eb16dd62a7c3a5400a66eb952b654d3f0.tar.gz
lua-ba484b9eb16dd62a7c3a5400a66eb952b654d3f0.tar.bz2
lua-ba484b9eb16dd62a7c3a5400a66eb952b654d3f0.zip
yielding across lua_call (first version)
Diffstat (limited to 'lbaselib.c')
-rw-r--r--lbaselib.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/lbaselib.c b/lbaselib.c
index ffa753a1..43981dc7 100644
--- a/lbaselib.c
+++ b/lbaselib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lbaselib.c,v 1.209 2009/02/06 18:38:47 roberto Exp roberto $ 2** $Id: lbaselib.c,v 1.210 2009/02/07 12:23:15 roberto Exp roberto $
3** Basic library 3** Basic library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -323,12 +323,17 @@ static int luaB_load (lua_State *L) {
323} 323}
324 324
325 325
326static int dofilecont (lua_State *L) {
327 return lua_gettop(L) - 1;
328}
329
330
326static int luaB_dofile (lua_State *L) { 331static int luaB_dofile (lua_State *L) {
327 const char *fname = luaL_optstring(L, 1, NULL); 332 const char *fname = luaL_optstring(L, 1, NULL);
328 lua_settop(L, 1); 333 lua_settop(L, 1);
329 if (luaL_loadfile(L, fname) != LUA_OK) lua_error(L); 334 if (luaL_loadfile(L, fname) != LUA_OK) lua_error(L);
330 lua_call(L, 0, LUA_MULTRET); 335 lua_callcont(L, 0, LUA_MULTRET, dofilecont);
331 return lua_gettop(L) - 1; 336 return dofilecont(L);
332} 337}
333 338
334 339