diff options
Diffstat (limited to 'src/lj_lex.h')
-rw-r--r-- | src/lj_lex.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/lj_lex.h b/src/lj_lex.h index b1bc4876..8665aa2a 100644 --- a/src/lj_lex.h +++ b/src/lj_lex.h | |||
@@ -30,7 +30,8 @@ TKDEF(TKENUM1, TKENUM2) | |||
30 | TK_RESERVED = TK_while - TK_OFS | 30 | TK_RESERVED = TK_while - TK_OFS |
31 | }; | 31 | }; |
32 | 32 | ||
33 | typedef int LexToken; | 33 | typedef int LexChar; /* Lexical character. Unsigned ext. from char. */ |
34 | typedef int LexToken; /* Lexical token. */ | ||
34 | 35 | ||
35 | /* Combined bytecode ins/line. Only used during bytecode generation. */ | 36 | /* Combined bytecode ins/line. Only used during bytecode generation. */ |
36 | typedef struct BCInsLine { | 37 | typedef struct BCInsLine { |
@@ -51,13 +52,13 @@ typedef struct VarInfo { | |||
51 | typedef struct LexState { | 52 | typedef struct LexState { |
52 | struct FuncState *fs; /* Current FuncState. Defined in lj_parse.c. */ | 53 | struct FuncState *fs; /* Current FuncState. Defined in lj_parse.c. */ |
53 | struct lua_State *L; /* Lua state. */ | 54 | struct lua_State *L; /* Lua state. */ |
54 | TValue tokenval; /* Current token value. */ | 55 | TValue tokval; /* Current token value. */ |
55 | TValue lookaheadval; /* Lookahead token value. */ | 56 | TValue lookaheadval; /* Lookahead token value. */ |
56 | int current; /* Current character (charint). */ | ||
57 | LexToken token; /* Current token. */ | ||
58 | LexToken lookahead; /* Lookahead token. */ | ||
59 | MSize n; /* Bytes left in input buffer. */ | ||
60 | const char *p; /* Current position in input buffer. */ | 57 | const char *p; /* Current position in input buffer. */ |
58 | const char *pe; /* End of input buffer. */ | ||
59 | LexChar c; /* Current character. */ | ||
60 | LexToken tok; /* Current token. */ | ||
61 | LexToken lookahead; /* Lookahead token. */ | ||
61 | SBuf sb; /* String buffer for tokens. */ | 62 | SBuf sb; /* String buffer for tokens. */ |
62 | lua_Reader rfunc; /* Reader callback. */ | 63 | lua_Reader rfunc; /* Reader callback. */ |
63 | void *rdata; /* Reader callback data. */ | 64 | void *rdata; /* Reader callback data. */ |
@@ -79,8 +80,8 @@ LJ_FUNC int lj_lex_setup(lua_State *L, LexState *ls); | |||
79 | LJ_FUNC void lj_lex_cleanup(lua_State *L, LexState *ls); | 80 | LJ_FUNC void lj_lex_cleanup(lua_State *L, LexState *ls); |
80 | LJ_FUNC void lj_lex_next(LexState *ls); | 81 | LJ_FUNC void lj_lex_next(LexState *ls); |
81 | LJ_FUNC LexToken lj_lex_lookahead(LexState *ls); | 82 | LJ_FUNC LexToken lj_lex_lookahead(LexState *ls); |
82 | LJ_FUNC const char *lj_lex_token2str(LexState *ls, LexToken token); | 83 | LJ_FUNC const char *lj_lex_token2str(LexState *ls, LexToken tok); |
83 | LJ_FUNC_NORET void lj_lex_error(LexState *ls, LexToken token, ErrMsg em, ...); | 84 | LJ_FUNC_NORET void lj_lex_error(LexState *ls, LexToken tok, ErrMsg em, ...); |
84 | LJ_FUNC void lj_lex_init(lua_State *L); | 85 | LJ_FUNC void lj_lex_init(lua_State *L); |
85 | 86 | ||
86 | #endif | 87 | #endif |