Sha256: 99cc978ca22054e29442b8865419c00b05963ad59dcde63c2898e5f1bb58b41a

Contents?: true

Size: 886 Bytes

Versions: 20

Compression:

Stored size: 886 Bytes

Contents

# frozen_string_literal: true
module Puppet; end

module Puppet::Parser
  # The ParserFactory makes selection of parser possible.
  # Currently, it is possible to switch between two different parsers:
  # * classic_parser, the parser in 3.1
  # * eparser, the Expression Based Parser
  #
  class ParserFactory
    # Produces a parser instance for the given environment
    def self.parser
      evaluating_parser
    end

    # Creates an instance of an E4ParserAdapter that adapts an
    # EvaluatingParser to the 3x way of parsing.
    #
    def self.evaluating_parser
      unless defined?(Puppet::Parser::E4ParserAdapter)
        require_relative '../../puppet/parser/e4_parser_adapter'
        require_relative '../../puppet/pops/parser/code_merger'
      end
      E4ParserAdapter.new
    end

    def self.code_merger
      Puppet::Pops::Parser::CodeMerger.new
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
puppet-8.3.0 lib/puppet/parser/parser_factory.rb
puppet-8.3.0-x86-mingw32 lib/puppet/parser/parser_factory.rb
puppet-8.3.0-x64-mingw32 lib/puppet/parser/parser_factory.rb
puppet-8.3.0-universal-darwin lib/puppet/parser/parser_factory.rb
puppet-8.3.1 lib/puppet/parser/parser_factory.rb
puppet-8.3.1-x86-mingw32 lib/puppet/parser/parser_factory.rb
puppet-8.3.1-x64-mingw32 lib/puppet/parser/parser_factory.rb
puppet-8.3.1-universal-darwin lib/puppet/parser/parser_factory.rb
puppet-8.2.0 lib/puppet/parser/parser_factory.rb
puppet-8.2.0-x86-mingw32 lib/puppet/parser/parser_factory.rb
puppet-8.2.0-x64-mingw32 lib/puppet/parser/parser_factory.rb
puppet-8.2.0-universal-darwin lib/puppet/parser/parser_factory.rb
puppet-8.1.0 lib/puppet/parser/parser_factory.rb
puppet-8.1.0-x86-mingw32 lib/puppet/parser/parser_factory.rb
puppet-8.1.0-x64-mingw32 lib/puppet/parser/parser_factory.rb
puppet-8.1.0-universal-darwin lib/puppet/parser/parser_factory.rb
puppet-8.0.1 lib/puppet/parser/parser_factory.rb
puppet-8.0.1-x86-mingw32 lib/puppet/parser/parser_factory.rb
puppet-8.0.1-x64-mingw32 lib/puppet/parser/parser_factory.rb
puppet-8.0.1-universal-darwin lib/puppet/parser/parser_factory.rb