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 From ed0c745c0f3b0f277968149ca25c78ce374bd2e4 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Sun, 20 Jan 2008 22:00:05 -0800 Subject: Fixing #1017 -- environment-specific modulepath is no longer ignored. (Cherry-picked from master.) --- lib/puppet/parser/parser_support.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 b543cd3ec..ccfc4d48a 100644 --- a/lib/puppet/parser/parser_support.rb +++ b/lib/puppet/parser/parser_support.rb @@ -177,7 +177,7 @@ class Puppet::Parser::Parser "in file #{@lexer.file} at line #{@lexer.line}" ) end - files = Puppet::Module::find_manifests(pat, :cwd => dir) + files = Puppet::Module::find_manifests(pat, :cwd => dir, :environment => @environment) if files.size == 0 raise Puppet::ImportError.new("No file(s) found for import " + "of '#{pat}'") -- cgit