lib/ebnf/ll1/scanner.rb in ebnf-0.3.5 vs lib/ebnf/ll1/scanner.rb in ebnf-0.3.6
- old
+ new
@@ -55,10 +55,26 @@
# @param [Regexp] pattern
def skip(pattern)
feed_me
super
end
-
+
+ ##
+ # Returns true if the scan pointer is at the end of the string
+ #
+ # @return [Boolean]
+ def eos?
+ feed_me
+ super
+ end
+
+ ##
+ # Set the scan pointer to the end of the string and clear matching data
+ def terminate
+ feed_me
+ super
+ end
+
##
# Tries to match with `pattern` at the current position.
#
# If there is a match, the scanner advances the "scan pointer" and returns the matched string.
# Otherwise, the scanner returns nil.
\ No newline at end of file