summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/ast
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-04-11 22:32:51 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-04-11 22:32:51 +0000
commit71793fb3d096b74977b73fffe16bbeb8f45c94b9 (patch)
treeb1d2ac064df3fbe004b216112fea8ab2a0856b15 /lib/puppet/parser/ast
parentf522a7e4fe87de6214d1d8e5e6d587d1948117ab (diff)
downloadpuppet-71793fb3d096b74977b73fffe16bbeb8f45c94b9.tar.gz
puppet-71793fb3d096b74977b73fffe16bbeb8f45c94b9.tar.xz
puppet-71793fb3d096b74977b73fffe16bbeb8f45c94b9.zip
Changing "set" to "tag"
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1106 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/parser/ast')
-rw-r--r--lib/puppet/parser/ast/tag.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/puppet/parser/ast/tag.rb b/lib/puppet/parser/ast/tag.rb
new file mode 100644
index 000000000..ce59558f3
--- /dev/null
+++ b/lib/puppet/parser/ast/tag.rb
@@ -0,0 +1,26 @@
+class Puppet::Parser::AST
+ # The code associated with a class. This is different from components
+ # in that each class is a singleton -- only one will exist for a given
+ # node.
+ class Set < AST::Branch
+ @name = :class
+ attr_accessor :type
+
+ def evaluate(hash)
+ scope = hash[:scope]
+
+ types = @type.safeevaluate(:scope => scope)
+
+ types = [types] unless types.is_a? Array
+
+ types.each do |type|
+ # Now set our class. We don't have to worry about checking
+ # whether we've been evaluated because we're not evaluating
+ # any code.
+ scope.setclass(self.object_id, type)
+ end
+ end
+ end
+end
+
+# $Id$