aboutsummaryrefslogtreecommitdiff
path: root/ldo.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2003-08-25 16:51:54 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2003-08-25 16:51:54 -0300
commit9fcc48517659c72de43bece515fdd5cea88c07f8 (patch)
treead065ea1c7e2c0f6781e366e9a2e95b4cadb1780 /ldo.c
parent64066359dda2a0920d307e901185faf78cc32b97 (diff)
downloadlua-9fcc48517659c72de43bece515fdd5cea88c07f8.tar.gz
lua-9fcc48517659c72de43bece515fdd5cea88c07f8.tar.bz2
lua-9fcc48517659c72de43bece515fdd5cea88c07f8.zip
zio does not keep "source" name (nobody uses it)
Diffstat (limited to 'ldo.c')
-rw-r--r--ldo.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/ldo.c b/ldo.c
index 25c4a27a..c6fd0b59 100644
--- a/ldo.c
+++ b/ldo.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldo.c,v 1.220 2003/07/16 20:49:02 roberto Exp roberto $ 2** $Id: ldo.c,v 1.221 2003/07/16 20:51:47 roberto Exp roberto $
3** Stack and Call structure of Lua 3** Stack and Call structure of Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -431,6 +431,7 @@ struct SParser { /* data to `f_parser' */
431 ZIO *z; 431 ZIO *z;
432 Mbuffer buff; /* buffer to be used by the scanner */ 432 Mbuffer buff; /* buffer to be used by the scanner */
433 int bin; 433 int bin;
434 const char *name;
434}; 435};
435 436
436static void f_parser (lua_State *L, void *ud) { 437static void f_parser (lua_State *L, void *ud) {
@@ -439,7 +440,8 @@ static void f_parser (lua_State *L, void *ud) {
439 Closure *cl; 440 Closure *cl;
440 luaC_checkGC(L); 441 luaC_checkGC(L);
441 p = cast(struct SParser *, ud); 442 p = cast(struct SParser *, ud);
442 tf = p->bin ? luaU_undump(L, p->z, &p->buff) : luaY_parser(L, p->z, &p->buff); 443 tf = p->bin ? luaU_undump(L, p->z, &p->buff, p->name) :
444 luaY_parser(L, p->z, &p->buff, p->name);
443 cl = luaF_newLclosure(L, 0, gt(L)); 445 cl = luaF_newLclosure(L, 0, gt(L));
444 cl->l.p = tf; 446 cl->l.p = tf;
445 setclvalue(L->top, cl); 447 setclvalue(L->top, cl);
@@ -447,11 +449,11 @@ static void f_parser (lua_State *L, void *ud) {
447} 449}
448 450
449 451
450int luaD_protectedparser (lua_State *L, ZIO *z, int bin) { 452int luaD_protectedparser (lua_State *L, ZIO *z, int bin, const char *name) {
451 struct SParser p; 453 struct SParser p;
452 int status; 454 int status;
453 ptrdiff_t oldtopr = savestack(L, L->top); /* save current top */ 455 ptrdiff_t oldtopr = savestack(L, L->top); /* save current top */
454 p.z = z; p.bin = bin; 456 p.z = z; p.bin = bin; p.name = name;
455 luaZ_initbuffer(L, &p.buff); 457 luaZ_initbuffer(L, &p.buff);
456 status = luaD_rawrunprotected(L, f_parser, &p); 458 status = luaD_rawrunprotected(L, f_parser, &p);
457 luaZ_freebuffer(L, &p.buff); 459 luaZ_freebuffer(L, &p.buff);