# File lib/parslet/source.rb, line 10 def initialize(str) raise ArgumentError unless str.respond_to?(:to_str) @pos = 0 @str = str @line_cache = LineCache.new @line_cache.scan_for_line_endings(0, @str) end