summaryrefslogtreecommitdiff
path: root/src/lj_lex.c
diff options
context:
space:
mode:
authorMike Pall <mike>2011-06-13 00:58:13 +0200
committerMike Pall <mike>2011-06-13 01:04:11 +0200
commit4994fcc32caa90eb25e9e7532c5ed195abb4bb95 (patch)
treed1741d1b9e61c10145775ec805639c389b7ef2a8 /src/lj_lex.c
parent9da94d135535c607d71a5d7e902b561ee418f0ca (diff)
downloadluajit-4994fcc32caa90eb25e9e7532c5ed195abb4bb95.tar.gz
luajit-4994fcc32caa90eb25e9e7532c5ed195abb4bb95.tar.bz2
luajit-4994fcc32caa90eb25e9e7532c5ed195abb4bb95.zip
Add support for bytecode loading/saving.
Diffstat (limited to 'src/lj_lex.c')
-rw-r--r--src/lj_lex.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lj_lex.c b/src/lj_lex.c
index 3411aa56..01e0c641 100644
--- a/src/lj_lex.c
+++ b/src/lj_lex.c
@@ -408,7 +408,7 @@ static int llex(LexState *ls, TValue *tv)
408/* -- Lexer API ----------------------------------------------------------- */ 408/* -- Lexer API ----------------------------------------------------------- */
409 409
410/* Setup lexer state. */ 410/* Setup lexer state. */
411void lj_lex_setup(lua_State *L, LexState *ls) 411int lj_lex_setup(lua_State *L, LexState *ls)
412{ 412{
413 ls->L = L; 413 ls->L = L;
414 ls->fs = NULL; 414 ls->fs = NULL;
@@ -433,14 +433,11 @@ void lj_lex_setup(lua_State *L, LexState *ls)
433 if (ls->current == '#') { /* Skip POSIX #! header line. */ 433 if (ls->current == '#') { /* Skip POSIX #! header line. */
434 do { 434 do {
435 next(ls); 435 next(ls);
436 if (ls->current == END_OF_STREAM) return; 436 if (ls->current == END_OF_STREAM) return 0;
437 } while (!currIsNewline(ls)); 437 } while (!currIsNewline(ls));
438 inclinenumber(ls); 438 inclinenumber(ls);
439 } 439 }
440 if (ls->current == LUA_SIGNATURE[0]) { 440 return (ls->current == LUA_SIGNATURE[0]); /* Bytecode dump? */
441 setstrV(L, L->top++, lj_err_str(L, LJ_ERR_XBCLOAD));
442 lj_err_throw(L, LUA_ERRSYNTAX);
443 }
444} 441}
445 442
446/* Cleanup lexer state. */ 443/* Cleanup lexer state. */