diff options
| author | Nick Lewis <nick@puppetlabs.com> | 2010-11-23 16:42:06 -0800 |
|---|---|---|
| committer | Nick Lewis <nick@puppetlabs.com> | 2010-11-23 16:42:06 -0800 |
| commit | 4b35402ba85d8842d757becec5c8a7bf4d6f6654 (patch) | |
| tree | 5da174c4c1c106b99e8c464e45e89d7b5ba2b5a2 /lib/puppet/parser/parser_support.rb | |
| parent | a7bd1630622cace01d0e4c974c76366e4b3b886c (diff) | |
| parent | 2bc6727b6ac7348dbac98099f1fe0aeb3cd1295f (diff) | |
| download | puppet-4b35402ba85d8842d757becec5c8a7bf4d6f6654.tar.gz puppet-4b35402ba85d8842d757becec5c8a7bf4d6f6654.tar.xz puppet-4b35402ba85d8842d757becec5c8a7bf4d6f6654.zip | |
Merge branch 'next'
Diffstat (limited to 'lib/puppet/parser/parser_support.rb')
| -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 16cd0ee0f..746aa0f90 100644 --- a/lib/puppet/parser/parser_support.rb +++ b/lib/puppet/parser/parser_support.rb @@ -37,12 +37,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 |
