Redesign of prototype generation, part 1: varinfo and uvname.
Use a growable, per-chunk variable stack. Collect varinfo/uvname for prototype at the end.
This commit is contained in:
@@ -50,10 +50,14 @@ typedef struct LexState {
|
||||
BCLine lastline; /* Line of last token. */
|
||||
GCstr *chunkname; /* Current chunk name (interned string). */
|
||||
const char *chunkarg; /* Chunk name argument. */
|
||||
VarInfo *vstack; /* Stack for names and extents of local variables. */
|
||||
MSize sizevstack; /* Size of variable stack. */
|
||||
MSize vtop; /* Top of variable stack. */
|
||||
uint32_t level; /* Syntactical nesting level. */
|
||||
} LexState;
|
||||
|
||||
LJ_FUNC void lj_lex_start(lua_State *L, LexState *ls);
|
||||
LJ_FUNC void lj_lex_setup(lua_State *L, LexState *ls);
|
||||
LJ_FUNC void lj_lex_cleanup(lua_State *L, LexState *ls);
|
||||
LJ_FUNC void lj_lex_next(LexState *ls);
|
||||
LJ_FUNC LexToken lj_lex_lookahead(LexState *ls);
|
||||
LJ_FUNC const char *lj_lex_token2str(LexState *ls, LexToken token);
|
||||
|
||||
Reference in New Issue
Block a user