Sha256: e0c7f4fbb055de070b24ead1cf73c0b7c0358d58e8d0af9f60f9ba8e58483511

Contents?: true

Size: 825 Bytes

Versions: 29

Compression:

Stored size: 825 Bytes

Contents

module Parser
  class << self
    def warn_syntax_deviation(feature, version)
      warn "warning: parser/current is loading #{feature}, which recognizes"
      warn "warning: #{version}-compliant syntax, but you are running #{RUBY_VERSION}."
    end
    private :warn_syntax_deviation
  end

  case RUBY_VERSION
  when /^1\.8\./
    if RUBY_VERSION != '1.8.7'
      warn_syntax_deviation 'parser/ruby18', '1.8.7'
    end

    require 'parser/ruby18'
    CurrentRuby = Ruby18

  when /^1\.9\./
    if RUBY_VERSION != '1.9.3'
      warn_syntax_deviation 'parser/ruby19', '1.9.3'
    end

    require 'parser/ruby19'
    CurrentRuby = Ruby19

  when /^2\.0\./
    require 'parser/ruby20'
    CurrentRuby = Ruby20

  else # :nocov:
    raise NotImplementedError, "Parser does not support parsing Ruby #{RUBY_VERSION}"
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
parser-2.0.0 lib/parser/current.rb
parser-2.0.0.pre8 lib/parser/current.rb
parser-2.0.0.pre7 lib/parser/current.rb
parser-2.0.0.pre6 lib/parser/current.rb
parser-2.0.0.pre5 lib/parser/current.rb
parser-2.0.0.pre4 lib/parser/current.rb
parser-2.0.0.pre3 lib/parser/current.rb
parser-2.0.0.pre2 lib/parser/current.rb
parser-2.0.0.pre1 lib/parser/current.rb
parser-2.0.0.beta10 lib/parser/current.rb
parser-2.0.0.beta9 lib/parser/current.rb
parser-1.4.2 lib/parser/current.rb
parser-2.0.0.beta8 lib/parser/current.rb
parser-2.0.0.beta7 lib/parser/current.rb
parser-2.0.0.beta6 lib/parser/current.rb
parser-2.0.0.beta5 lib/parser/current.rb
parser-2.0.0.beta4 lib/parser/current.rb
parser-1.4.1 lib/parser/current.rb
parser-2.0.0.beta3 lib/parser/current.rb
parser-2.0.0.beta2 lib/parser/current.rb