summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-03-03 18:23:53 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-03-03 18:23:53 +0000
commitaae9b2aa90c2f1e12baeebe530a0cd8a69fac9c2 (patch)
tree22430454ec25742a384e11ac91f829598a8aea42 /lib/puppet/parser
parent451ba6d069cb253f901541f420e51c0b184d8d8c (diff)
downloadpuppet-aae9b2aa90c2f1e12baeebe530a0cd8a69fac9c2.tar.gz
puppet-aae9b2aa90c2f1e12baeebe530a0cd8a69fac9c2.tar.xz
puppet-aae9b2aa90c2f1e12baeebe530a0cd8a69fac9c2.zip
Definitions now always create their own context, which means that they cannot override elements in the containing scopes.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@972 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r--lib/puppet/parser/ast/component.rb16
-rw-r--r--lib/puppet/parser/ast/objectdef.rb4
2 files changed, 5 insertions, 15 deletions
diff --git a/lib/puppet/parser/ast/component.rb b/lib/puppet/parser/ast/component.rb
index 0ecdb1d02..00677e1ea 100644
--- a/lib/puppet/parser/ast/component.rb
+++ b/lib/puppet/parser/ast/component.rb
@@ -24,24 +24,14 @@ class Puppet::Parser::AST
:name => objname,
:keyword => self.keyword
)
- if hash[:newcontext]
+ newcontext = hash[:newcontext]
+
+ unless self.is_a? AST::HostClass and ! newcontext
#scope.warning "Setting context to %s" % self.object_id
scope.context = self.object_id
end
@scope = scope
- # The type is the component or class name
- #scope.type = objtype
-
- # The name is the name the user has chosen or that has
- # been dynamically generated. This is almost never used
- #scope.name = objname
-
- #scope.keyword = self.keyword
-
- #if self.is_a?(Node)
- # scope.isnodescope
- #end
# Additionally, add a tag for whatever kind of class
# we are
diff --git a/lib/puppet/parser/ast/objectdef.rb b/lib/puppet/parser/ast/objectdef.rb
index 0b8d50e6d..59758b982 100644
--- a/lib/puppet/parser/ast/objectdef.rb
+++ b/lib/puppet/parser/ast/objectdef.rb
@@ -285,7 +285,7 @@ class Puppet::Parser::AST
return true unless defined? @scope and @scope
# Unless we can look up the type, throw an error
- unless objtype = @scope.lookuptype(objtype)
+ unless typeobj = @scope.lookuptype(objtype)
error = Puppet::ParseError.new(
"Unknown type '%s'" % objtype
)
@@ -297,7 +297,7 @@ class Puppet::Parser::AST
# Now that we have the type, verify all of the parameters.
# Note that we're now passing an AST Class object or whatever
# as the type, not a simple string.
- self.paramcheck(builtin, objtype)
+ self.paramcheck(builtin, typeobj)
end
end