summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/parser_support.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-01-30 23:28:07 +1100
committerLuke Kanies <luke@madstop.com>2008-01-30 23:28:07 +1100
commit6ff9423c7ebaf759fcee28a3009cd59bed3ea886 (patch)
treedc933147e723585c0ba5ac36b8f6998c4dc947f1 /lib/puppet/parser/parser_support.rb
parentee6ddc9c3bf76d4a6499fdbcb43f18daed247395 (diff)
downloadpuppet-6ff9423c7ebaf759fcee28a3009cd59bed3ea886.tar.gz
puppet-6ff9423c7ebaf759fcee28a3009cd59bed3ea886.tar.xz
puppet-6ff9423c7ebaf759fcee28a3009cd59bed3ea886.zip
Significantly refactoring the lexer, including adding Token and TokenList
classes for managing how the tokens work. I also moved they tests to RSpec, but I didn't rewrite all of them.
Diffstat (limited to 'lib/puppet/parser/parser_support.rb')
-rw-r--r--lib/puppet/parser/parser_support.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/puppet/parser/parser_support.rb b/lib/puppet/parser/parser_support.rb
index acf3c9f7c..b543cd3ec 100644
--- a/lib/puppet/parser/parser_support.rb
+++ b/lib/puppet/parser/parser_support.rb
@@ -47,11 +47,8 @@ class Puppet::Parser::Parser
# Create an AST object, and automatically add the file and line information if
# available.
- def ast(klass, hash = nil)
- hash ||= {}
- unless hash.include?(:line)
- hash[:line] = @lexer.line
- end
+ def ast(klass, hash = {})
+ hash[:line] = @lexer.line unless hash.include?(:line)
unless hash.include?(:file)
if file = @lexer.file