diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-01-18 17:24:15 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-01-18 17:24:15 +0000 |
| commit | 6bab167dcbb274fd302a65d567d6af0ef6621b79 (patch) | |
| tree | 92093e971bab20400ac8218a5cf1b159e64b5cbb /lib/puppet/parser/parser.rb | |
| parent | ed39be9dd2ecdbe9a8624ed2f6c03334e123e81d (diff) | |
| download | puppet-6bab167dcbb274fd302a65d567d6af0ef6621b79.tar.gz puppet-6bab167dcbb274fd302a65d567d6af0ef6621b79.tar.xz puppet-6bab167dcbb274fd302a65d567d6af0ef6621b79.zip | |
Made lots of small changes, mostly to help usability but also fixed a couple of key bugs
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@841 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/parser/parser.rb')
| -rw-r--r-- | lib/puppet/parser/parser.rb | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/lib/puppet/parser/parser.rb b/lib/puppet/parser/parser.rb index c50e65cac..582283704 100644 --- a/lib/puppet/parser/parser.rb +++ b/lib/puppet/parser/parser.rb @@ -14,10 +14,7 @@ require 'puppet/parser/ast' #require 'puppet/parser/interpreter' module Puppet - # this exception class already has a :stack accessor - class ParseError < Puppet::Error - attr_accessor :line, :file - end + class ParseError < Puppet::Error; end class ImportError < Racc::ParseError; end end @@ -32,7 +29,7 @@ module Puppet class Parser < Racc::Parser -module_eval <<'..end grammar.ra modeval..id082f0a899d', 'grammar.ra', 697 +module_eval <<'..end grammar.ra modeval..idc16574e75e', 'grammar.ra', 697 attr_reader :file attr_accessor :files @@ -103,7 +100,7 @@ def parse error = Puppet::ParseError.new(except) error.line = @lexer.line error.file = @lexer.file - error.stack = caller + error.backtrace = except.backtrace raise error rescue Puppet::ParseError => except except.line ||= @lexer.line @@ -113,7 +110,6 @@ def parse # and this is a framework error except.line ||= @lexer.line except.file ||= @lexer.file - except.stack ||= except.stack #if Puppet[:debug] # puts except.stack #end @@ -121,7 +117,6 @@ def parse rescue Puppet::DevError => except except.line ||= @lexer.line except.file ||= @lexer.file - except.stack ||= caller #if Puppet[:debug] # puts except.stack #end @@ -130,7 +125,7 @@ def parse error = Puppet::DevError.new(except.message) error.line = @lexer.line error.file = @lexer.file - error.stack = caller + error.backtrace = except.backtrace #if Puppet[:debug] # puts caller #end @@ -149,7 +144,7 @@ def string=(string) end # $Id$ -..end grammar.ra modeval..id082f0a899d +..end grammar.ra modeval..idc16574e75e ##### racc 1.4.4 generates ### @@ -1404,13 +1399,16 @@ module_eval <<'.,.,', 'grammar.ra', 659 end .,., -module_eval <<'.,.,', 'grammar.ra', 668 +module_eval <<'.,.,', 'grammar.ra', 671 def _reduce_90( val, _values, result ) if val[1].is_a?(AST::ASTArray) result = val[1] else - result = AST::ASTArray.new - result.push val[1] + result = AST::ASTArray.new( + :line => @lexer.line, + :file => @lexer.file, + :children => [val[1]] + ) end result end @@ -1422,7 +1420,7 @@ module_eval <<'.,.,', 'grammar.ra', 668 # reduce 93 omitted -module_eval <<'.,.,', 'grammar.ra', 673 +module_eval <<'.,.,', 'grammar.ra', 676 def _reduce_94( val, _values, result ) result = nil result |
