summaryrefslogtreecommitdiff
path: root/lib/rdoc/parser
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rdoc/parser')
-rw-r--r--lib/rdoc/parser/ruby.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/rdoc/parser/ruby.rb b/lib/rdoc/parser/ruby.rb
index e00d727f9e..26757256ad 100644
--- a/lib/rdoc/parser/ruby.rb
+++ b/lib/rdoc/parser/ruby.rb
@@ -540,8 +540,10 @@ class RDoc::RubyLex
begin
tk = @OP.match(self)
@space_seen = TkSPACE === tk
- rescue SyntaxError
- abort if @exception_on_syntax_error
+ rescue SyntaxError => e
+ raise RDoc::Error, "syntax error: #{e.message}" if
+ @exception_on_syntax_error
+
tk = TkError.new(line_no, char_no)
end
end while @skip_space and TkSPACE === tk