diff options
| author | Matt Robinson <matt@puppetlabs.com> | 2010-07-19 14:57:23 -0700 |
|---|---|---|
| committer | Markus Roberts <Markus@reality.com> | 2010-07-19 19:56:06 -0700 |
| commit | 539d71635132bd5f772a550b7bfff530e8b59b68 (patch) | |
| tree | 1f1ae2297bf9b13f62473f918f3ae4d172326fa9 /lib/puppet/parser/ast | |
| parent | d2da1d45aaf44de7fd0648b3bab48887838549d8 (diff) | |
| download | puppet-539d71635132bd5f772a550b7bfff530e8b59b68.tar.gz puppet-539d71635132bd5f772a550b7bfff530e8b59b68.tar.xz puppet-539d71635132bd5f772a550b7bfff530e8b59b68.zip | |
[#4287] Fix the undefined evaluate_match error when comparing functions
Ticket #4238 introduced a problem that a function couldn't compare to
another value until after it was evaluated, and AST::Function didn't have the
evaluate_match method. This change moves that method from AST::Leaf to AST.
The special casing necessary for doing comparisons between AST objects
feels messy and could probably be encapsulated better. I've created
ticket #4291 to remind us to refactor this at some point.
Paired with: Nick Lewis
Signed-off-by: Matt Robinson <matt@puppetlabs.com>
Diffstat (limited to 'lib/puppet/parser/ast')
| -rw-r--r-- | lib/puppet/parser/ast/leaf.rb | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/lib/puppet/parser/ast/leaf.rb b/lib/puppet/parser/ast/leaf.rb index 49f430278..db9788f50 100644 --- a/lib/puppet/parser/ast/leaf.rb +++ b/lib/puppet/parser/ast/leaf.rb @@ -10,20 +10,6 @@ class Puppet::Parser::AST @value end - # evaluate ourselves, and match - def evaluate_match(value, scope) - obj = self.safeevaluate(scope) - - obj = obj.downcase if obj.respond_to?(:downcase) - value = value.downcase if value.respond_to?(:downcase) - - obj = Puppet::Parser::Scope.number?(obj) || obj - value = Puppet::Parser::Scope.number?(value) || value - - # "" == undef for case/selector/if - obj == value or (obj == "" and value == :undef) - end - def match(value) @value == value end |
