aboutsummaryrefslogtreecommitdiff
path: root/lparser.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-07-17 14:26:56 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-07-17 14:26:56 -0300
commitd6af81084df569bc8e3bd0949ad6fc0b40c8468d (patch)
tree103b92a3fd9b1164763500054f7979f51f9aa4b4 /lparser.h
parent4846f7e3bb1397142ab0de808ae59c08db9832a6 (diff)
downloadlua-d6af81084df569bc8e3bd0949ad6fc0b40c8468d.tar.gz
lua-d6af81084df569bc8e3bd0949ad6fc0b40c8468d.tar.bz2
lua-d6af81084df569bc8e3bd0949ad6fc0b40c8468d.zip
New kind of expression VKSTR
String literal expressions have their own kind VKSTR, instead of the generic VK. This allows strings to "cross" functions without entering their constant tables (e.g., if they are used only by some nested function).
Diffstat (limited to 'lparser.h')
-rw-r--r--lparser.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/lparser.h b/lparser.h
index d9b734bf..f528f013 100644
--- a/lparser.h
+++ b/lparser.h
@@ -30,7 +30,9 @@ typedef enum {
30 VFALSE, /* constant false */ 30 VFALSE, /* constant false */
31 VK, /* constant in 'k'; info = index of constant in 'k' */ 31 VK, /* constant in 'k'; info = index of constant in 'k' */
32 VKFLT, /* floating constant; nval = numerical float value */ 32 VKFLT, /* floating constant; nval = numerical float value */
33 VKINT, /* integer constant; nval = numerical integer value */ 33 VKINT, /* integer constant; ival = numerical integer value */
34 VKSTR, /* string constant; strval = TString address;
35 (string is fixed by the lexer) */
34 VNONRELOC, /* expression has its value in a fixed register; 36 VNONRELOC, /* expression has its value in a fixed register;
35 info = result register */ 37 info = result register */
36 VLOCAL, /* local variable; var.ridx = local register; 38 VLOCAL, /* local variable; var.ridx = local register;
@@ -67,6 +69,7 @@ typedef struct expdesc {
67 union { 69 union {
68 lua_Integer ival; /* for VKINT */ 70 lua_Integer ival; /* for VKINT */
69 lua_Number nval; /* for VKFLT */ 71 lua_Number nval; /* for VKFLT */
72 TString *strval; /* for VKSTR */
70 int info; /* for generic use */ 73 int info; /* for generic use */
71 struct { /* for indexed variables */ 74 struct { /* for indexed variables */
72 short idx; /* index (R or "long" K) */ 75 short idx; /* index (R or "long" K) */