diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-06-16 10:22:04 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-06-16 10:22:04 -0300 |
commit | 5c19ed2a13af8cdf364867ea66f9827bc139d06b (patch) | |
tree | e097d3c2ce5a2019f6218666db78c13eb5c4a3fc | |
parent | 5caf7f4a33938f482be78d1b4a807e86411706f0 (diff) | |
download | lua-5c19ed2a13af8cdf364867ea66f9827bc139d06b.tar.gz lua-5c19ed2a13af8cdf364867ea66f9827bc139d06b.tar.bz2 lua-5c19ed2a13af8cdf364867ea66f9827bc139d06b.zip |
bigger limit for number of local variables and upvalues
-rw-r--r-- | lparser.c | 24 |
1 files changed, 13 insertions, 11 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lparser.c,v 1.33 1999/05/10 13:54:01 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 1.34 1999/05/21 19:54:06 roberto Exp roberto $ |
3 | ** LL(1) Parser and code generator for Lua | 3 | ** LL(1) Parser and code generator for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -30,25 +30,27 @@ | |||
30 | #define JMPSIZE 2 | 30 | #define JMPSIZE 2 |
31 | 31 | ||
32 | /* maximum number of local variables */ | 32 | /* maximum number of local variables */ |
33 | #define MAXLOCALS 32 | 33 | #define MAXLOCALS 200 |
34 | #define SMAXLOCALS "32" | 34 | #define SMAXLOCALS "200" |
35 | 35 | ||
36 | 36 | ||
37 | /* maximum number of upvalues */ | 37 | /* maximum number of upvalues */ |
38 | #define MAXUPVALUES 16 | 38 | #define MAXUPVALUES 32 |
39 | #define SMAXUPVALUES "16" | 39 | #define SMAXUPVALUES "32" |
40 | 40 | ||
41 | 41 | ||
42 | /* | 42 | /* |
43 | ** Variable descriptor: | 43 | ** Variable descriptor: |
44 | ** must include a "exp" option because LL(1) cannot distinguish | 44 | ** must include an "exp" option because LL(1) cannot distinguish |
45 | ** between variables, upvalues and function calls on first sight. | 45 | ** between variables, upvalues and function calls on first sight. |
46 | ** VGLOBAL: info is constant index of global name | ||
47 | ** VLOCAL: info is stack index | ||
48 | ** VDOT: info is constant index of index name | ||
49 | ** VEXP: info is pc index of "nparam" of function call (or 0 if exp is closed) | ||
50 | */ | 46 | */ |
51 | typedef enum {VGLOBAL, VLOCAL, VDOT, VINDEXED, VEXP} varkind; | 47 | typedef enum { |
48 | VGLOBAL, /* info is constant index of global name */ | ||
49 | VLOCAL, /* info is stack index */ | ||
50 | VDOT, /* info is constant index of index name */ | ||
51 | VINDEXED, /* no info (table and index are on the stack) */ | ||
52 | VEXP /* info is pc index of "nparam" of a call (or 0 if exp is closed) */ | ||
53 | } varkind; | ||
52 | 54 | ||
53 | typedef struct vardesc { | 55 | typedef struct vardesc { |
54 | varkind k; | 56 | varkind k; |