diff options
author | Kornelius Kalnbach <murphy@rubychan.de> | 2013-06-30 05:57:38 +0200 |
---|---|---|
committer | Kornelius Kalnbach <murphy@rubychan.de> | 2013-06-30 05:57:38 +0200 |
commit | dc57601571af8024700991b6a80129285a980e9e (patch) | |
tree | 5eea7c8958ec18bca96465f89fe4c8db992eaa1c /lib/coderay/encoders/debug_lint.rb | |
parent | fb8c0dbfd065e19419b30213efb8176a1e968945 (diff) | |
download | coderay-dc57601571af8024700991b6a80129285a980e9e.tar.gz |
add Lint encoder; do we still need DebugLint?
Diffstat (limited to 'lib/coderay/encoders/debug_lint.rb')
-rw-r--r-- | lib/coderay/encoders/debug_lint.rb | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/coderay/encoders/debug_lint.rb b/lib/coderay/encoders/debug_lint.rb index 17a0795..2c14186 100644 --- a/lib/coderay/encoders/debug_lint.rb +++ b/lib/coderay/encoders/debug_lint.rb @@ -1,6 +1,8 @@ module CodeRay module Encoders + load :lint + # = Debug Lint Encoder # # Debug encoder with additional checks for: @@ -15,12 +17,8 @@ module Encoders register_for :debug_lint - InvalidTokenStream = Class.new StandardError - EmptyToken = Class.new InvalidTokenStream - IncorrectTokenGroupNesting = Class.new InvalidTokenStream - def text_token text, kind - raise EmptyToken, 'empty token' if text.empty? + raise Lint::EmptyToken, 'empty token' if text.empty? super end @@ -30,7 +28,7 @@ module Encoders end def end_group kind - raise IncorrectTokenGroupNesting, 'We are inside %s, not %p (end_group)' % [@opened.reverse.map(&:inspect).join(' < '), kind] if @opened.last != kind + raise Lint::IncorrectTokenGroupNesting, 'We are inside %s, not %p (end_group)' % [@opened.reverse.map(&:inspect).join(' < '), kind] if @opened.last != kind @opened.pop super end @@ -41,7 +39,7 @@ module Encoders end def end_line kind - raise IncorrectTokenGroupNesting, 'We are inside %s, not %p (end_line)' % [@opened.reverse.map(&:inspect).join(' < '), kind] if @opened.last != kind + raise Lint::IncorrectTokenGroupNesting, 'We are inside %s, not %p (end_line)' % [@opened.reverse.map(&:inspect).join(' < '), kind] if @opened.last != kind @opened.pop super end |