class RubyParserStuff::RubyParser

RubyParser is a compound parser that first attempts to parse using the 1.9 syntax parser and falls back to the 1.8 syntax parser on a parse error.

Public Class Methods

new() click to toggle source
# File lib/ruby_parser_extras.rb, line 1282
def initialize
  @p18 = Ruby18Parser.new
  @p19 = Ruby19Parser.new
end

Public Instance Methods

parse(s, f = "(string)") click to toggle source
Alias for: process
process(s, f = "(string)") click to toggle source
# File lib/ruby_parser_extras.rb, line 1287
def process(s, f = "(string)") # parens for emacs *sigh*
  Ruby19Parser.new.process s, f
rescue Racc::ParseError
  Ruby18Parser.new.process s, f
end
Also aliased as: parse
reset() click to toggle source
# File lib/ruby_parser_extras.rb, line 1295
def reset
  @p18.reset
  @p19.reset
end