Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

19 lines (13 sloc) 0.315 kB
# A small example that shows a really small parser and what happens on parser
# errors.
$:.unshift '../lib'
require 'pp'
require 'parslet'
class MyParser < Parslet::Parser
rule(:a) { str('a').repeat }
def parse(str)
a.parse(str)
end
end
pp MyParser.new.parse('aaaa')
pp MyParser.new.parse('bbbb')
Jump to Line
Something went wrong with that request. Please try again.