Sha256: 43fdc33e6a9243c60845e39378d82561e9db35789b76364547081c2b0c85b7d5
Contents?: true
Size: 674 Bytes
Versions: 8
Compression:
Stored size: 674 Bytes
Contents
class Parslet::Atoms::Base # Packages the common idiom # # begin # tree = parser.parse('something') # rescue Parslet::ParseFailed => error # puts parser.cause.ascii_tree # end # # into a convenient method. # # Usage: # # require 'parslet' # require 'parslet/convenience' # # class FooParser < Parslet::Parser # rule(:foo) { str('foo') } # root(:foo) # end # # FooParser.new.parse_with_debug('bar') # # @see Parslet::Atoms::Base#parse # def parse_with_debug str, opts={} parse str, opts rescue Parslet::ParseFailed => error puts error.cause.ascii_tree end end
Version data entries
8 entries across 8 versions & 2 rubygems