module Parser

@api public

Constants

CurrentRuby
MESSAGES

Diagnostic messages (errors, warnings and notices) that can be generated.

@see Diagnostic

@api public

VERSION

Public Class Methods

check_for_encoding_support() click to toggle source

Verify that the current Ruby implementation supports Encoding. @raise [RuntimeError]

# File lib/parser.rb, line 76
def self.check_for_encoding_support
  unless defined?(Encoding)
    raise RuntimeError, 'Parsing 1.9 and later versions of Ruby is not supported on 1.8 due to the lack of Encoding support'
  end
end

Private Class Methods

warn_syntax_deviation(feature, version) click to toggle source
# File lib/parser/current.rb, line 3
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}."
  warn "warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri."
end