summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser
diff options
context:
space:
mode:
authorPaul Berry <paul@puppetlabs.com>2010-11-10 16:05:15 -0800
committerPaul Berry <paul@puppetlabs.com>2010-11-10 16:06:04 -0800
commit2b8e834fcbc548a221b4cd02ee7200fa4f6c2c78 (patch)
treed7c11657d0bfd44488b235c95819f62f7431b949 /lib/puppet/parser
parent7236a33d6c5c9fbb0f46ffd7826965dbaae6a39b (diff)
parent275a224ee245577c4213b3a21bf1e98301740a4e (diff)
downloadpuppet-2b8e834fcbc548a221b4cd02ee7200fa4f6c2c78.tar.gz
puppet-2b8e834fcbc548a221b4cd02ee7200fa4f6c2c78.tar.xz
puppet-2b8e834fcbc548a221b4cd02ee7200fa4f6c2c78.zip
Merge branch 'next'
This marks the end of the agile iteration from 11/3-11/10.
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r--lib/puppet/parser/ast/resource.rb7
-rw-r--r--lib/puppet/parser/compiler.rb4
-rw-r--r--lib/puppet/parser/lexer.rb3
3 files changed, 8 insertions, 6 deletions
diff --git a/lib/puppet/parser/ast/resource.rb b/lib/puppet/parser/ast/resource.rb
index bd15d9935..ce3c499c5 100644
--- a/lib/puppet/parser/ast/resource.rb
+++ b/lib/puppet/parser/ast/resource.rb
@@ -53,10 +53,11 @@ class Resource < AST::Branch
:strict => true
)
- # And then store the resource in the compiler.
- # At some point, we need to switch all of this to return
- # resources instead of storing them like this.
+ if resource.resource_type.is_a? Puppet::Resource::Type
+ resource.resource_type.instantiate_resource(scope, resource)
+ end
scope.compiler.add_resource(scope, resource)
+ scope.compiler.evaluate_classes([resource_title],scope,false) if fully_qualified_type == 'class'
resource
end
}
diff --git a/lib/puppet/parser/compiler.rb b/lib/puppet/parser/compiler.rb
index e1227e753..c60e1d4fb 100644
--- a/lib/puppet/parser/compiler.rb
+++ b/lib/puppet/parser/compiler.rb
@@ -144,7 +144,7 @@ class Puppet::Parser::Compiler
if klass = scope.find_hostclass(name)
found << name and next if scope.class_scope(klass)
- resource = klass.mk_plain_resource(scope)
+ resource = klass.ensure_in_catalog(scope)
# If they've disabled lazy evaluation (which the :include function does),
# then evaluate our resource immediately.
@@ -220,7 +220,7 @@ class Puppet::Parser::Compiler
# Create a resource to model this node, and then add it to the list
# of resources.
- resource = astnode.mk_plain_resource(topscope)
+ resource = astnode.ensure_in_catalog(topscope)
resource.evaluate
diff --git a/lib/puppet/parser/lexer.rb b/lib/puppet/parser/lexer.rb
index 9036d652e..31d39ae2f 100644
--- a/lib/puppet/parser/lexer.rb
+++ b/lib/puppet/parser/lexer.rb
@@ -522,13 +522,14 @@ class Puppet::Parser::Lexer
# backslash; the caret is there to match empty strings
str = @scanner.scan_until(/([^\\]|^|[^\\])([\\]{2})*[#{terminators}]/) or lex_error "Unclosed quote after '#{last}' in '#{rest}'"
@line += str.count("\n") # literal carriage returns add to the line count.
- str.gsub!(/\\(.)/) {
+ str.gsub!(/\\(.)/m) {
ch = $1
if escapes.include? ch
case ch
when 'n'; "\n"
when 't'; "\t"
when 's'; " "
+ when "\n": ''
else ch
end
else