Module: RubyCritic::Parser

Defined in:
lib/rubycritic/analysers/helpers/parser.rb

Class Method Summary collapse

Class Method Details

.parse(content) ⇒ Object



8
9
10
11
12
# File 'lib/rubycritic/analysers/helpers/parser.rb', line 8

def self.parse(content)
  ::Parser::CurrentRuby.parse(content) || AST::EmptyNode.new
rescue ::Parser::SyntaxError
  AST::EmptyNode.new
end