diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-07-17 14:26:56 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-07-17 14:26:56 -0300 |
commit | d6af81084df569bc8e3bd0949ad6fc0b40c8468d (patch) | |
tree | 103b92a3fd9b1164763500054f7979f51f9aa4b4 /lparser.h | |
parent | 4846f7e3bb1397142ab0de808ae59c08db9832a6 (diff) | |
download | lua-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.h | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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) */ |