diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/parser/parser_support.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/puppet/parser/parser_support.rb b/lib/puppet/parser/parser_support.rb index c90c1978f..7bbebb124 100644 --- a/lib/puppet/parser/parser_support.rb +++ b/lib/puppet/parser/parser_support.rb @@ -46,12 +46,12 @@ class Puppet::Parser::Parser # Create an AST object, and automatically add the file and line information if # available. def ast(klass, hash = {}) - klass.new ast_context(klass.use_docs).merge(hash) + klass.new ast_context(klass.use_docs, hash[:line]).merge(hash) end - def ast_context(include_docs = false) + def ast_context(include_docs = false, ast_line = nil) result = { - :line => lexer.line, + :line => ast_line || lexer.line, :file => lexer.file } result[:doc] = lexer.getcomment(result[:line]) if include_docs |