Method: Puppet::Pal::Compiler#parse_file

Defined in:
lib/puppet/pal/compiler.rb

#parse_file(file) ⇒ Puppet::Pops::Model::Program

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parses and validates a puppet language file and returns an instance of Puppet::Pops::Model::Program on success. If the content is not valid an error is raised.

Parameters:

  • file (String)

    a file with puppet language content to parse and validate

Returns:



152
153
154
155
156
157
# File 'lib/puppet/pal/compiler.rb', line 152

def parse_file(file)
  unless file.is_a?(String)
    raise ArgumentError, _("The argument 'file' must be a String, got %{type}") % { type: file.class }
  end
  internal_evaluator.parse_file(file)
end