From 9b5bfe0be01bd888c2ba3fccf68585a72f608ef6 Mon Sep 17 00:00:00 2001 From: murphy Date: Wed, 31 Mar 2010 21:16:42 +0000 Subject: Don't raise error for unknown token kinds unless in @$CODERAY_DEBUG@ mode. --- lib/coderay/token_kinds.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/coderay') 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', -- cgit v1.2.1