summaryrefslogtreecommitdiff
path: root/lib/lua/includes/lparser.h
diff options
context:
space:
mode:
authorpixel <pixel>2007-07-27 10:05:52 +0000
committerpixel <pixel>2007-07-27 10:05:52 +0000
commit6c1ab7da376ae7f78a075dda5c5be0dabce20931 (patch)
treebc44e447c450c96140cf6b63c39a37afa8ba61fb /lib/lua/includes/lparser.h
parenta68385b1043a2041390f65ce5cf9ed434af5e95d (diff)
Upgrading to Lua-5.1.2
Diffstat (limited to 'lib/lua/includes/lparser.h')
-rw-r--r--lib/lua/includes/lparser.h29
1 files changed, 20 insertions, 9 deletions
diff --git a/lib/lua/includes/lparser.h b/lib/lua/includes/lparser.h
index acbda7f..7eac78c 100644
--- a/lib/lua/includes/lparser.h
+++ b/lib/lua/includes/lparser.h
@@ -1,5 +1,5 @@
/*
-** $Id: lparser.h,v 1.4 2004-11-27 21:46:06 pixel Exp $
+** $Id: lparser.h,v 1.5 2007-07-27 10:05:53 pixel Exp $
** Lua Parser
** See Copyright Notice in lua.h
*/
@@ -9,7 +9,6 @@
#include "llimits.h"
#include "lobject.h"
-#include "ltable.h"
#include "lzio.h"
@@ -23,6 +22,7 @@ typedef enum {
VTRUE,
VFALSE,
VK, /* info = index of constant in `k' */
+ VKNUM, /* nval = numerical value */
VLOCAL, /* info = local register */
VUPVAL, /* info = index of upvalue in `upvalues' */
VGLOBAL, /* info = index of table; aux = index of global name in `k' */
@@ -30,17 +30,27 @@ typedef enum {
VJMP, /* info = instruction pc */
VRELOCABLE, /* info = instruction pc */
VNONRELOC, /* info = result register */
- VCALL /* info = result register */
+ VCALL, /* info = instruction pc */
+ VVARARG /* info = instruction pc */
} expkind;
typedef struct expdesc {
expkind k;
- int info, aux;
+ union {
+ struct { int info, aux; } s;
+ lua_Number nval;
+ } u;
int t; /* patch list of `exit when true' */
int f; /* patch list of `exit when false' */
} expdesc;
+typedef struct upvaldesc {
+ lu_byte k;
+ lu_byte info;
+} upvaldesc;
+
+
struct BlockCnt; /* defined in lparser.c */
@@ -58,14 +68,15 @@ typedef struct FuncState {
int freereg; /* first free register */
int nk; /* number of elements in `k' */
int np; /* number of elements in `p' */
- int nlocvars; /* number of elements in `locvars' */
- int nactvar; /* number of active local variables */
- expdesc upvalues[MAXUPVALUES]; /* upvalues */
- int actvar[MAXVARS]; /* declared-variable stack */
+ 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 */
} FuncState;
-Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff);
+LUAI_FUNC Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff,
+ const char *name);
#endif