summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/ast.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/parser/ast.rb')
-rw-r--r--lib/puppet/parser/ast.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/puppet/parser/ast.rb b/lib/puppet/parser/ast.rb
index ddf88521c..303d75bac 100644
--- a/lib/puppet/parser/ast.rb
+++ b/lib/puppet/parser/ast.rb
@@ -12,8 +12,23 @@ class Puppet::Parser::AST
include Puppet::Util::Errors
include Puppet::Util::MethodHelper
+ include Puppet::Util::Docs
+
attr_accessor :line, :file, :parent, :scope
+ # don't fetch lexer comment by default
+ def use_docs
+ self.class.use_docs
+ end
+
+ # allow our subclass to specify they want documentation
+ class << self
+ attr_accessor :use_docs
+ def associates_doc
+ self.use_docs = true
+ end
+ end
+
# Does this ast object set something? If so, it gets evaluated first.
def self.settor?
if defined? @settor