module Puppet::Pops::Model

Private Class Methods

register_pcore_types() click to toggle source
     # File lib/puppet/pops/model/ast.rb
4568 def self.register_pcore_types
4569   return if @@pcore_ast_initialized
4570   @@pcore_ast_initialized = true
4571   all_types = [
4572   Parser::Locator::Locator19,
4573   Model::PopsObject,
4574   Model::Positioned,
4575   Model::Expression,
4576   Model::Nop,
4577   Model::BinaryExpression,
4578   Model::UnaryExpression,
4579   Model::ParenthesizedExpression,
4580   Model::NotExpression,
4581   Model::UnaryMinusExpression,
4582   Model::UnfoldExpression,
4583   Model::AssignmentExpression,
4584   Model::ArithmeticExpression,
4585   Model::RelationshipExpression,
4586   Model::AccessExpression,
4587   Model::ComparisonExpression,
4588   Model::MatchExpression,
4589   Model::InExpression,
4590   Model::BooleanExpression,
4591   Model::AndExpression,
4592   Model::OrExpression,
4593   Model::LiteralList,
4594   Model::KeyedEntry,
4595   Model::LiteralHash,
4596   Model::BlockExpression,
4597   Model::ApplyBlockExpression,
4598   Model::CaseOption,
4599   Model::CaseExpression,
4600   Model::QueryExpression,
4601   Model::ExportedQuery,
4602   Model::VirtualQuery,
4603   Model::AbstractAttributeOperation,
4604   Model::AttributeOperation,
4605   Model::AttributesOperation,
4606   Model::CollectExpression,
4607   Model::Parameter,
4608   Model::Definition,
4609   Model::NamedDefinition,
4610   Model::FunctionDefinition,
4611   Model::ResourceTypeDefinition,
4612   Model::QRefDefinition,
4613   Model::TypeAlias,
4614   Model::TypeMapping,
4615   Model::TypeDefinition,
4616   Model::NodeDefinition,
4617   Model::HeredocExpression,
4618   Model::HostClassDefinition,
4619   Model::PlanDefinition,
4620   Model::LambdaExpression,
4621   Model::ApplyExpression,
4622   Model::IfExpression,
4623   Model::UnlessExpression,
4624   Model::CallExpression,
4625   Model::CallFunctionExpression,
4626   Model::CallNamedFunctionExpression,
4627   Model::CallMethodExpression,
4628   Model::Literal,
4629   Model::LiteralValue,
4630   Model::LiteralRegularExpression,
4631   Model::LiteralString,
4632   Model::LiteralNumber,
4633   Model::LiteralInteger,
4634   Model::LiteralFloat,
4635   Model::LiteralUndef,
4636   Model::LiteralDefault,
4637   Model::LiteralBoolean,
4638   Model::TextExpression,
4639   Model::ConcatenatedString,
4640   Model::QualifiedName,
4641   Model::ReservedWord,
4642   Model::QualifiedReference,
4643   Model::VariableExpression,
4644   Model::EppExpression,
4645   Model::RenderStringExpression,
4646   Model::RenderExpression,
4647   Model::ResourceBody,
4648   Model::AbstractResource,
4649   Model::ResourceExpression,
4650   Model::ResourceDefaultsExpression,
4651   Model::ResourceOverrideExpression,
4652   Model::SelectorEntry,
4653   Model::SelectorExpression,
4654   Model::NamedAccessExpression,
4655   Model::Program]
4656 
4657   # Create and register a TypeSet that corresponds to all types in the AST model
4658   types_map = {}
4659   all_types.each do |type|
4660     types_map[type._pcore_type.simple_name] = type._pcore_type
4661   end
4662   type_set = Types::PTypeSetType.new({
4663     'name' => 'Puppet::AST',
4664     'pcore_version' => '1.0.0',
4665     'types' => types_map
4666   })
4667   loc = Puppet::Util.path_to_uri("#{__FILE__}")
4668   Loaders.static_loader.set_entry(Loader::TypedName.new(:type, 'puppet::ast', Pcore::RUNTIME_NAME_AUTHORITY), type_set, URI("#{loc}?line=1"))
4669   Loaders.register_static_implementations(all_types)
4670 end