Permalink
Browse files

. improving some documentation

  • Loading branch information...
1 parent bc9126f commit c787cfadf7598d0de98f74975671085e6daaecc2 @kschiess committed May 24, 2012
Showing with 5 additions and 3 deletions.
  1. +2 −0 lib/parslet/atoms/base.rb
  2. +3 −3 lib/parslet/convenience.rb
@@ -17,6 +17,8 @@ class Parslet::Atoms::Base
# defaults to Parslet::ErrorReporter::Tree
# @option options [Boolean] :prefix Should a prefix match be accepted?
# (default: false)
+ # @return [Hash, Array, Parslet::Slice] PORO (Plain old Ruby object) result
+ # tree
#
def parse(io, options={})
source = io.respond_to?(:line_and_column) ?
@@ -1,13 +1,11 @@
class Parslet::Atoms::Base
- # TODO
# Packages the common idiom
#
# begin
# tree = parser.parse('something')
# rescue Parslet::ParseFailed => error
- # puts error
- # puts parser.error_tree
+ # puts parser.cause.ascii_tree
# end
#
# into a convenient method.
@@ -24,6 +22,8 @@ class Parslet::Atoms::Base
#
# FooParser.new.parse_with_debug('bar')
#
+ # @see Parslet::Atoms::Base#parse
+ #
def parse_with_debug str, opts={}
parse str, opts
rescue Parslet::UnconsumedInput => error

0 comments on commit c787cfa

Please sign in to comment.