Sha256: fad3720467ef22c21f226f779a4236f8819fc889bd31ceb0257b3ae18a8e7a8f
Contents?: true
Size: 613 Bytes
Versions: 7
Compression:
Stored size: 613 Bytes
Contents
require 'spec_helper' describe "Unconsumed input:" do class RepeatingBlockParser < Parslet::Parser root :expressions rule(:expressions) { expression.repeat } rule(:expression) { str('(') >> aab >> str(')') } rule(:aab) { str('a').repeat(1) >> str('b') } end describe RepeatingBlockParser do let(:parser) { described_class.new } it "throws annotated error" do error = catch_failed_parse { parser.parse('(aaac)') } end it "doesn't error out if prefix is true" do expect { parser.parse('(aaac)', :prefix => true) }.not_to raise_error end end end
Version data entries
7 entries across 7 versions & 2 rubygems