summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/ast/leaf.rb
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-10-04 18:24:24 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-10-04 18:24:24 +0000
commit28cee40689440388994a4768bd301ae32c8ecc05 (patch)
treec865ab44f4c9247052cf83de16ffc8ebe8b15e54 /lib/puppet/parser/ast/leaf.rb
parente0e291332bd4676962a28c7b220ae5c5e9651c0a (diff)
downloadpuppet-28cee40689440388994a4768bd301ae32c8ecc05.tar.gz
puppet-28cee40689440388994a4768bd301ae32c8ecc05.tar.xz
puppet-28cee40689440388994a4768bd301ae32c8ecc05.zip
Merging the changes from the override-refactor branch. This is a significant rewrite of the parser, but it has little affect on the rest of the code tree.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1726 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/parser/ast/leaf.rb')
-rw-r--r--lib/puppet/parser/ast/leaf.rb23
1 files changed, 6 insertions, 17 deletions
diff --git a/lib/puppet/parser/ast/leaf.rb b/lib/puppet/parser/ast/leaf.rb
index 7b9a283d7..298c0168f 100644
--- a/lib/puppet/parser/ast/leaf.rb
+++ b/lib/puppet/parser/ast/leaf.rb
@@ -28,15 +28,11 @@ class Puppet::Parser::AST
def initialize(hash)
super
- unless @value == 'true' or @value == 'false'
+ unless @value == true or @value == false
raise Puppet::DevError,
"'%s' is not a boolean" % @value
end
- if @value == 'true'
- @value = true
- else
- @value = false
- end
+ @value
end
end
@@ -69,6 +65,9 @@ class Puppet::Parser::AST
# Lower-case words.
class Name < AST::Leaf; end
+ # double-colon separated class names
+ class ClassName < AST::Leaf; end
+
# Host names, either fully qualified or just the short name
class HostName < AST::Leaf
def initialize(hash)
@@ -87,18 +86,8 @@ class Puppet::Parser::AST
# Looks up the value of the object in the scope tree (does
# not include syntactical constructs, like '$' and '{}').
def evaluate(hash)
- begin
+ parsewrap do
return hash[:scope].lookupvar(@value)
- rescue Puppet::ParseError => except
- except.line = self.line
- except.file = self.file
- raise except
- rescue => detail
- error = Puppet::DevError.new(detail)
- error.line = self.line
- error.file = self.file
- error.set_backtrace detail.backtrace
- raise error
end
end
end