Constant fold objects

This commit is contained in:
Nicolas Williams committed 2014-08-09 20:47:03 -05:00
1 parent f87521183f
commit c321c3b86b
3 files changed
+51 -2

No files matched your search

+5 -1
View File
@@ -631,7 +631,11 @@ FORMAT {
$$ = gen_const(jv_array());
} |
'{' MkDict '}' {
$$ = BLOCK(gen_subexp(gen_const(jv_object())), $2, gen_op_simple(POP));
block o = gen_const_object($2);
if (o.first != NULL)
$$ = o;
else
$$ = BLOCK(gen_subexp(gen_const(jv_object())), $2, gen_op_simple(POP));
} |
'$' IDENT {
$$ = gen_location(@$, locations, gen_op_unbound(LOADV, jv_string_value($2)));