diff options
Diffstat (limited to 'src/lua/lparser.h')
-rw-r--r-- | src/lua/lparser.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lua/lparser.h b/src/lua/lparser.h index 618cb01..5e4500f 100644 --- a/src/lua/lparser.h +++ b/src/lua/lparser.h | |||
@@ -23,7 +23,7 @@ | |||
23 | 23 | ||
24 | /* kinds of variables/expressions */ | 24 | /* kinds of variables/expressions */ |
25 | typedef enum { | 25 | typedef enum { |
26 | VVOID, /* when 'expdesc' describes the last expression a list, | 26 | VVOID, /* when 'expdesc' describes the last expression of a list, |
27 | this kind means an empty list (so, no expression) */ | 27 | this kind means an empty list (so, no expression) */ |
28 | VNIL, /* constant nil */ | 28 | VNIL, /* constant nil */ |
29 | VTRUE, /* constant true */ | 29 | VTRUE, /* constant true */ |
@@ -35,10 +35,11 @@ typedef enum { | |||
35 | (string is fixed by the lexer) */ | 35 | (string is fixed by the lexer) */ |
36 | VNONRELOC, /* expression has its value in a fixed register; | 36 | VNONRELOC, /* expression has its value in a fixed register; |
37 | info = result register */ | 37 | info = result register */ |
38 | VLOCAL, /* local variable; var.sidx = stack index (local register); | 38 | VLOCAL, /* local variable; var.ridx = register index; |
39 | var.vidx = relative index in 'actvar.arr' */ | 39 | var.vidx = relative index in 'actvar.arr' */ |
40 | VUPVAL, /* upvalue variable; info = index of upvalue in 'upvalues' */ | 40 | VUPVAL, /* upvalue variable; info = index of upvalue in 'upvalues' */ |
41 | VCONST, /* compile-time constant; info = absolute index in 'actvar.arr' */ | 41 | VCONST, /* compile-time <const> variable; |
42 | info = absolute index in 'actvar.arr' */ | ||
42 | VINDEXED, /* indexed variable; | 43 | VINDEXED, /* indexed variable; |
43 | ind.t = table register; | 44 | ind.t = table register; |
44 | ind.idx = key's R index */ | 45 | ind.idx = key's R index */ |
@@ -76,7 +77,7 @@ typedef struct expdesc { | |||
76 | lu_byte t; /* table (register or upvalue) */ | 77 | lu_byte t; /* table (register or upvalue) */ |
77 | } ind; | 78 | } ind; |
78 | struct { /* for local variables */ | 79 | struct { /* for local variables */ |
79 | lu_byte sidx; /* index in the stack */ | 80 | lu_byte ridx; /* register holding the variable */ |
80 | unsigned short vidx; /* compiler index (in 'actvar.arr') */ | 81 | unsigned short vidx; /* compiler index (in 'actvar.arr') */ |
81 | } var; | 82 | } var; |
82 | } u; | 83 | } u; |
@@ -96,7 +97,7 @@ typedef union Vardesc { | |||
96 | struct { | 97 | struct { |
97 | TValuefields; /* constant value (if it is a compile-time constant) */ | 98 | TValuefields; /* constant value (if it is a compile-time constant) */ |
98 | lu_byte kind; | 99 | lu_byte kind; |
99 | lu_byte sidx; /* index of the variable in the stack */ | 100 | lu_byte ridx; /* register holding the variable */ |
100 | short pidx; /* index of the variable in the Proto's 'locvars' array */ | 101 | short pidx; /* index of the variable in the Proto's 'locvars' array */ |
101 | TString *name; /* variable name */ | 102 | TString *name; /* variable name */ |
102 | } vd; | 103 | } vd; |