summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/ast/astarray.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/parser/ast/astarray.rb')
-rw-r--r--lib/puppet/parser/ast/astarray.rb20
1 files changed, 4 insertions, 16 deletions
diff --git a/lib/puppet/parser/ast/astarray.rb b/lib/puppet/parser/ast/astarray.rb
index 432300c7a..e856570f8 100644
--- a/lib/puppet/parser/ast/astarray.rb
+++ b/lib/puppet/parser/ast/astarray.rb
@@ -9,11 +9,6 @@ class Puppet::Parser::AST
class ASTArray < Branch
include Enumerable
- # True if this ASTArray represents a list of statements in a
- # context that defines a namespace. Classes and definitions may
- # only appear in such a context.
- attr_accessor :is_a_namespace
-
# Return a child by index. Probably never used.
def [](index)
@children[index]
@@ -37,17 +32,10 @@ class Puppet::Parser::AST
}
rets = items.flatten.collect { |child|
- if child.respond_to? :instantiate
- if is_a_namespace
- # no problem, just don't evaluate it.
- else
- msg = "Classes, definitions, and nodes may only appear at toplevel or inside other classes"
- error = Puppet::Error.new(msg)
- error.line = child.line
- error.file = child.file
- raise error
- end
- else
+ # Skip things that respond to :instantiate (classes, nodes,
+ # and definitions), because they have already been
+ # instantiated.
+ if !child.respond_to?(:instantiate)
child.safeevaluate(scope)
end
}