Browse files

. Making sdoc useful

  • Loading branch information...
1 parent d97b326 commit 6b5c33a2da95e7d43644e6af3c74f02a11f86596 @kschiess committed Mar 2, 2011
Showing with 15 additions and 2 deletions.
  1. +2 −0 lib/parslet/atoms/base.rb
  2. +11 −0 lib/parslet/atoms/dsl.rb
  3. +1 −1 lib/parslet/slice.rb
  4. +1 −1 lib/parslet/source/line_cache.rb
View
2 lib/parslet/atoms/base.rb
@@ -1,6 +1,8 @@
# Base class for all parslets, handles orchestration of calls and implements
# a lot of the operator and chaining methods.
#
+# Also see Parslet::Atoms::DSL chaining parslet atoms together.
+#
class Parslet::Atoms::Base
include Parslet::Atoms::Precedence
include Parslet::Atoms::DSL
View
11 lib/parslet/atoms/dsl.rb
@@ -1,3 +1,14 @@
+
+# A mixin module that defines operations that can be called on any subclass
+# of Parslet::Atoms::Base. These operations make parslets atoms chainable and
+# allow combination of parslet atoms to form bigger parsers.
+#
+# Example:
+#
+# str('foo') >> str('bar')
+# str('f').repeat
+# any.absent? # also called The Epsilon
+#
module Parslet::Atoms::DSL
# Construct a new atom that repeats the current atom min times at least and
# at most max times. max can be nil to indicate that no maximum is present.
View
2 lib/parslet/slice.rb
@@ -166,7 +166,7 @@ def inspect
end
# Raised when trying to do an operation on slices that cannot succeed, like
-# adding non-adjacent slices.
+# adding non-adjacent slices. See Parslet::Slice.
#
class Parslet::InvalidSliceOperation < StandardError
end
View
2 lib/parslet/source/line_cache.rb
@@ -59,7 +59,7 @@ def scan_for_line_endings(start_pos, buf)
# [10, 20, 30]
# # would describe [0, 10], (10, 20], (20, 30]
#
- module RangeSearch
+ module RangeSearch # :nodoc:
# Scans the array for the first number that is > than bound. Returns the
# index of that number.
#

0 comments on commit 6b5c33a

Please sign in to comment.