Sha256: c91c1f48f428b003427e5fecbbcbad32e2782525509b4e8de499f6bbbf52e542

Contents?: true

Size: 307 Bytes

Versions: 7

Compression:

Stored size: 307 Bytes

Contents

# frozen_string_literal: true
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

7 entries across 7 versions & 1 rubygems

Version Path
rubycritic-3.2.0 lib/rubycritic/analysers/helpers/parser.rb
rubycritic-3.1.3 lib/rubycritic/analysers/helpers/parser.rb
rubycritic-3.1.2 lib/rubycritic/analysers/helpers/parser.rb
rubycritic-3.1.1 lib/rubycritic/analysers/helpers/parser.rb
rubycritic-3.1.0 lib/rubycritic/analysers/helpers/parser.rb
rubycritic-3.0.0 lib/rubycritic/analysers/helpers/parser.rb
rubycritic-2.9.4 lib/rubycritic/analysers/helpers/parser.rb