Skip to content
This repository has been archived by the owner on Jan 16, 2021. It is now read-only.

Pub parser bug in dictionaries #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion libpub/parse.yy
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,11 @@ p3_bindings: p3_binding

p3_binding: p3_bind_key p3_bind_value_opt
{
$$ = pub3::binding_t ($1, $2);
auto v = $2;
if (!v) {
v = pub3::expr_null_t::alloc();
}
$$ = pub3::binding_t ($1, v);
}
;

Expand Down
1 change: 1 addition & 0 deletions test/pub/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
PACKAGE_STRING=pub
TESTS = \
dict_equal.pub \
empty_key.pub \
scoping_for.pub \
scoping_globals-locals.pub \
scoping_order_of_decl.pub \
Expand Down
1 change: 1 addition & 0 deletions test/pub/empty_key.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["x", "y"]
5 changes: 5 additions & 0 deletions test/pub/empty_key.pub
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{%
x = 5;
v = {x:x, y}
print(sort(keys(v)));
%}