Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

. documentation

  • Loading branch information...
commit c52f45f1d870a8ff723819399001fccb20163328 1 parent 4f59c9e
@kschiess authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/parslet/source.rb
View
7 lib/parslet/source.rb
@@ -4,9 +4,7 @@
require 'parslet/source/line_cache'
module Parslet
- # Wraps the input IO to parslet. The interface defined by this class is
- # smaller than what IO offers, but enhances it with a #column and #line
- # method for the current position.
+ # Wraps the input string for parslet.
#
class Source
def initialize(str)
@@ -21,6 +19,9 @@ def initialize(str)
# Checks if the given pattern matches at the current input position.
#
+ # @param pattern [Regexp, String] pattern to check for
+ # @return [Boolean] true if the pattern matches at #pos
+ #
def matches?(pattern)
@str.index(pattern, @pos) == @pos
end
Please sign in to comment.
Something went wrong with that request. Please try again.