diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-05-25 00:31:28 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-05-25 00:31:28 +0000 |
| commit | 62a4d4c91df2aa6e7a6f28dfdf81f95f28987216 (patch) | |
| tree | 324aaf518981a1c6d4bf75b54c2119a82d76c0cf /lib/puppet/parser/grammar.ra | |
| parent | 2b372df7038a268eee31372f62e8cf6be989b09e (diff) | |
| download | puppet-62a4d4c91df2aa6e7a6f28dfdf81f95f28987216.tar.gz puppet-62a4d4c91df2aa6e7a6f28dfdf81f95f28987216.tar.xz puppet-62a4d4c91df2aa6e7a6f28dfdf81f95f28987216.zip | |
Adding better error reporting on unmatched brackets -- you will now get notification of what was expected in most cases
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2531 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/parser/grammar.ra')
| -rw-r--r-- | lib/puppet/parser/grammar.ra | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/puppet/parser/grammar.ra b/lib/puppet/parser/grammar.ra index c8130ccf0..2d09c9671 100644 --- a/lib/puppet/parser/grammar.ra +++ b/lib/puppet/parser/grammar.ra @@ -655,6 +655,9 @@ end # Raise a Parse error. def error(message) + if brace = @lexer.expected + message += "; expected '%s'" + end except = Puppet::ParseError.new(message) except.line = @lexer.line if @lexer.file @@ -758,6 +761,10 @@ def on_error(token,value,stack) # [@lexer.line,@lexer.last] error = "Syntax error at '%s'" % [value] + if brace = @lexer.expected + error += "; expected '%s'" % brace + end + except = Puppet::ParseError.new(error) except.line = @lexer.line if @lexer.file |
