summaryrefslogtreecommitdiff
path: root/lib/coderay/token_kinds.rb
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2010-03-31 21:16:42 +0000
committermurphy <murphy@rubychan.de>2010-03-31 21:16:42 +0000
commit9b5bfe0be01bd888c2ba3fccf68585a72f608ef6 (patch)
tree3edb79db477e494daa6a5f1199ef1f9a6fa241f0 /lib/coderay/token_kinds.rb
parent571af4872007a242c9c78149d2ba80ae95e47e4d (diff)
downloadcoderay-9b5bfe0be01bd888c2ba3fccf68585a72f608ef6.tar.gz
Don't raise error for unknown token kinds unless in @$CODERAY_DEBUG@ mode.
Diffstat (limited to 'lib/coderay/token_kinds.rb')
-rwxr-xr-xlib/coderay/token_kinds.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/coderay/token_kinds.rb b/lib/coderay/token_kinds.rb
index c8e370c..29bacb4 100755
--- a/lib/coderay/token_kinds.rb
+++ b/lib/coderay/token_kinds.rb
@@ -1,7 +1,11 @@
module CodeRay
class Tokens
AbbreviationForKind = Hash.new do |h, k| # :nodoc:
- raise 'Undefined Token kind: %p' % [k] # :nodoc:
+ if $CODERAY_DEBUG
+ raise 'Undefined Token kind: %p' % [k] # :nodoc:
+ else
+ :NO_HIGHLIGHT
+ end
end
AbbreviationForKind.update with = { # :nodoc:
:annotation => 'at',