aboutsummaryrefslogtreecommitdiff
path: root/lparser.h
diff options
context:
space:
mode:
Diffstat (limited to 'lparser.h')
-rw-r--r--lparser.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/lparser.h b/lparser.h
index b708de25..cc2ec14d 100644
--- a/lparser.h
+++ b/lparser.h
@@ -33,8 +33,9 @@ typedef enum {
33 VKINT, /* integer constant; nval = numerical integer value */ 33 VKINT, /* integer constant; nval = numerical integer value */
34 VNONRELOC, /* expression has its value in a fixed register; 34 VNONRELOC, /* expression has its value in a fixed register;
35 info = result register */ 35 info = result register */
36 VLOCAL, /* local variable; var.idx = local register */ 36 VLOCAL, /* local variable; var.ridx = local register;
37 VUPVAL, /* upvalue variable; var.idx = index of upvalue in 'upvalues' */ 37 var.vidx = index in 'actvar.arr' */
38 VUPVAL, /* upvalue variable; info = index of upvalue in 'upvalues' */
38 VINDEXED, /* indexed variable; 39 VINDEXED, /* indexed variable;
39 ind.t = table register; 40 ind.t = table register;
40 ind.idx = key's R index */ 41 ind.idx = key's R index */
@@ -70,8 +71,9 @@ typedef struct expdesc {
70 short idx; /* index (R or "long" K) */ 71 short idx; /* index (R or "long" K) */
71 lu_byte t; /* table (register or upvalue) */ 72 lu_byte t; /* table (register or upvalue) */
72 } ind; 73 } ind;
73 struct { /* for local variables and upvalues */ 74 struct { /* for local variables */
74 lu_byte idx; /* index of the variable */ 75 lu_byte sidx; /* index in the stack */
76 unsigned short vidx; /* index in 'actvar.arr' */
75 } var; 77 } var;
76 } u; 78 } u;
77 int t; /* patch list of 'exit when true' */ 79 int t; /* patch list of 'exit when true' */
@@ -81,9 +83,10 @@ typedef struct expdesc {
81 83
82/* description of an active local variable */ 84/* description of an active local variable */
83typedef struct Vardesc { 85typedef struct Vardesc {
84 TValue val; /* constant value (if variable is 'const') */ 86 TValuefields; /* constant value (if variable is 'const') */
85 short idx; /* index of the variable in the Proto's 'locvars' array */
86 lu_byte ro; /* true if variable is 'const' */ 87 lu_byte ro; /* true if variable is 'const' */
88 lu_byte sidx; /* index of the variable in the stack */
89 short pidx; /* index of the variable in the Proto's 'locvars' array */
87} Vardesc; 90} Vardesc;
88 91
89 92
@@ -144,7 +147,6 @@ typedef struct FuncState {
144} FuncState; 147} FuncState;
145 148
146 149
147LUAI_FUNC Vardesc *luaY_getvardesc (FuncState **fs, const expdesc *e);
148LUAI_FUNC LClosure *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, 150LUAI_FUNC LClosure *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff,
149 Dyndata *dyd, const char *name, int firstchar); 151 Dyndata *dyd, const char *name, int firstchar);
150 152