Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

+

  • Loading branch information...
commit 174ddeb79042866dbaa4dafa3f364e192acd408c 1 parent 56bec38
@kschiess authored
Showing with 12 additions and 4 deletions.
  1. +12 −4 spec/parslet/atoms/transform_spec.rb
View
16 spec/parslet/atoms/transform_spec.rb
@@ -5,10 +5,6 @@
describe Parslet::Atoms::Transform do
include Parslet
- context "when used directly" do
- it "should transform all inputs onto itself"
- end
-
class ModifyAll < Parslet::Atoms::Transform; end
describe ModifyAll do
subject { ModifyAll.new }
@@ -60,6 +56,18 @@ def visit_alternative(parslets)
).should parse('foobar').as(:foo => 'foo', :bar => 'bar')
end
end
+ context "lookahead" do
+ class ModifyAll
+ def visit_lookahead(positive, parslet)
+ super(!positive, parslet)
+ end
+ end
+ it "should transform a positive lookahead into a negative lookahead" do
+ apply(
+ str('foo').absnt? >> str('foo')
+ ).should parse('oof')
+ end
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.