Allow . as {$a:$b} destructuring

This commit is contained in:
Nicolas Williams committed 2017-03-26 05:36:23 -05:00
1 parent 38bfec1594
commit 7935d307f0
3 files changed
+611 -594

No files matched your search

+3
View File
@@ -822,6 +822,9 @@ ObjPat:
'$' IDENT {
$$ = gen_object_matcher(gen_const($2), gen_op_unbound(STOREV, jv_string_value($2)));
} |
'$' IDENT ':' Pattern {
$$ = gen_object_matcher(gen_const($2), BLOCK(gen_op_simple(DUP), gen_op_unbound(STOREV, jv_string_value($2)), $4));
} |
IDENT ':' Pattern {
$$ = gen_object_matcher(gen_const($1), $3);
} |