Sha256: fb5946dec45c569dc2f4ede3c2d4586a75a0cafefe0e256dfca38d8973a8ec7e

Contents?: true

Size: 277 Bytes

Versions: 6

Compression:

Stored size: 277 Bytes

Contents

require 'parser/current'
require 'rubycritic/analysers/helpers/ast_node'

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rubycritic-2.9.2 lib/rubycritic/analysers/helpers/parser.rb
rubycritic-2.9.1 lib/rubycritic/analysers/helpers/parser.rb
rubycritic-2.9.0 lib/rubycritic/analysers/helpers/parser.rb
rubycritic-2.8.0 lib/rubycritic/analysers/helpers/parser.rb
rubycritic-2.7.1 lib/rubycritic/analysers/helpers/parser.rb
rubycritic-2.7.0 lib/rubycritic/analysers/helpers/parser.rb