diff options
Diffstat (limited to 'lib/coderay/scanners/delphi.rb')
-rw-r--r-- | lib/coderay/scanners/delphi.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/coderay/scanners/delphi.rb b/lib/coderay/scanners/delphi.rb index 77c3839..d02c632 100644 --- a/lib/coderay/scanners/delphi.rb +++ b/lib/coderay/scanners/delphi.rb @@ -109,7 +109,11 @@ module CodeRay module Scanners end
match ||= matched
- raise [match, kind], tokens if kind == :error
+ if $DEBUG and (not kind or kind == :error)
+ raise_inspect 'Error token %p in line %d' %
+ [[match, kind], line], tokens
+ end
+ raise_inspect 'Empty token', tokens unless match
tokens << [match, kind]
|