summaryrefslogtreecommitdiff
path: root/src/lparser.h
diff options
context:
space:
mode:
authorLua Team <team@lua.org>2010-01-08 12:00:00 +0000
committerrepogen <>2010-01-08 12:00:00 +0000
commit22912c77c80f8de8f7accd3319c726f7c5349fd3 (patch)
treecaf064ecca31cd2ef1c919c585ee6b3d5e6d25d6 /src/lparser.h
parent300cd56eb905be061aa75bb665549b3b85109bbe (diff)
downloadlua-github-5.2.0-work1.tar.gz
Lua 5.2.0-work15.2.0-work1
Diffstat (limited to 'src/lparser.h')
-rw-r--r--src/lparser.h29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/lparser.h b/src/lparser.h
index 18836afd..2ad0a509 100644
--- a/src/lparser.h
+++ b/src/lparser.h
@@ -1,5 +1,5 @@
/*
-** $Id: lparser.h,v 1.57.1.1 2007/12/27 13:02:25 roberto Exp $
+** $Id: lparser.h,v 1.61 2009/10/11 20:02:19 roberto Exp $
** Lua Parser
** See Copyright Notice in lua.h
*/
@@ -23,8 +23,8 @@ typedef enum {
VFALSE,
VK, /* info = index of constant in `k' */
VKNUM, /* nval = numerical value */
- VLOCAL, /* info = local register */
- VUPVAL, /* info = index of upvalue in `upvalues' */
+ VLOCAL, /* info = local register; aux = read only */
+ VUPVAL, /* info = index of upvalue in 'upvalues'; aux = read only */
VGLOBAL, /* info = index of table; aux = index of global name in `k' */
VINDEXED, /* info = table register; aux = index register (or `k') */
VJMP, /* info = instruction pc */
@@ -34,6 +34,7 @@ typedef enum {
VVARARG /* info = instruction pc */
} expkind;
+
typedef struct expdesc {
expkind k;
union {
@@ -45,10 +46,17 @@ typedef struct expdesc {
} expdesc;
-typedef struct upvaldesc {
- lu_byte k;
- lu_byte info;
-} upvaldesc;
+typedef struct vardesc {
+ unsigned short idx;
+} vardesc;
+
+
+/* list of all active local variables */
+typedef struct Varlist {
+ vardesc *actvar;
+ int nactvar;
+ int actvarsize;
+} Varlist;
struct BlockCnt; /* defined in lparser.c */
@@ -68,15 +76,16 @@ typedef struct FuncState {
int freereg; /* first free register */
int nk; /* number of elements in `k' */
int np; /* number of elements in `p' */
+ int firstlocal; /* index of first local var of this function */
short nlocvars; /* number of elements in `locvars' */
lu_byte nactvar; /* number of active local variables */
- upvaldesc upvalues[LUAI_MAXUPVALUES]; /* upvalues */
- unsigned short actvar[LUAI_MAXVARS]; /* declared-variable stack */
+ lu_byte nups; /* number of upvalues */
+ lu_byte envreg; /* register holding current lexical environment */
} FuncState;
LUAI_FUNC Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff,
- const char *name);
+ Varlist *varl, const char *name);
#endif