summaryrefslogtreecommitdiffstats
path: root/parser.y
diff options
context:
space:
mode:
authorStephen Dolan <mu@netsoc.tcd.ie>2012-12-03 20:31:40 +0000
committerStephen Dolan <mu@netsoc.tcd.ie>2012-12-03 20:31:40 +0000
commita88d53d2fda9a755c9c972a09a1206d54ca0d8b2 (patch)
tree5e9d45ab2e96fa8a96a69b00231dcc5cadd492f6 /parser.y
parent5f6a95c7b574c6d0f52e62e2405c550606a5ce75 (diff)
Extend `{foo}` syntax to allow `{"foo"}` as well.
Useful when "foo" contains unusual characters. Should help with the issues #7, #38, #40, #42.
Diffstat (limited to 'parser.y')
-rw-r--r--parser.y4
1 files changed, 4 insertions, 0 deletions
diff --git a/parser.y b/parser.y
index cee3c9d6..e3d32e45 100644
--- a/parser.y
+++ b/parser.y
@@ -414,6 +414,10 @@ MkDictPair
| String ':' ExpD {
$$ = gen_dictpair($1, $3);
}
+| String {
+ $$ = gen_dictpair($1, BLOCK(gen_op_simple(POP), gen_op_simple(DUP2),
+ gen_op_simple(DUP2), gen_op_simple(INDEX)));
+ }
| IDENT {
$$ = gen_dictpair(gen_const(jv_copy($1)),
gen_index(gen_noop(), gen_const($1)));