Skip to content

Commit

Permalink
. the addition of slices means less api change
Browse files Browse the repository at this point in the history
  • Loading branch information
kschiess committed Feb 21, 2011
1 parent a4f2053 commit b97c10f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/parslet/atoms/re.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Parslet::Atoms::Re < Parslet::Atoms::Base
def initialize(match) # :nodoc:
super()

@match = match
@match = match.to_s
@re = Regexp.new(match, Regexp::MULTILINE)
@error_msgs = {
:premature => "Premature end of input",
Expand Down
2 changes: 1 addition & 1 deletion lib/parslet/atoms/str.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Parslet::Atoms::Str < Parslet::Atoms::Base
def initialize(str)
super()

@str = str
@str = str.to_s
@error_msgs = {
:premature => "Premature end of input",
:failed => "Expected #{str.inspect}, but got "
Expand Down
4 changes: 2 additions & 2 deletions lib/parslet/expression/treetop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ class Transform < Parslet::Transform # :nodoc:
rule(:seq => sequence(:s)) { Parslet::Atoms::Sequence.new(*s) }
rule(:unwrap => simple(:u)) { u }
rule(:maybe => simple(:m)) { |d| d[:m].maybe }
rule(:string => simple(:s)) { Parslet::Atoms::Str.new(s.to_s) }
rule(:match => simple(:m)) { Parslet::Atoms::Re.new(m.to_s) }
rule(:string => simple(:s)) { Parslet::Atoms::Str.new(s) }
rule(:match => simple(:m)) { Parslet::Atoms::Re.new(m) }
rule(:any => simple(:a)) { Parslet::Atoms::Re.new('.') }
end

Expand Down
2 changes: 1 addition & 1 deletion spec/parslet/expression/treetop_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
it { should parse(input) }
context "string representation" do
subject { exp(parslet.to_s) }
it { should parse(input) }
it { should parse(input, :trace => true) }
end
end
end
Expand Down

0 comments on commit b97c10f

Please sign in to comment.