diff options
Diffstat (limited to 'lparser.c')
-rw-r--r-- | lparser.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lparser.c,v 1.24 1999/02/25 19:13:56 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 1.25 1999/02/26 15:48:55 roberto Exp roberto $ |
3 | ** LL(1) Parser and code generator for Lua | 3 | ** LL(1) Parser and code generator for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -534,7 +534,7 @@ static void func_onstack (LexState *ls, FuncState *func) { | |||
534 | } | 534 | } |
535 | 535 | ||
536 | 536 | ||
537 | static void init_state (LexState *ls, FuncState *fs, TaggedString *filename) { | 537 | static void init_state (LexState *ls, FuncState *fs, TaggedString *source) { |
538 | TProtoFunc *f = luaF_newproto(); | 538 | TProtoFunc *f = luaF_newproto(); |
539 | fs->prev = ls->fs; /* linked list of funcstates */ | 539 | fs->prev = ls->fs; /* linked list of funcstates */ |
540 | ls->fs = fs; | 540 | ls->fs = fs; |
@@ -544,7 +544,7 @@ static void init_state (LexState *ls, FuncState *fs, TaggedString *filename) { | |||
544 | fs->nupvalues = 0; | 544 | fs->nupvalues = 0; |
545 | fs->lastsetline = 0; | 545 | fs->lastsetline = 0; |
546 | fs->f = f; | 546 | fs->f = f; |
547 | f->fileName = filename; | 547 | f->source = source; |
548 | fs->pc = 0; | 548 | fs->pc = 0; |
549 | f->code = NULL; | 549 | f->code = NULL; |
550 | fs->nvars = (L->debug) ? 0 : -1; /* flag no debug information? */ | 550 | fs->nvars = (L->debug) ? 0 : -1; /* flag no debug information? */ |
@@ -828,7 +828,7 @@ static int funcname (LexState *ls, vardesc *v) { | |||
828 | static void body (LexState *ls, int needself, int line) { | 828 | static void body (LexState *ls, int needself, int line) { |
829 | /* body -> '(' parlist ')' chunk END */ | 829 | /* body -> '(' parlist ')' chunk END */ |
830 | FuncState newfs; | 830 | FuncState newfs; |
831 | init_state(ls, &newfs, ls->fs->f->fileName); | 831 | init_state(ls, &newfs, ls->fs->f->source); |
832 | newfs.f->lineDefined = line; | 832 | newfs.f->lineDefined = line; |
833 | check(ls, '('); | 833 | check(ls, '('); |
834 | if (needself) | 834 | if (needself) |
@@ -1140,7 +1140,7 @@ static int funcparams (LexState *ls, int slf) { | |||
1140 | luaX_error(ls, "function arguments expected"); | 1140 | luaX_error(ls, "function arguments expected"); |
1141 | break; | 1141 | break; |
1142 | } | 1142 | } |
1143 | code_byte(fs, CALLFUNC); | 1143 | code_byte(fs, CALL); |
1144 | code_byte(fs, 0); /* save space for nresult */ | 1144 | code_byte(fs, 0); /* save space for nresult */ |
1145 | code_byte(fs, (Byte)(nparams+slf)); | 1145 | code_byte(fs, (Byte)(nparams+slf)); |
1146 | return fs->pc-1; | 1146 | return fs->pc-1; |