From 6ff9423c7ebaf759fcee28a3009cd59bed3ea886 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Wed, 30 Jan 2008 23:28:07 +1100 Subject: 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. --- lib/puppet/parser/parser_support.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lib/puppet/parser/parser_support.rb') 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 -- cgit