Skip to content

Commit

Permalink
Stop interfering with short closures
Browse files Browse the repository at this point in the history
  • Loading branch information
assertchris committed Aug 16, 2017
1 parent 782364c commit f6f26d2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
11 changes: 10 additions & 1 deletion src/macros.yay
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,16 @@ macro ·recursion {
·token("("),
·token(","),
·token("="),
·operator("=>")
·chain(
·either(
·token(T_CONSTANT_ENCAPSED_STRING),
·token(T_LNUMBER),
·token(T_DNUMBER),
·token(T_STRING),
·token(T_VARIABLE)
),
·operator("=>")
)
)·before,
·token("{"),
·optional(·angle_layer())·values,
Expand Down
12 changes: 10 additions & 2 deletions tests/specs/collections.spec
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,17 @@ $d = {

{ $a, $b, $c } = ["a" => 1, "b" => 2, "c" => 3];

() => {}

["foo" => {"bar" => "baz"}]

--EXPECT--

((new \Pre\Collections\Collection()));
( (new \Pre\Collections\Collection()));

[ (new \Pre\Collections\Collection())];

((new \Pre\Collections\Collection(["foo" => "bar"])));
( (new \Pre\Collections\Collection(["foo" => "bar"])));

[ (new \Pre\Collections\Collection(["foo" => "bar"]))];

Expand All @@ -71,3 +75,7 @@ $d = (new \Pre\Collections\Collection(["hello" => "world",
]));

['a' => $a, 'b' => $b, 'c' => $c] = ["a" => 1, "b" => 2, "c" => 3];

() => {}

["foo"=> (new \Pre\Collections\Collection(["bar" => "baz"]))]

0 comments on commit f6f26d2

Please sign in to comment.