diff options
| author | Luke Kanies <luke@madstop.com> | 2008-02-08 13:24:39 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-02-08 13:24:39 -0600 |
| commit | 82720d5327b30839a29035ee0b498b940ffc7a5a (patch) | |
| tree | 0e059f99f9325bb7f8d65aa6441601b80644a2d2 /lib/puppet/parser | |
| parent | dbaffaeaafa60c7325f7522a76a84c5dd7df7c6b (diff) | |
| download | puppet-82720d5327b30839a29035ee0b498b940ffc7a5a.tar.gz puppet-82720d5327b30839a29035ee0b498b940ffc7a5a.tar.xz puppet-82720d5327b30839a29035ee0b498b940ffc7a5a.zip | |
Removing some obsolete code from the AST base class
Diffstat (limited to 'lib/puppet/parser')
| -rw-r--r-- | lib/puppet/parser/ast.rb | 42 |
1 files changed, 3 insertions, 39 deletions
diff --git a/lib/puppet/parser/ast.rb b/lib/puppet/parser/ast.rb index 880e406a8..cac18fef4 100644 --- a/lib/puppet/parser/ast.rb +++ b/lib/puppet/parser/ast.rb @@ -14,30 +14,6 @@ class Puppet::Parser::AST include Puppet::Util::MethodHelper attr_accessor :line, :file, :parent, :scope - # Just used for 'tree', which is only used in debugging. - @@pink = "[0;31m" - @@green = "[0;32m" - @@yellow = "[0;33m" - @@slate = "[0;34m" - @@reset = "[0m" - - # Just used for 'tree', which is only used in debugging. - @@indent = " " * 4 - @@indline = @@pink + ("-" * 4) + @@reset - @@midline = @@slate + ("-" * 4) + @@reset - - @@settypes = {} - - # Just used for 'tree', which is only used in debugging. - def AST.indention - return @@indent * @@indention - end - - # Just used for 'tree', which is only used in debugging. - def AST.midline - return @@midline - end - # Does this ast object set something? If so, it gets evaluated first. def self.settor? if defined? @settor @@ -47,16 +23,12 @@ class Puppet::Parser::AST end end - # Evaluate the current object. Basically just iterates across all + # Evaluate the current object. Just a stub method, since the subclass + # should override this method. # of the contained children and evaluates them in turn, returning a # list of all of the collected values, rejecting nil values def evaluate(args) - #Puppet.debug("Evaluating ast %s" % @name) - value = self.collect { |obj| - obj.safeevaluate(args) - }.reject { |obj| - obj.nil? - } + raise Puppet::DevError, "Did not override #evaluate in %s" % self.class end # Throw a parse error. @@ -90,14 +62,6 @@ class Puppet::Parser::AST end end - # Again, just used for printing out the parse tree. - def typewrap(string) - #return self.class.to_s.sub(/.+::/,'') + - #"(" + @@green + string.to_s + @@reset + ")" - return @@green + string.to_s + @@reset + - "(" + self.class.to_s.sub(/.+::/,'') + ")" - end - # Initialize the object. Requires a hash as the argument, and # takes each of the parameters of the hash and calls the settor # method for them. This is probably pretty inefficient and should |
