Class: SyntaxSuggest::GetParseErrors

Inherits:
Object
  • Object
show all
Defined in:
lib/syntax_suggest/explain_syntax.rb

Class Method Summary collapse

Class Method Details

.errors(source) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/syntax_suggest/explain_syntax.rb', line 11

def self.errors(source)
  if SyntaxSuggest.use_prism_parser?
    Prism.parse(source).errors.map(&:message)
  else
    RipperErrors.new(source).call.errors
  end
end