diff options
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r-- | lib/puppet/parser/ast/classdef.rb | 8 | ||||
-rw-r--r-- | lib/puppet/parser/ast/compdef.rb | 22 | ||||
-rw-r--r-- | lib/puppet/parser/ast/component.rb | 5 | ||||
-rw-r--r-- | lib/puppet/parser/ast/objectdef.rb | 12 | ||||
-rw-r--r-- | lib/puppet/parser/grammar.ra | 27 | ||||
-rw-r--r-- | lib/puppet/parser/parser.rb | 447 |
6 files changed, 267 insertions, 254 deletions
diff --git a/lib/puppet/parser/ast/classdef.rb b/lib/puppet/parser/ast/classdef.rb index cb66b3a8a..336cf0189 100644 --- a/lib/puppet/parser/ast/classdef.rb +++ b/lib/puppet/parser/ast/classdef.rb @@ -5,6 +5,8 @@ class Puppet::Parser::AST # but classes are always singletons -- only one can exist on a given # host. class ClassDef < AST::CompDef + @keyword = "class" + def self.genclass AST::HostClass end @@ -55,12 +57,6 @@ class Puppet::Parser::AST end end - def initialize(hash) - @parentclass = nil - @keyword = "class" - super - end - def tree(indent = 0) #@args.tree(indent + 1), return [ diff --git a/lib/puppet/parser/ast/compdef.rb b/lib/puppet/parser/ast/compdef.rb index 696e178e1..b6cd6491f 100644 --- a/lib/puppet/parser/ast/compdef.rb +++ b/lib/puppet/parser/ast/compdef.rb @@ -9,7 +9,15 @@ class Puppet::Parser::AST # encounter an error if the component is instantiated more than # once. class CompDef < AST::Branch - attr_accessor :type, :args, :code, :keyword, :scope, :parentclass + attr_accessor :type, :args, :code, :scope, :parentclass + attr_writer :keyword + + @keyword = "define" + + class << self + attr_reader :keyword + end + def self.genclass AST::Component @@ -33,6 +41,7 @@ class Puppet::Parser::AST arghash[:parentclass] = @parentclass.safeevaluate(:scope => scope) end + begin comp = self.class.genclass.new(arghash) comp.keyword = self.keyword @@ -53,9 +62,6 @@ class Puppet::Parser::AST def initialize(hash) @parentclass = nil @args = nil - - # Set a default keyword - @keyword = "define" super #if @parentclass @@ -66,6 +72,14 @@ class Puppet::Parser::AST #Puppet.debug "Defining type %s" % @type.value end + def keyword + if defined? @keyword + @keyword + else + self.class.keyword + end + end + def tree(indent = 0) return [ @type.tree(indent + 1), diff --git a/lib/puppet/parser/ast/component.rb b/lib/puppet/parser/ast/component.rb index 4d930f6a5..2621c76ad 100644 --- a/lib/puppet/parser/ast/component.rb +++ b/lib/puppet/parser/ast/component.rb @@ -16,7 +16,6 @@ class Puppet::Parser::AST # These are retrieved when looking up the superclass attr_accessor :name, :arguments - #def evaluate(scope,hash,objtype,objname) def evaluate(hash) origscope = hash[:scope] objtype = hash[:type] @@ -108,9 +107,9 @@ class Puppet::Parser::AST end # Now just evaluate the code with our new bindings. - scope.inside(self) do + #scope.inside(self) do # part of definition inheritance self.code.safeevaluate(:scope => scope) - end + #end # If we're being evaluated as a parent class, we want to return the # scope, so it can be overridden and such, but if not, we want to diff --git a/lib/puppet/parser/ast/objectdef.rb b/lib/puppet/parser/ast/objectdef.rb index 63577b60d..cdcbd1aca 100644 --- a/lib/puppet/parser/ast/objectdef.rb +++ b/lib/puppet/parser/ast/objectdef.rb @@ -33,12 +33,13 @@ class Puppet::Parser::AST # Get our type and name. objtype = @type.safeevaluate(:scope => scope) - if objtype == "super" - objtype = supertype() - @subtype = true - else + # Disable definition inheritance, for now. 8/27/06, luke + #if objtype == "super" + # objtype = supertype() + # @subtype = true + #else @subtype = false - end + #end # If the type was a variable, we wouldn't have typechecked yet. # Do it now, if so. @@ -70,6 +71,7 @@ class Puppet::Parser::AST } # Now collect info from our parent. + parentname = nil if @subtype parentname = supersetup(hash) end diff --git a/lib/puppet/parser/grammar.ra b/lib/puppet/parser/grammar.ra index 673c41a9f..535bf6e56 100644 --- a/lib/puppet/parser/grammar.ra +++ b/lib/puppet/parser/grammar.ra @@ -15,9 +15,11 @@ token NAME SEMIC CASE DEFAULT AT LCOLLECT RCOLLECT rule program: statements { + # Make sure we always return an array. if val[0].is_a?(AST::ASTArray) result = val[0] else + result = aryfy(val[0]) end } | nothing @@ -393,6 +395,7 @@ import: IMPORT quotedtext { next end # push the results into the main result array + # We always return an array when we parse. parser.parse.each do |child| result.push child end @@ -400,23 +403,24 @@ import: IMPORT quotedtext { } } -definition: DEFINE NAME argumentlist parent LBRACE statements RBRACE { +# Disable definition inheritance for now. 8/27/06, luke +#definition: DEFINE NAME argumentlist parent LBRACE statements RBRACE { +definition: DEFINE NAME argumentlist LBRACE statements RBRACE { args = { :type => ast(AST::Name, :value => val[1]), :args => val[2], - :keyword => val[0], - :code => val[5] + :code => val[4] # Switch to 5 for parents } if val[3].instance_of?(AST::Name) args[:parentclass] = val[3] end result = ast AST::CompDef, args -} | DEFINE NAME argumentlist parent LBRACE RBRACE { +#} | DEFINE NAME argumentlist parent LBRACE RBRACE { +} | DEFINE NAME argumentlist LBRACE RBRACE { args = { :type => ast(AST::Name, :value => val[1]), :args => val[2], - :keyword => val[0], :code => ast(AST::ASTArray) } @@ -424,7 +428,7 @@ definition: DEFINE NAME argumentlist parent LBRACE statements RBRACE { args[:parentclass] = val[3] end - result = ast AST::CompDef,args + result = ast AST::CompDef, args } #hostclass: CLASS NAME argumentlist parent LBRACE statements RBRACE { @@ -432,7 +436,6 @@ hostclass: CLASS NAME parent LBRACE statements RBRACE { #:args => val[2], args = { :type => ast(AST::Name, :value => val[1]), - :keyword => val[0], :code => val[4] } # It'll be an ASTArray if we didn't get a parent @@ -443,7 +446,6 @@ hostclass: CLASS NAME parent LBRACE statements RBRACE { } | CLASS NAME parent LBRACE RBRACE { args = { :type => ast(AST::Name, :value => val[1]), - :keyword => val[0], :code => ast(AST::ASTArray, :children => []) } # It'll be an ASTArray if we didn't get a parent @@ -462,7 +464,6 @@ nodedef: NODE hostnames parent LBRACE statements RBRACE { end args = { :names => val[1], - :keyword => val[0], :code => val[4] } if val[2].instance_of?(AST::Name) @@ -477,7 +478,6 @@ nodedef: NODE hostnames parent LBRACE statements RBRACE { :children => [val[1]] end args = { - :keyword => val[0], :names => val[1], :code => ast(AST::ASTArray, :children => []) } @@ -533,14 +533,14 @@ arguments: argument } argument: name EQUALS rvalue { - msg = "Deprecation notice: Variables must now include '$' in prototypes" + msg = "Deprecation notice: #{val[0].value} must now include '$' in prototype" msg += " at line %s" % @lexer.line msg += " in file %s" % @lexer.file if @lexer.file Puppet.warning msg result = ast AST::CompArgument, :children => [val[0],val[2]] } | name { - msg = "Deprecation notice: Variables must now include '$' in prototypes" + msg = "Deprecation notice: #{val[0].value} must now include '$' in prototype" msg += " at line %s" % @lexer.line msg += " in file %s" % @lexer.file if @lexer.file Puppet.warning msg @@ -621,7 +621,8 @@ end # Create an AST object, and automatically add the file and line information if # available. -def ast(klass, hash = {}) +def ast(klass, hash = nil) + hash ||= {} unless hash[:line] hash[:line] = @lexer.line end diff --git a/lib/puppet/parser/parser.rb b/lib/puppet/parser/parser.rb index e7ae6f85d..81f2aae8a 100644 --- a/lib/puppet/parser/parser.rb +++ b/lib/puppet/parser/parser.rb @@ -29,7 +29,7 @@ module Puppet class Parser < Racc::Parser -module_eval <<'..end grammar.ra modeval..idbd33cf53a5', 'grammar.ra', 603 +module_eval <<'..end grammar.ra modeval..id19f016e436', 'grammar.ra', 603 require 'puppet/parser/functions' attr_reader :file @@ -51,7 +51,8 @@ end # Create an AST object, and automatically add the file and line information if # available. -def ast(klass, hash = {}) +def ast(klass, hash = nil) + hash ||= {} unless hash[:line] hash[:line] = @lexer.line end @@ -174,7 +175,7 @@ end # $Id$ -..end grammar.ra modeval..idbd33cf53a5 +..end grammar.ra modeval..id19f016e436 ##### racc 1.4.5 generates ### @@ -266,8 +267,8 @@ racc_reduce_table = [ 1, 85, :_reduce_none, 1, 85, :_reduce_85, 2, 54, :_reduce_86, - 7, 56, :_reduce_87, - 6, 56, :_reduce_88, + 6, 56, :_reduce_87, + 5, 56, :_reduce_88, 6, 57, :_reduce_89, 5, 57, :_reduce_90, 6, 58, :_reduce_91, @@ -300,50 +301,50 @@ racc_reduce_table = [ racc_reduce_n = 118 -racc_shift_n = 198 +racc_shift_n = 197 racc_action_table = [ - 48, 36, 38, 64, 162, 20, 48, 36, 38, 75, - -84, 161, 48, 36, 38, 81, 20, 36, 38, 145, - 36, 38, 20, 37, 37, -79, 36, 38, 20, 44, - 86, -82, 72, 49, 53, 44, 31, 55, 65, 49, - 53, 44, 31, 55, 113, 49, 53, -79, 44, 55, - 48, 36, 38, 37, 44, 85, 48, 36, 38, 37, - -81, 137, 48, 36, 38, 79, 20, 72, 29, 79, - 169, 33, 20, -80, 29, 146, 154, 33, 20, 44, - 115, 170, 102, 49, 53, 44, 149, 55, 77, 49, - 53, 44, 88, 55, -81, 49, 53, 36, 38, 55, + 48, 36, 38, 81, 162, 20, 48, 36, 38, 64, + 79, 161, 48, 36, 38, 86, 20, 36, 38, 75, + 36, 38, 20, 37, -79, 145, 36, 38, 20, 44, + 37, -82, -79, 49, 53, 44, 31, 55, 31, 49, + 53, 44, 72, 55, 65, 49, 53, -81, 44, 55, + 48, 36, 38, 37, 44, 145, 48, 36, 38, 37, + 37, 137, 48, 36, 38, 113, 20, 139, 29, 79, + 29, 33, 20, 33, -80, 79, 85, 170, 20, 44, + 154, 146, 102, 49, 53, 44, 115, 55, 171, 49, + 53, 44, 149, 55, 77, 49, 53, 36, 38, 55, 48, 36, 38, 36, 38, 116, 48, 36, 38, 117, - 118, 87, 48, 36, 38, 112, 20, 155, 145, -82, - 45, 158, 20, 37, 178, 44, 117, 118, 20, 44, + 118, 88, 48, 36, 38, 179, 20, 117, 118, -81, + 45, 87, 20, 112, 155, 44, -82, 158, 20, 44, 37, 44, 105, 49, 53, 44, 37, 55, 64, 49, - 53, 44, 163, 55, 77, 49, 93, 85, 84, 55, - 48, 36, 38, 167, 168, 72, 48, 36, 38, 171, - 172, -80, 48, 36, 38, -83, 20, 177, 108, 136, - 181, 79, 20, 36, 38, 112, 77, 109, 20, 44, - 71, 70, 69, 49, 53, 44, 190, 55, 20, 49, - 53, 44, 113, 55, 66, 49, 53, 36, 38, 55, - 125, 44, 112, 36, 38, 49, 53, 35, 28, 55, - 166, nil, 20, 36, 38, nil, nil, nil, 20, 36, - 38, nil, nil, nil, nil, 44, nil, nil, 20, 49, - 53, 44, nil, 55, 20, 49, 53, nil, nil, 55, - nil, 44, nil, nil, nil, 49, 53, 44, nil, 55, - nil, 49, 53, 36, 38, 55, nil, 160, nil, nil, - nil, nil, nil, nil, nil, nil, nil, nil, 20, 175, + 53, 44, 163, 55, 77, 49, 53, 85, 84, 55, + 48, 36, 38, -80, 169, 72, 48, 36, 38, 172, + 173, -83, 48, 36, 38, -84, 20, 178, 108, 136, + 182, 77, 20, 36, 38, 112, 71, 160, 20, 44, + 109, 70, 69, 49, 53, 44, 113, 55, 20, 49, + 53, 44, 190, 55, 66, 49, 93, 36, 38, 55, + 112, 44, 35, 28, 166, 49, 53, 36, 38, 55, + 125, nil, 20, 36, 38, nil, nil, nil, nil, 36, + 38, nil, 20, nil, nil, 44, nil, nil, 20, 49, + 53, nil, nil, 55, 20, 44, nil, nil, nil, 49, + 53, 44, nil, 55, nil, 49, 53, 44, nil, 55, + nil, 49, 53, 36, 38, 55, nil, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, nil, 20, 176, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - 20, 44, nil, nil, 174, 49, 53, nil, 12, 55, - 16, 19, nil, 24, 26, 20, 3, nil, 9, 185, + 20, 44, nil, nil, 168, 49, 53, nil, 12, 55, + 16, 19, nil, 24, 26, 20, 3, nil, 9, 175, 14, nil, 21, 12, nil, 16, 19, nil, 24, 26, - 20, 3, nil, 9, 197, 14, nil, 21, 12, nil, + 20, 3, nil, 9, 196, 14, nil, 21, 12, nil, 16, 19, nil, 24, 26, 20, 3, nil, 9, 153, 14, nil, 21, 12, nil, 16, 19, nil, 24, 26, - 20, 3, nil, 9, 189, 14, nil, 21, 12, nil, - 16, 19, nil, 24, 26, 20, 3, nil, 9, 193, + 20, 3, nil, 9, 185, 14, nil, 21, 12, nil, + 16, 19, nil, 24, 26, 20, 3, nil, 9, 189, 14, nil, 21, 12, nil, 16, 19, nil, 24, 26, - 20, 3, nil, 9, 196, 14, nil, 21, 12, nil, + 20, 3, nil, 9, 195, 14, nil, 21, 12, nil, 16, 19, nil, 24, 26, 20, 3, nil, 9, 148, 14, nil, 21, 12, nil, 16, 19, nil, 24, 26, - 20, 3, nil, 9, 194, 14, nil, 21, 12, nil, + 20, 3, nil, 9, 193, 14, nil, 21, 12, nil, 16, 19, nil, 24, 26, 20, 3, nil, 9, nil, 14, nil, 21, 12, nil, 16, 19, nil, 24, 26, 20, 3, nil, 9, nil, 14, nil, 21, 12, nil, @@ -355,50 +356,50 @@ racc_action_table = [ nil, 3, nil, 9, nil, 14, nil, 21 ] racc_action_check = [ - 158, 158, 158, 17, 133, 21, 86, 86, 86, 30, - 46, 133, 48, 48, 48, 48, 158, 16, 16, 169, - 79, 79, 86, 21, 169, 98, 45, 45, 48, 158, - 57, 99, 30, 158, 158, 86, 3, 158, 17, 86, - 86, 48, 75, 86, 93, 48, 48, 57, 79, 48, - 69, 69, 69, 79, 45, 93, 137, 137, 137, 45, - 100, 101, 171, 171, 171, 121, 69, 103, 3, 80, - 141, 3, 137, 92, 75, 107, 121, 75, 171, 69, - 80, 141, 65, 69, 69, 137, 111, 69, 112, 137, - 137, 171, 62, 137, 61, 171, 171, 85, 85, 171, + 48, 48, 48, 48, 133, 21, 86, 86, 86, 17, + 39, 133, 137, 137, 137, 57, 48, 16, 16, 30, + 79, 79, 86, 21, 98, 170, 45, 45, 137, 48, + 170, 99, 57, 48, 48, 86, 3, 48, 75, 86, + 86, 137, 30, 86, 17, 137, 137, 100, 79, 137, + 69, 69, 69, 79, 45, 105, 119, 119, 119, 45, + 105, 101, 172, 172, 172, 93, 69, 103, 3, 121, + 75, 3, 119, 75, 92, 80, 93, 141, 172, 69, + 121, 107, 65, 69, 69, 119, 80, 69, 141, 119, + 119, 172, 111, 119, 112, 172, 172, 85, 85, 172, 12, 12, 12, 9, 9, 83, 14, 14, 14, 83, - 83, 60, 64, 64, 64, 90, 12, 122, 105, 59, - 9, 128, 14, 105, 156, 85, 156, 156, 64, 12, + 83, 62, 113, 113, 113, 156, 12, 156, 156, 61, + 9, 60, 14, 90, 122, 85, 59, 128, 113, 12, 85, 9, 66, 12, 12, 14, 9, 12, 68, 14, - 14, 64, 135, 14, 136, 64, 64, 53, 52, 64, - 172, 172, 172, 139, 140, 70, 119, 119, 119, 142, - 144, 51, 113, 113, 113, 50, 172, 153, 72, 95, - 161, 39, 119, 179, 179, 164, 35, 74, 113, 172, - 28, 26, 24, 172, 172, 119, 177, 172, 179, 119, - 119, 113, 77, 119, 19, 113, 113, 87, 87, 113, - 87, 179, 76, 88, 88, 179, 179, 6, 2, 179, - 138, nil, 87, 125, 125, nil, nil, nil, 88, 162, - 162, nil, nil, nil, nil, 87, nil, nil, 125, 87, - 87, 88, nil, 87, 162, 88, 88, nil, nil, 88, - nil, 125, nil, nil, nil, 125, 125, 162, nil, 125, - nil, 162, 162, 131, 131, 162, nil, 131, nil, nil, - nil, nil, nil, nil, nil, nil, nil, nil, 131, 147, + 14, 113, 135, 14, 136, 113, 113, 53, 52, 113, + 173, 173, 173, 51, 140, 70, 158, 158, 158, 142, + 144, 50, 64, 64, 64, 46, 173, 153, 72, 95, + 161, 35, 158, 131, 131, 164, 28, 131, 64, 173, + 74, 26, 24, 173, 173, 158, 77, 173, 131, 158, + 158, 64, 178, 158, 19, 64, 64, 88, 88, 64, + 76, 131, 6, 2, 138, 131, 131, 87, 87, 131, + 87, nil, 88, 125, 125, nil, nil, nil, nil, 162, + 162, nil, 87, nil, nil, 88, nil, nil, 125, 88, + 88, nil, nil, 88, 162, 87, nil, nil, nil, 87, + 87, 125, nil, 87, nil, 125, 125, 162, nil, 125, + nil, 162, 162, 180, 180, 162, nil, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, nil, 180, 147, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - 147, 131, nil, nil, 146, 131, 131, nil, 147, 131, - 147, 147, nil, 147, 147, 146, 147, nil, 147, 167, - 147, nil, 147, 146, nil, 146, 146, nil, 146, 146, - 167, 146, nil, 146, 195, 146, nil, 146, 167, nil, - 167, 167, nil, 167, 167, 195, 167, nil, 167, 120, - 167, nil, 167, 195, nil, 195, 195, nil, 195, 195, - 120, 195, nil, 195, 173, 195, nil, 195, 120, nil, - 120, 120, nil, 120, 120, 173, 120, nil, 120, 181, - 120, nil, 120, 173, nil, 173, 173, nil, 173, 173, - 181, 173, nil, 173, 192, 173, nil, 173, 181, nil, - 181, 181, nil, 181, 181, 192, 181, nil, 181, 109, - 181, nil, 181, 192, nil, 192, 192, nil, 192, 192, - 109, 192, nil, 192, 184, 192, nil, 192, 109, nil, - 109, 109, nil, 109, 109, 184, 109, nil, 109, nil, - 109, nil, 109, 184, nil, 184, 184, nil, 184, 184, - 84, 184, nil, 184, nil, 184, nil, 184, 84, nil, + 147, 180, nil, nil, 139, 180, 180, nil, 147, 180, + 147, 147, nil, 147, 147, 139, 147, nil, 147, 146, + 147, nil, 147, 139, nil, 139, 139, nil, 139, 139, + 146, 139, nil, 139, 194, 139, nil, 139, 146, nil, + 146, 146, nil, 146, 146, 194, 146, nil, 146, 120, + 146, nil, 146, 194, nil, 194, 194, nil, 194, 194, + 120, 194, nil, 194, 167, 194, nil, 194, 120, nil, + 120, 120, nil, 120, 120, 167, 120, nil, 120, 174, + 120, nil, 120, 167, nil, 167, 167, nil, 167, 167, + 174, 167, nil, 167, 192, 167, nil, 167, 174, nil, + 174, 174, nil, 174, 174, 192, 174, nil, 174, 109, + 174, nil, 174, 192, nil, 192, 192, nil, 192, 192, + 109, 192, nil, 192, 182, 192, nil, 192, 109, nil, + 109, 109, nil, 109, 109, 182, 109, nil, 109, nil, + 109, nil, 109, 182, nil, 182, 182, nil, 182, 182, + 84, 182, nil, 182, nil, 182, nil, 182, 84, nil, 84, 84, nil, 84, 84, 190, 84, nil, 84, nil, 84, nil, 84, 190, nil, 190, 190, nil, 190, 190, 5, 190, nil, 190, nil, 190, nil, 190, 5, nil, @@ -407,26 +408,26 @@ racc_action_check = [ nil, 0, nil, 0, nil, 0, nil, 0 ] racc_action_pointer = [ - 457, nil, 208, 32, nil, 442, 201, nil, nil, 100, - nil, nil, 98, nil, 104, nil, 14, -3, nil, 158, - nil, -13, nil, nil, 169, nil, 145, nil, 180, nil, - -1, nil, nil, nil, nil, 140, nil, nil, nil, 161, - nil, nil, nil, nil, nil, 23, -9, nil, 10, nil, - 146, 142, 142, 127, nil, nil, nil, 28, nil, 100, - 92, 75, 86, nil, 110, 40, 112, nil, 132, 48, - 122, nil, 132, nil, 171, 38, 192, 183, nil, 17, - 59, nil, nil, 100, 412, 94, 4, 194, 200, nil, - 105, nil, 54, 35, nil, 152, nil, nil, 6, 12, - 41, 24, nil, 34, nil, 87, nil, 69, nil, 382, - nil, 79, 52, 160, nil, nil, nil, nil, nil, 154, - 322, 55, 112, nil, nil, 210, nil, nil, 112, nil, - nil, 250, nil, -6, nil, 135, 108, 54, 203, 147, - 133, 60, 146, nil, 147, nil, 277, 262, nil, nil, - nil, nil, nil, 140, nil, nil, 117, nil, -2, nil, - nil, 164, 216, nil, 165, nil, nil, 292, nil, -12, - nil, 60, 148, 337, nil, nil, nil, 180, nil, 170, - nil, 352, nil, nil, 397, nil, nil, nil, nil, nil, - 427, nil, 367, nil, nil, 307, nil, nil ] + 457, nil, 203, 32, nil, 442, 196, nil, nil, 100, + nil, nil, 98, nil, 104, nil, 14, 3, nil, 158, + nil, -13, nil, nil, 169, nil, 145, nil, 176, nil, + 9, nil, nil, nil, nil, 135, nil, nil, nil, 0, + nil, nil, nil, nil, nil, 23, 146, nil, -2, nil, + 142, 134, 142, 127, nil, nil, nil, 13, nil, 107, + 102, 100, 105, nil, 160, 40, 112, nil, 132, 48, + 122, nil, 132, nil, 174, 34, 190, 177, nil, 17, + 65, nil, nil, 100, 412, 94, 4, 204, 194, nil, + 113, nil, 55, 56, nil, 152, nil, nil, 5, 12, + 28, 24, nil, 61, nil, 24, nil, 75, nil, 382, + nil, 85, 58, 110, nil, nil, nil, nil, nil, 54, + 322, 59, 119, nil, nil, 210, nil, nil, 118, nil, + nil, 170, nil, -6, nil, 135, 108, 10, 197, 277, + 133, 67, 146, nil, 147, nil, 292, 262, nil, nil, + nil, nil, nil, 140, nil, nil, 108, nil, 154, nil, + nil, 164, 216, nil, 165, nil, nil, 337, nil, nil, + -6, nil, 60, 148, 352, nil, nil, nil, 186, nil, + 250, nil, 397, nil, nil, nil, nil, nil, nil, nil, + 427, nil, 367, nil, 307, nil, nil ] racc_action_default = [ -98, -12, -118, -118, -13, -1, -118, -14, -2, -33, @@ -436,91 +437,93 @@ racc_action_default = [ -18, -20, -21, -22, -110, -118, -51, -55, -118, -60, -56, -50, -118, -33, -52, -85, -54, -49, -65, -53, -118, -48, -118, -86, -42, -118, -98, -26, -118, -118, - -98, 198, -118, -108, -118, -118, -116, -118, -43, -118, + -98, 197, -118, -108, -118, -118, -116, -118, -43, -118, -118, -113, -46, -118, -118, -118, -118, -118, -118, -84, -116, -83, -37, -33, -29, -118, -38, -40, -36, -39, - -35, -31, -27, -98, -99, -98, -41, -118, -109, -118, + -35, -31, -27, -118, -99, -98, -41, -118, -109, -118, -94, -118, -117, -118, -19, -16, -112, -114, -115, -118, -118, -118, -118, -80, -79, -118, -82, -81, -118, -73, -74, -118, -67, -118, -71, -118, -42, -32, -118, -118, -118, -118, -105, -102, -107, -111, -118, -118, -92, -25, -44, -45, -47, -63, -57, -61, -118, -76, -118, -68, - -66, -118, -118, -24, -116, -30, -23, -118, -100, -118, - -101, -118, -118, -118, -90, -91, -62, -118, -75, -118, - -78, -118, -72, -28, -118, -88, -103, -104, -106, -89, - -118, -77, -118, -70, -87, -118, -69, -64 ] + -66, -118, -118, -24, -116, -30, -23, -118, -88, -100, + -118, -101, -118, -118, -118, -90, -91, -62, -118, -75, + -118, -78, -118, -72, -28, -87, -103, -104, -106, -89, + -118, -77, -118, -70, -118, -69, -64 ] racc_goto_table = [ - 34, 43, 5, 8, 130, 42, 111, 132, 63, 89, - 128, 134, 150, 39, 94, 76, 32, 52, 96, 97, - 135, 176, 131, 83, 119, 74, 138, 129, 101, 143, - 156, 103, 89, 89, 114, 30, 67, 43, 51, 141, - 51, 42, 157, 2, 90, nil, nil, nil, 128, 80, - 159, nil, nil, nil, 134, nil, 100, nil, nil, nil, - 99, nil, nil, nil, nil, 107, nil, nil, nil, 104, - 89, 43, nil, nil, 51, 42, 89, 43, nil, 127, - 127, 42, 89, 126, 126, 182, 120, 165, 110, 121, - 92, 96, 97, 186, 183, 51, 191, 179, 139, 58, - nil, 62, 128, nil, nil, nil, nil, 89, 140, nil, - nil, 147, 51, 123, 123, 34, 164, 127, nil, nil, - nil, 126, nil, 127, 89, 41, nil, 126, 57, 100, - 57, nil, nil, 99, nil, 82, nil, 68, nil, 51, - nil, nil, 34, nil, nil, 51, nil, nil, 173, nil, - nil, 123, nil, 91, 127, nil, 106, 123, 126, nil, - nil, 41, nil, 92, 57, nil, nil, nil, 34, 184, - nil, 127, nil, 122, nil, 126, 91, 91, nil, 34, - 98, nil, nil, 192, 51, 57, nil, 34, 123, nil, - 34, nil, 195, nil, nil, 41, nil, 51, 51, nil, - 151, 41, 57, 124, 124, 123, 152, nil, nil, nil, - nil, nil, nil, nil, 91, nil, nil, nil, nil, nil, - 91, 142, nil, nil, nil, nil, 91, nil, nil, 57, - nil, nil, nil, nil, nil, 57, nil, nil, nil, nil, - nil, 124, nil, nil, nil, 180, nil, 124, nil, nil, - nil, 91, nil, 98, nil, nil, nil, nil, 187, 188, - nil, nil, nil, nil, nil, nil, nil, nil, 91, nil, - nil, nil, nil, nil, 57, nil, nil, nil, 124, nil, - nil, nil, nil, nil, nil, 142, nil, 57, 57, nil, - nil, nil, nil, nil, nil, 124 ] + 5, 76, 34, 43, 32, 8, 58, 42, 62, 111, + 63, 132, 39, 143, 150, 51, 52, 51, 130, 94, + 74, 128, 134, 135, 177, 96, 89, 119, 97, 131, + 90, 83, 138, 129, 101, 156, 103, 114, 30, 43, + 67, 141, 82, 42, 2, nil, nil, nil, 80, 89, + 89, 51, nil, nil, 159, nil, 157, nil, 100, 128, + 107, nil, 99, 106, nil, 134, nil, 92, nil, nil, + nil, 104, 51, 43, nil, nil, 110, 42, 186, 43, + 122, 127, 127, 42, 120, 126, 126, 89, 121, 51, + 123, 123, 165, 89, nil, nil, 183, 184, 96, 89, + 180, 97, 164, nil, nil, nil, nil, 151, nil, 147, + 140, 191, nil, 152, 128, nil, 51, 34, nil, 127, + nil, nil, 51, 126, 89, 127, nil, nil, 123, 126, + nil, 100, nil, 41, 123, 99, 57, nil, 57, 167, + 92, nil, 89, nil, 34, 68, 174, nil, nil, nil, + nil, nil, 181, nil, nil, nil, 127, nil, nil, nil, + 126, 51, nil, nil, 34, 123, 187, 188, nil, 41, + nil, 34, 57, 91, 127, 51, 51, nil, 126, nil, + nil, nil, 192, 123, nil, nil, nil, nil, 98, 34, + 194, 34, nil, 57, nil, nil, 91, 91, nil, nil, + nil, nil, nil, 41, nil, nil, nil, nil, nil, 41, + 57, 124, 124, nil, nil, nil, nil, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, nil, nil, 142, + nil, nil, nil, nil, 91, nil, nil, 57, nil, nil, + 91, nil, nil, 57, nil, nil, 91, nil, nil, 124, + nil, nil, nil, nil, nil, 124, nil, nil, nil, nil, + nil, 98, nil, nil, nil, nil, nil, nil, nil, nil, + nil, 91, nil, nil, nil, nil, nil, nil, nil, nil, + nil, nil, 57, nil, nil, nil, 124, nil, nil, 91, + nil, nil, nil, nil, 142, nil, 57, 57, nil, nil, + nil, nil, nil, nil, 124 ] racc_goto_check = [ - 4, 20, 2, 3, 44, 19, 24, 40, 20, 34, - 42, 42, 31, 16, 26, 23, 49, 37, 28, 29, - 24, 38, 39, 32, 33, 47, 22, 43, 21, 51, - 45, 46, 34, 34, 17, 48, 5, 20, 25, 50, - 25, 19, 44, 1, 23, nil, nil, nil, 42, 16, - 40, nil, nil, nil, 42, nil, 20, nil, nil, nil, - 19, nil, nil, nil, nil, 47, nil, nil, nil, 3, - 34, 20, nil, nil, 25, 19, 34, 20, nil, 20, - 20, 19, 34, 19, 19, 42, 2, 26, 49, 16, - 25, 28, 29, 51, 24, 25, 44, 33, 47, 30, - nil, 30, 42, nil, nil, nil, nil, 34, 3, nil, - nil, 2, 25, 25, 25, 4, 23, 20, nil, nil, - nil, 19, nil, 20, 34, 18, nil, 19, 18, 20, - 18, nil, nil, 19, nil, 30, nil, 18, nil, 25, - nil, nil, 4, nil, nil, 25, nil, nil, 2, nil, - nil, 25, nil, 36, 20, nil, 30, 25, 19, nil, - nil, 18, nil, 25, 18, nil, nil, nil, 4, 2, - nil, 20, nil, 30, nil, 19, 36, 36, nil, 4, - 18, nil, nil, 2, 25, 18, nil, 4, 25, nil, - 4, nil, 2, nil, nil, 18, nil, 25, 25, nil, - 30, 18, 18, 18, 18, 25, 30, nil, nil, nil, - nil, nil, nil, nil, 36, nil, nil, nil, nil, nil, - 36, 18, nil, nil, nil, nil, 36, nil, nil, 18, + 2, 23, 4, 20, 49, 3, 30, 19, 30, 24, + 20, 40, 16, 51, 31, 25, 37, 25, 44, 26, + 47, 42, 42, 24, 38, 28, 34, 33, 29, 39, + 23, 32, 22, 43, 21, 45, 46, 17, 48, 20, + 5, 50, 30, 19, 1, nil, nil, nil, 16, 34, + 34, 25, nil, nil, 40, nil, 44, nil, 20, 42, + 47, nil, 19, 30, nil, 42, nil, 25, nil, nil, + nil, 3, 25, 20, nil, nil, 49, 19, 51, 20, + 30, 20, 20, 19, 2, 19, 19, 34, 16, 25, + 25, 25, 26, 34, nil, nil, 42, 24, 28, 34, + 33, 29, 23, nil, nil, nil, nil, 30, nil, 2, + 3, 44, nil, 30, 42, nil, 25, 4, nil, 20, + nil, nil, 25, 19, 34, 20, nil, nil, 25, 19, + nil, 20, nil, 18, 25, 19, 18, nil, 18, 2, + 25, nil, 34, nil, 4, 18, 2, nil, nil, nil, + nil, nil, 30, nil, nil, nil, 20, nil, nil, nil, + 19, 25, nil, nil, 4, 25, 30, 30, nil, 18, + nil, 4, 18, 36, 20, 25, 25, nil, 19, nil, + nil, nil, 2, 25, nil, nil, nil, nil, 18, 4, + 2, 4, nil, 18, nil, nil, 36, 36, nil, nil, + nil, nil, nil, 18, nil, nil, nil, nil, nil, 18, + 18, 18, 18, nil, nil, nil, nil, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, nil, nil, 18, + nil, nil, nil, nil, 36, nil, nil, 18, nil, nil, + 36, nil, nil, 18, nil, nil, 36, nil, nil, 18, nil, nil, nil, nil, nil, 18, nil, nil, nil, nil, - nil, 18, nil, nil, nil, 30, nil, 18, nil, nil, - nil, 36, nil, 18, nil, nil, nil, nil, 30, 30, - nil, nil, nil, nil, nil, nil, nil, nil, 36, nil, - nil, nil, nil, nil, 18, nil, nil, nil, 18, nil, - nil, nil, nil, nil, nil, 18, nil, 18, 18, nil, - nil, nil, nil, nil, nil, 18 ] + nil, 18, nil, nil, nil, nil, nil, nil, nil, nil, + nil, 36, nil, nil, nil, nil, nil, nil, nil, nil, + nil, nil, 18, nil, nil, nil, 18, nil, nil, 36, + nil, nil, nil, nil, 18, nil, 18, 18, nil, nil, + nil, nil, nil, nil, 18 ] racc_goto_pointer = [ - nil, 43, 2, 3, -5, 15, nil, nil, nil, nil, - nil, nil, nil, nil, nil, nil, 4, -45, 116, -4, - -8, -36, -75, -20, -70, 26, -50, nil, -46, -45, - 87, -100, -25, -59, -55, nil, 89, 5, -132, -66, - -81, nil, -77, -60, -83, -95, -35, -5, 32, 13, - -66, -76, nil ] + nil, 44, 0, 5, -3, 19, nil, nil, nil, nil, + nil, nil, nil, nil, nil, nil, 3, -42, 124, -2, + -6, -30, -69, -34, -67, 3, -45, nil, -39, -36, + -6, -98, -17, -56, -38, nil, 109, 4, -129, -59, + -77, nil, -66, -54, -69, -90, -30, -10, 35, 1, + -64, -92, nil ] racc_goto_default = [ nil, nil, nil, 73, 11, 13, 15, 18, 22, 23, @@ -699,11 +702,13 @@ Racc_debug_parser = false # reduce 0 omitted -module_eval <<'.,.,', 'grammar.ra', 22 +module_eval <<'.,.,', 'grammar.ra', 24 def _reduce_1( val, _values, result ) + # Make sure we always return an array. if val[0].is_a?(AST::ASTArray) result = val[0] else + result = aryfy(val[0]) end result end @@ -713,7 +718,7 @@ module_eval <<'.,.,', 'grammar.ra', 22 # reduce 3 omitted -module_eval <<'.,.,', 'grammar.ra', 33 +module_eval <<'.,.,', 'grammar.ra', 35 def _reduce_4( val, _values, result ) if val[0].instance_of?(AST::ASTArray) val[0].push(val[1]) @@ -747,7 +752,7 @@ module_eval <<'.,.,', 'grammar.ra', 33 # reduce 15 omitted -module_eval <<'.,.,', 'grammar.ra', 54 +module_eval <<'.,.,', 'grammar.ra', 56 def _reduce_16( val, _values, result ) args = aryfy(val[2]) result = ast AST::Function, @@ -758,7 +763,7 @@ module_eval <<'.,.,', 'grammar.ra', 54 end .,., -module_eval <<'.,.,', 'grammar.ra', 61 +module_eval <<'.,.,', 'grammar.ra', 63 def _reduce_17( val, _values, result ) args = aryfy(val[1]) result = ast AST::Function, @@ -771,7 +776,7 @@ module_eval <<'.,.,', 'grammar.ra', 61 # reduce 18 omitted -module_eval <<'.,.,', 'grammar.ra', 80 +module_eval <<'.,.,', 'grammar.ra', 82 def _reduce_19( val, _values, result ) result = aryfy(val[0], val[2]) result.line = @lexer.line @@ -786,7 +791,7 @@ module_eval <<'.,.,', 'grammar.ra', 80 # reduce 22 omitted -module_eval <<'.,.,', 'grammar.ra', 109 +module_eval <<'.,.,', 'grammar.ra', 111 def _reduce_23( val, _values, result ) if val[0].instance_of?(AST::ASTArray) raise Puppet::ParseError, "Invalid name" @@ -813,7 +818,7 @@ module_eval <<'.,.,', 'grammar.ra', 109 end .,., -module_eval <<'.,.,', 'grammar.ra', 118 +module_eval <<'.,.,', 'grammar.ra', 120 def _reduce_24( val, _values, result ) if val[0].instance_of?(AST::ASTArray) Puppet.notice "invalid name" @@ -826,7 +831,7 @@ module_eval <<'.,.,', 'grammar.ra', 118 end .,., -module_eval <<'.,.,', 'grammar.ra', 124 +module_eval <<'.,.,', 'grammar.ra', 126 def _reduce_25( val, _values, result ) # a template setting for a type if val[0].instance_of?(AST::ASTArray) @@ -837,7 +842,7 @@ module_eval <<'.,.,', 'grammar.ra', 124 end .,., -module_eval <<'.,.,', 'grammar.ra', 147 +module_eval <<'.,.,', 'grammar.ra', 149 def _reduce_26( val, _values, result ) unless Puppet[:storeconfigs] raise Puppet::ParseError, "You cannot collect without storeconfigs being set" @@ -861,7 +866,7 @@ module_eval <<'.,.,', 'grammar.ra', 147 end .,., -module_eval <<'.,.,', 'grammar.ra', 156 +module_eval <<'.,.,', 'grammar.ra', 158 def _reduce_27( val, _values, result ) unless Puppet[:storeconfigs] raise Puppet::ParseError, "You cannot collect without storeconfigs being set" @@ -871,7 +876,7 @@ module_eval <<'.,.,', 'grammar.ra', 156 end .,., -module_eval <<'.,.,', 'grammar.ra', 160 +module_eval <<'.,.,', 'grammar.ra', 162 def _reduce_28( val, _values, result ) result = ast AST::ObjectInst, :children => [val[0],val[2]] result @@ -880,7 +885,7 @@ module_eval <<'.,.,', 'grammar.ra', 160 # reduce 29 omitted -module_eval <<'.,.,', 'grammar.ra', 170 +module_eval <<'.,.,', 'grammar.ra', 172 def _reduce_30( val, _values, result ) if val[0].instance_of?(AST::ObjectInst) result = ast AST::ASTArray, :children => [val[0],val[2]] @@ -896,14 +901,14 @@ module_eval <<'.,.,', 'grammar.ra', 170 # reduce 32 omitted -module_eval <<'.,.,', 'grammar.ra', 177 +module_eval <<'.,.,', 'grammar.ra', 179 def _reduce_33( val, _values, result ) result = ast AST::Name, :value => val[0] result end .,., -module_eval <<'.,.,', 'grammar.ra', 181 +module_eval <<'.,.,', 'grammar.ra', 183 def _reduce_34( val, _values, result ) result = ast AST::Type, :value => val[0] result @@ -922,7 +927,7 @@ module_eval <<'.,.,', 'grammar.ra', 181 # reduce 40 omitted -module_eval <<'.,.,', 'grammar.ra', 194 +module_eval <<'.,.,', 'grammar.ra', 196 def _reduce_41( val, _values, result ) # this is distinct from referencing a variable variable = ast AST::Name, :value => val[0].sub(/^\$/,'') @@ -931,21 +936,21 @@ module_eval <<'.,.,', 'grammar.ra', 194 end .,., -module_eval <<'.,.,', 'grammar.ra', 199 +module_eval <<'.,.,', 'grammar.ra', 201 def _reduce_42( val, _values, result ) result = ast AST::ASTArray result end .,., -module_eval <<'.,.,', 'grammar.ra', 199 +module_eval <<'.,.,', 'grammar.ra', 201 def _reduce_43( val, _values, result ) result = val[0] result end .,., -module_eval <<'.,.,', 'grammar.ra', 208 +module_eval <<'.,.,', 'grammar.ra', 210 def _reduce_44( val, _values, result ) if val[0].instance_of?(AST::ASTArray) val[0].push(val[2]) @@ -957,7 +962,7 @@ module_eval <<'.,.,', 'grammar.ra', 208 end .,., -module_eval <<'.,.,', 'grammar.ra', 213 +module_eval <<'.,.,', 'grammar.ra', 215 def _reduce_45( val, _values, result ) leaf = ast AST::String, :value => val[0] result = ast AST::ObjectParam, :param => leaf, :value => val[2] @@ -967,7 +972,7 @@ module_eval <<'.,.,', 'grammar.ra', 213 # reduce 46 omitted -module_eval <<'.,.,', 'grammar.ra', 222 +module_eval <<'.,.,', 'grammar.ra', 224 def _reduce_47( val, _values, result ) if val[0].instance_of?(AST::ASTArray) result = val[0].push(val[2]) @@ -996,7 +1001,7 @@ module_eval <<'.,.,', 'grammar.ra', 222 # reduce 56 omitted -module_eval <<'.,.,', 'grammar.ra', 241 +module_eval <<'.,.,', 'grammar.ra', 243 def _reduce_57( val, _values, result ) args = aryfy(val[2]) result = ast AST::Function, @@ -1007,35 +1012,35 @@ module_eval <<'.,.,', 'grammar.ra', 241 end .,., -module_eval <<'.,.,', 'grammar.ra', 245 +module_eval <<'.,.,', 'grammar.ra', 247 def _reduce_58( val, _values, result ) result = ast AST::String, :value => val[0] result end .,., -module_eval <<'.,.,', 'grammar.ra', 247 +module_eval <<'.,.,', 'grammar.ra', 249 def _reduce_59( val, _values, result ) result = ast AST::FlatString, :value => val[0] result end .,., -module_eval <<'.,.,', 'grammar.ra', 251 +module_eval <<'.,.,', 'grammar.ra', 253 def _reduce_60( val, _values, result ) result = ast AST::Boolean, :value => val[0] result end .,., -module_eval <<'.,.,', 'grammar.ra', 255 +module_eval <<'.,.,', 'grammar.ra', 257 def _reduce_61( val, _values, result ) result = ast AST::ObjectRef, :type => val[0], :name => val[2] result end .,., -module_eval <<'.,.,', 'grammar.ra', 268 +module_eval <<'.,.,', 'grammar.ra', 270 def _reduce_62( val, _values, result ) args = { :test => val[1], @@ -1053,7 +1058,7 @@ module_eval <<'.,.,', 'grammar.ra', 268 # reduce 63 omitted -module_eval <<'.,.,', 'grammar.ra', 273 +module_eval <<'.,.,', 'grammar.ra', 275 def _reduce_64( val, _values, result ) result = ast AST::Else, :statements => val[2] result @@ -1062,7 +1067,7 @@ module_eval <<'.,.,', 'grammar.ra', 273 # reduce 65 omitted -module_eval <<'.,.,', 'grammar.ra', 285 +module_eval <<'.,.,', 'grammar.ra', 287 def _reduce_66( val, _values, result ) options = val[3] unless options.instance_of?(AST::ASTArray) @@ -1075,7 +1080,7 @@ module_eval <<'.,.,', 'grammar.ra', 285 # reduce 67 omitted -module_eval <<'.,.,', 'grammar.ra', 295 +module_eval <<'.,.,', 'grammar.ra', 297 def _reduce_68( val, _values, result ) if val[0].instance_of?(AST::ASTArray) val[0].push val[1] @@ -1087,14 +1092,14 @@ module_eval <<'.,.,', 'grammar.ra', 295 end .,., -module_eval <<'.,.,', 'grammar.ra', 299 +module_eval <<'.,.,', 'grammar.ra', 301 def _reduce_69( val, _values, result ) result = ast AST::CaseOpt, :value => val[0], :statements => val[3] result end .,., -module_eval <<'.,.,', 'grammar.ra', 304 +module_eval <<'.,.,', 'grammar.ra', 306 def _reduce_70( val, _values, result ) result = ast(AST::CaseOpt, :value => val[0], @@ -1106,7 +1111,7 @@ module_eval <<'.,.,', 'grammar.ra', 304 # reduce 71 omitted -module_eval <<'.,.,', 'grammar.ra', 314 +module_eval <<'.,.,', 'grammar.ra', 316 def _reduce_72( val, _values, result ) if val[0].instance_of?(AST::ASTArray) val[0].push(val[2]) @@ -1118,7 +1123,7 @@ module_eval <<'.,.,', 'grammar.ra', 314 end .,., -module_eval <<'.,.,', 'grammar.ra', 318 +module_eval <<'.,.,', 'grammar.ra', 320 def _reduce_73( val, _values, result ) result = ast AST::Selector, :param => val[0], :values => val[2] result @@ -1127,7 +1132,7 @@ module_eval <<'.,.,', 'grammar.ra', 318 # reduce 74 omitted -module_eval <<'.,.,', 'grammar.ra', 320 +module_eval <<'.,.,', 'grammar.ra', 322 def _reduce_75( val, _values, result ) result = val[1] result @@ -1136,7 +1141,7 @@ module_eval <<'.,.,', 'grammar.ra', 320 # reduce 76 omitted -module_eval <<'.,.,', 'grammar.ra', 331 +module_eval <<'.,.,', 'grammar.ra', 333 def _reduce_77( val, _values, result ) if val[0].instance_of?(AST::ASTArray) val[0].push(val[2]) @@ -1148,7 +1153,7 @@ module_eval <<'.,.,', 'grammar.ra', 331 end .,., -module_eval <<'.,.,', 'grammar.ra', 335 +module_eval <<'.,.,', 'grammar.ra', 337 def _reduce_78( val, _values, result ) result = ast AST::ObjectParam, :param => val[0], :value => val[2] result @@ -1167,14 +1172,14 @@ module_eval <<'.,.,', 'grammar.ra', 335 # reduce 84 omitted -module_eval <<'.,.,', 'grammar.ra', 345 +module_eval <<'.,.,', 'grammar.ra', 347 def _reduce_85( val, _values, result ) result = ast AST::Default, :value => val[0] result end .,., -module_eval <<'.,.,', 'grammar.ra', 401 +module_eval <<'.,.,', 'grammar.ra', 404 def _reduce_86( val, _values, result ) # importing files # yuk, i hate keywords @@ -1224,6 +1229,7 @@ module_eval <<'.,.,', 'grammar.ra', 401 next end # push the results into the main result array + # We always return an array when we parse. parser.parse.each do |child| result.push child end @@ -1233,29 +1239,28 @@ module_eval <<'.,.,', 'grammar.ra', 401 end .,., -module_eval <<'.,.,', 'grammar.ra', 415 +module_eval <<'.,.,', 'grammar.ra', 420 def _reduce_87( val, _values, result ) args = { :type => ast(AST::Name, :value => val[1]), :args => val[2], - :keyword => val[0], - :code => val[5] + :code => val[4] # Switch to 5 for parents } if val[3].instance_of?(AST::Name) args[:parentclass] = val[3] end result = ast AST::CompDef, args +#} | DEFINE NAME argumentlist parent LBRACE RBRACE { result end .,., -module_eval <<'.,.,', 'grammar.ra', 428 +module_eval <<'.,.,', 'grammar.ra', 432 def _reduce_88( val, _values, result ) args = { :type => ast(AST::Name, :value => val[1]), :args => val[2], - :keyword => val[0], :code => ast(AST::ASTArray) } @@ -1263,17 +1268,16 @@ module_eval <<'.,.,', 'grammar.ra', 428 args[:parentclass] = val[3] end - result = ast AST::CompDef,args + result = ast AST::CompDef, args result end .,., -module_eval <<'.,.,', 'grammar.ra', 443 +module_eval <<'.,.,', 'grammar.ra', 446 def _reduce_89( val, _values, result ) #:args => val[2], args = { :type => ast(AST::Name, :value => val[1]), - :keyword => val[0], :code => val[4] } # It'll be an ASTArray if we didn't get a parent @@ -1285,11 +1289,10 @@ module_eval <<'.,.,', 'grammar.ra', 443 end .,., -module_eval <<'.,.,', 'grammar.ra', 454 +module_eval <<'.,.,', 'grammar.ra', 456 def _reduce_90( val, _values, result ) args = { :type => ast(AST::Name, :value => val[1]), - :keyword => val[0], :code => ast(AST::ASTArray, :children => []) } # It'll be an ASTArray if we didn't get a parent @@ -1301,7 +1304,7 @@ module_eval <<'.,.,', 'grammar.ra', 454 end .,., -module_eval <<'.,.,', 'grammar.ra', 472 +module_eval <<'.,.,', 'grammar.ra', 473 def _reduce_91( val, _values, result ) unless val[1].instance_of?(AST::ASTArray) val[1] = ast AST::ASTArray, @@ -1311,7 +1314,6 @@ module_eval <<'.,.,', 'grammar.ra', 472 end args = { :names => val[1], - :keyword => val[0], :code => val[4] } if val[2].instance_of?(AST::Name) @@ -1331,7 +1333,6 @@ module_eval <<'.,.,', 'grammar.ra', 488 :children => [val[1]] end args = { - :keyword => val[0], :names => val[1], :code => ast(AST::ASTArray, :children => []) } @@ -1421,7 +1422,7 @@ module_eval <<'.,.,', 'grammar.ra', 533 module_eval <<'.,.,', 'grammar.ra', 541 def _reduce_104( val, _values, result ) - msg = "Deprecation notice: Variables must now include '$' in prototypes" + msg = "Deprecation notice: #{val[0].value} must now include '$' in prototype" msg += " at line %s" % @lexer.line msg += " in file %s" % @lexer.file if @lexer.file Puppet.warning msg @@ -1432,7 +1433,7 @@ module_eval <<'.,.,', 'grammar.ra', 541 module_eval <<'.,.,', 'grammar.ra', 548 def _reduce_105( val, _values, result ) - msg = "Deprecation notice: Variables must now include '$' in prototypes" + msg = "Deprecation notice: #{val[0].value} must now include '$' in prototype" msg += " at line %s" % @lexer.line msg += " in file %s" % @lexer.file if @lexer.file Puppet.warning msg |