# File lib/fluent/config/basic_parser.rb, line 64 def eof? @ss.eos? end
# File lib/fluent/config/basic_parser.rb, line 84 def error_sample pos = @ss.pos lines = @ss.string.lines.to_a lines.each_with_index { |line, ln| if line.size >= pos msgs = ["line #{ln + 1},#{pos}\n"] if ln > 0 last_line = lines[ln - 1] msgs << "%3s: %s" % [ln, last_line] end msgs << "%3s: %s" % [ln + 1, line] msgs << "\n #{'-' * pos}^\n" if next_line = lines[ln + 1] msgs << "%3s: %s" % [ln + 2, next_line] end return msgs.join end pos -= line.size last_line = line } end
# File lib/fluent/config/basic_parser.rb, line 60 def getch @ss.getch end
# File lib/fluent/config/basic_parser.rb, line 72 def line_end skip(LINE_END) end
# File lib/fluent/config/basic_parser.rb, line 80 def parse_error!(message) raise ConfigParseError, "#{message} at #{error_sample}" end
# File lib/fluent/config/basic_parser.rb, line 68 def prev_match @ss[0] end
# File lib/fluent/config/basic_parser.rb, line 56 def scan(pattern) @ss.scan(pattern) end
Generated with the Darkfish Rdoc Generator 2.