summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r--lib/puppet/parser/ast.rb6
-rw-r--r--lib/puppet/parser/ast/objectdef.rb2
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/puppet/parser/ast.rb b/lib/puppet/parser/ast.rb
index c8cc74f04..5eb4ebaa2 100644
--- a/lib/puppet/parser/ast.rb
+++ b/lib/puppet/parser/ast.rb
@@ -11,8 +11,10 @@ module Puppet
# Do this so I don't have to type the full path in all of the subclasses
AST = Puppet::Parser::AST
- Puppet.setdefault(:typecheck, true)
- Puppet.setdefault(:paramcheck, true)
+ Puppet.setdefaults("ast",
+ [:typecheck, true, "Whether to validate types during parsing."],
+ [:paramcheck, true, "Whether to validate parameters during parsing."]
+ )
attr_accessor :line, :file, :parent
# Just used for 'tree', which is only used in debugging.
diff --git a/lib/puppet/parser/ast/objectdef.rb b/lib/puppet/parser/ast/objectdef.rb
index dc355be77..8b40bda71 100644
--- a/lib/puppet/parser/ast/objectdef.rb
+++ b/lib/puppet/parser/ast/objectdef.rb
@@ -221,7 +221,7 @@ class Puppet::Parser::AST
rescue => detail
raise Puppet::DevError, detail.to_s
end
- next if pname == "name" # always allow these
+ return if pname == "name" # always allow these
unless type.validattr?(pname)
error = Puppet::ParseError.new(
"Invalid parameter '%s' for type '%s'" %