Sha256: 92957e3e717f02bbf9d4e71d4f4b2d74592f1208bc6fe3c237e63be7f50c700f

Contents?: true

Size: 394 Bytes

Versions: 1

Compression:

Stored size: 394 Bytes

Contents

require 'ripper'
require 'ripper_ruby_parser/sexp_processor'

module RipperRubyParser
  # Main parser class. Brings together Ripper and our
  # RipperRubyParser::SexpProcessor.
  class Parser
    def initialize processor=SexpProcessor.new
      @processor = processor
    end

    def parse source
      exp = Sexp.from_array(Ripper.sexp source)
      @processor.process exp
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ripper_ruby_parser-0.0.1 lib/ripper_ruby_parser/parser.rb