Literal strings and better literal numbers.

This commit is contained in:
Stephen Dolan committed 2012-09-03 13:57:47 +01:00
1 parent 52487ff812
commit 6041fd7661
4 files changed
+23 -6

No files matched your search

+4
View File
@@ -189,6 +189,10 @@ MkDictPair
: IDENT ':' ExpD {
$$ = gen_dictpair(gen_op_const(LOADK, $1), $3);
}
| LITERAL ':' ExpD {
assert(jv_get_kind($1) == JV_KIND_STRING);
$$ = gen_dictpair(gen_op_const(LOADK, $1), $3);
}
| IDENT {
$$ = gen_dictpair(gen_op_const(LOADK, jv_copy($1)),
gen_index(gen_noop(), gen_op_const(LOADK, $1)));