diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-01-12 17:53:45 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-01-12 17:53:45 +0000 |
| commit | 4092a7802aa05dcc456a31d51bf2d8e3a42cd503 (patch) | |
| tree | e5380a90b114b9ff5e4d24a9a31ea740686f99b5 /lib/puppet/parser | |
| parent | c5782dfb9aa6ecfab045d348a7d07e38bcb4a8e2 (diff) | |
| download | puppet-4092a7802aa05dcc456a31d51bf2d8e3a42cd503.tar.gz puppet-4092a7802aa05dcc456a31d51bf2d8e3a42cd503.tar.xz puppet-4092a7802aa05dcc456a31d51bf2d8e3a42cd503.zip | |
Fixed a couple of warnings, fixed a critical bug having to do with case statements (where there is only one listed option), and did a couple of other cleanups.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@814 980ebf18-57e1-0310-9a29-db15c13687c0
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 ) |
