diff options
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r-- | lib/puppet/parser/ast.rb | 9 | ||||
-rw-r--r-- | lib/puppet/parser/grammar.ra | 2 | ||||
-rw-r--r-- | lib/puppet/parser/parser.rb | 6 |
3 files changed, 10 insertions, 7 deletions
diff --git a/lib/puppet/parser/ast.rb b/lib/puppet/parser/ast.rb index 193f85eb1..d586a23f3 100644 --- a/lib/puppet/parser/ast.rb +++ b/lib/puppet/parser/ast.rb @@ -788,10 +788,13 @@ module Puppet values = {} super - # this won't work if we move away from only allowing constants - # here - # but for now, it's fine and useful + + # This won't work if we move away from only allowing + # constants here, but for now, it's fine and useful. @options.each { |option| + unless option.is_a?(CaseOpt) + raise Puppet::DevError, "Option is not a CaseOpt" + end if option.default? @default = option end diff --git a/lib/puppet/parser/grammar.ra b/lib/puppet/parser/grammar.ra index fa19ad477..b365625da 100644 --- a/lib/puppet/parser/grammar.ra +++ b/lib/puppet/parser/grammar.ra @@ -317,7 +317,7 @@ casestatement: CASE rvalue LBRACE caseopts RBRACE { end result = AST::CaseStatement.new( :test => val[1], - :options => val[3], + :options => options, :file => @lexer.file, :line => @lexer.line ) diff --git a/lib/puppet/parser/parser.rb b/lib/puppet/parser/parser.rb index afdcb4584..3bb0fc039 100644 --- a/lib/puppet/parser/parser.rb +++ b/lib/puppet/parser/parser.rb @@ -32,7 +32,7 @@ module Puppet class Parser < Racc::Parser -module_eval <<'..end grammar.ra modeval..idd1811897f0', 'grammar.ra', 635 +module_eval <<'..end grammar.ra modeval..ida8383b5566', 'grammar.ra', 635 attr_reader :file attr_accessor :files @@ -149,7 +149,7 @@ def string=(string) end # $Id$ -..end grammar.ra modeval..idd1811897f0 +..end grammar.ra modeval..ida8383b5566 ##### racc 1.4.4 generates ### @@ -950,7 +950,7 @@ module_eval <<'.,.,', 'grammar.ra', 324 end result = AST::CaseStatement.new( :test => val[1], - :options => val[3], + :options => options, :file => @lexer.file, :line => @lexer.line ) |