Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: opal/opal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6b95661127c7
Choose a base ref
...
head repository: opal/opal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4650c864578c
Choose a head ref
  • 3 commits
  • 4 files changed
  • 1 contributor

Commits on Nov 22, 2013

  1. Copy the full SHA
    5dee4b4 View commit details
  2. Copy the full SHA
    8332908 View commit details
  3. Copy the full SHA
    4650c86 View commit details
Showing with 10 additions and 10 deletions.
  1. +1 −1 lib/opal/parser/grammar.rb
  2. +1 −1 lib/opal/parser/grammar.y
  3. +4 −4 spec/opal/parser/class_spec.rb
  4. +4 −4 spec/opal/parser/module_spec.rb
2 changes: 1 addition & 1 deletion lib/opal/parser/grammar.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/opal/parser/grammar.y
Original file line number Diff line number Diff line change
@@ -1410,7 +1410,7 @@ xstring_contents: none

backref: tNTH_REF
{
result = s(:nth_ref, val[0])
result = s(:nth_ref, value(val[0]))
}
| tBACK_REF

8 changes: 4 additions & 4 deletions spec/opal/parser/class_spec.rb
Original file line number Diff line number Diff line change
@@ -2,15 +2,15 @@

describe "The class keyword" do
it "returns an empty s(:block) when given an empty body" do
opal_parse('class A; end').should == [:class, :A, nil, [:block]]
opal_parse('class A; end').should == [:class, [:const, :A], nil, [:block]]
end

it "does not place single expressions into a s(:block)" do
opal_parse('class A; 1; end').should == [:class, :A, nil, [:int, 1]]
opal_parse('class A; 1; end').should == [:class, [:const, :A], nil, [:int, 1]]
end

it "adds multiple body expressions into a s(:block)" do
opal_parse('class A; 1; 2; end').should == [:class, :A, nil, [:block, [:int, 1], [:int, 2]]]
opal_parse('class A; 1; 2; end').should == [:class, [:const, :A], nil, [:block, [:int, 1], [:int, 2]]]
end

it "uses nil as a placeholder when no superclass is given" do
@@ -22,7 +22,7 @@
end

it "should accept just a constant for the class name" do
opal_parse('class A; end')[1].should == :A
opal_parse('class A; end')[1].should == [:const, :A]
end

it "should accept a prefix constant for the class name" do
8 changes: 4 additions & 4 deletions spec/opal/parser/module_spec.rb
Original file line number Diff line number Diff line change
@@ -2,19 +2,19 @@

describe "The module keyword" do
it "returns an empty s(:block) when given an empty body" do
opal_parse('module A; end').should == [:module, :A, [:block]]
opal_parse('module A; end').should == [:module, [:const, :A], [:block]]
end

it "does not place single expressions into a s(:block)" do
opal_parse('module A; 1; end').should == [:module, :A, [:int, 1]]
opal_parse('module A; 1; end').should == [:module, [:const, :A], [:int, 1]]
end

it "adds multiple body expressions into a s(:block)" do
opal_parse('module A; 1; 2; end').should == [:module, :A, [:block, [:int, 1], [:int, 2]]]
opal_parse('module A; 1; 2; end').should == [:module, [:const, :A], [:block, [:int, 1], [:int, 2]]]
end

it "should accept just a constant for the module name" do
opal_parse('module A; end')[1].should == :A
opal_parse('module A; end')[1].should == [:const, :A]
end

it "should accept a prefix constant for the module name" do