Skip to content

Commit

Permalink
Showing 5 changed files with 2,316 additions and 2,254 deletions.
4,558 changes: 2,306 additions & 2,252 deletions lib/opal/grammar.rb

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions lib/opal/grammar.y
Original file line number Diff line number Diff line change
@@ -274,10 +274,12 @@ mlhs_basic:
{
result = val[0] << s(:splat, val[2])
}
| mlhs_head SPLAT mlhs_node ',' mlhs_post
| mlhs_head SPLAT
{
result = val[0] << s(:splat)
}
| mlhs_head SPLAT ',' mlhs_post
| SPLAT mlhs_node
{
result = s(:array, s(:splat, val[1]))
@@ -286,6 +288,7 @@ mlhs_basic:
{
result = s(:array, s(:splat))
}
| SPLAT ',' mlhs_post

mlhs_item:
mlhs_node
@@ -307,6 +310,10 @@ mlhs_head:
result = val[0] << val[1]
}

mlhs_post:
mlhs_item
| mlhs_post ',' mlhs_item

mlhs_node:
variable
{
1 change: 1 addition & 0 deletions spec/filters/bugs/language/variables.rb
Original file line number Diff line number Diff line change
@@ -34,4 +34,5 @@
fails "Basic multiple assignment with a single RHS value does not call #to_a on an Array instance"
fails "Basic multiple assignment with a single RHS value does not call #to_ary on an Array instance"
fails "Basic assignment allows the assignment of the rhs to the lhs using the rhs splat operator"
fails "Multiple assignments with splats * on the LHS has to be applied to any parameter"
end
2 changes: 1 addition & 1 deletion spec/rubyspec/language/variables_spec.rb
Original file line number Diff line number Diff line change
@@ -1364,4 +1364,4 @@ def handle.produce_bug
end
end

# language_version __FILE__, "variables"
language_version __FILE__, "variables"
2 changes: 1 addition & 1 deletion spec/rubyspec/language/versions/variables_1.9.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe "Multiple assignments with splats" do
it "* on the LHS has to be applied to any parameter" do
# a, *b, c = 1, 2, 3
a, *b, c = 1, 2, 3
a.should == 1
b.should == [2]
c.should == 3

0 comments on commit 0c2b8e7

Please sign in to comment.