From 064fb006a350e9555abe766c5cb4aeb803fd623a Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Sat, 15 Nov 2008 13:10:55 +0100 Subject: Add a doc attribute to AST nodes and fill it with the last seen comments The lexer maintains a stack of last seen comments. On blank lines the lexer flush the comments. On each opening brace the lexer enters a new stack level. On each block AST nodes, the stack is popped. Each AST nodes has a doc property that is filled with the last seen comments on node creation (in fact only on important node creation representing statements). Signed-off-by: Brice Figureau --- lib/puppet/parser/ast/function.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/puppet/parser/ast/function.rb') diff --git a/lib/puppet/parser/ast/function.rb b/lib/puppet/parser/ast/function.rb index eb36fa906..192940a7a 100644 --- a/lib/puppet/parser/ast/function.rb +++ b/lib/puppet/parser/ast/function.rb @@ -3,6 +3,9 @@ require 'puppet/parser/ast/branch' class Puppet::Parser::AST # An AST object to call a function. class Function < AST::Branch + + associates_doc + attr_accessor :name, :arguments @settor = true -- cgit