summaryrefslogtreecommitdiff
path: root/lib/coderay/encoders/lint.rb
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2016-02-13 15:57:11 +0100
committerKornelius Kalnbach <murphy@rubychan.de>2016-02-13 15:57:11 +0100
commit8d908474eff99a0a653bbc94f459537d56b83e92 (patch)
tree4b066ea50ca5f95f07782d0c58f8081c4c3ef39f /lib/coderay/encoders/lint.rb
parentbf395bd14ed7f63aab84955f6768f59965e3a73e (diff)
parent0a1f500d524ff0fb5eeafef051ccbb641954a87a (diff)
downloadcoderay-cleanup-output.tar.gz
Merge branch 'master' into cleanup-outputcleanup-output
Diffstat (limited to 'lib/coderay/encoders/lint.rb')
-rw-r--r--lib/coderay/encoders/lint.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/coderay/encoders/lint.rb b/lib/coderay/encoders/lint.rb
index 4601e90..88c8bd1 100644
--- a/lib/coderay/encoders/lint.rb
+++ b/lib/coderay/encoders/lint.rb
@@ -17,10 +17,12 @@ module Encoders
InvalidTokenStream = Class.new StandardError
EmptyToken = Class.new InvalidTokenStream
+ UnknownTokenKind = Class.new InvalidTokenStream
IncorrectTokenGroupNesting = Class.new InvalidTokenStream
def text_token text, kind
- raise EmptyToken, 'empty token' if text.empty?
+ raise EmptyToken, 'empty token for %p' % [kind] if text.empty?
+ raise UnknownTokenKind, 'unknown token kind %p (text was %p)' % [kind, text] unless TokenKinds.has_key? kind
end
def begin_group kind