summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/scope.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/parser/scope.rb')
-rw-r--r--lib/puppet/parser/scope.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/puppet/parser/scope.rb b/lib/puppet/parser/scope.rb
index 27de8ffd8..7239feb17 100644
--- a/lib/puppet/parser/scope.rb
+++ b/lib/puppet/parser/scope.rb
@@ -631,6 +631,10 @@ module Puppet::Parser
# hash. We store the object ID, not class name, so that we
# can support multiple unrelated classes with the same name.
def setclass(id, name)
+ unless name =~ /^[a-z]\w*$/
+ raise Puppet::ParseError, "Invalid class name '%s'" % name
+ end
+
if self.topscope?
@classtable[id] = name
else