diff options
author | Luke Kanies <luke@madstop.com> | 2007-10-05 17:46:30 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2007-10-05 17:46:30 -0500 |
commit | cdaad286b1fe5fc3c1ab363c890bb6a8a752c9b5 (patch) | |
tree | 91a6841945eb2766f2ab9591ddc2b9ca5e0cd357 | |
parent | 7d7e428df34077062aebb8f08f10eef42d0c8907 (diff) | |
download | puppet-cdaad286b1fe5fc3c1ab363c890bb6a8a752c9b5.tar.gz puppet-cdaad286b1fe5fc3c1ab363c890bb6a8a752c9b5.tar.xz puppet-cdaad286b1fe5fc3c1ab363c890bb6a8a752c9b5.zip |
Fixing error thrown when the end of the file is encountered unexpectedly
-rw-r--r-- | lib/puppet/parser/parser_support.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/puppet/parser/parser_support.rb b/lib/puppet/parser/parser_support.rb index 8cf0dcfe8..acf3c9f7c 100644 --- a/lib/puppet/parser/parser_support.rb +++ b/lib/puppet/parser/parser_support.rb @@ -366,10 +366,12 @@ class Puppet::Parser::Parser end def on_error(token,value,stack) - #on '%s' at '%s' in\n'%s'" % [token,value,stack] - #error = "line %s: parse error after '%s'" % - # [@lexer.line,@lexer.last] - error = "Syntax error at '%s'" % [value] + if token == 0 # denotes end of file + value = 'end of file' + else + value = "'%s'" % value + end + error = "Syntax error at %s" % [value] if brace = @lexer.expected error += "; expected '%s'" % brace |