diff options
Diffstat (limited to 'lib/coderay/encoders')
-rw-r--r-- | lib/coderay/encoders/debug.rb | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/lib/coderay/encoders/debug.rb b/lib/coderay/encoders/debug.rb index ef76192..08f1309 100644 --- a/lib/coderay/encoders/debug.rb +++ b/lib/coderay/encoders/debug.rb @@ -1,6 +1,6 @@ module CodeRay module Encoders - + # = Debug Encoder # # Fast encoder producing simple debug output. @@ -13,18 +13,16 @@ module Encoders # # See also: Scanners::Debug class Debug < Encoder - + register_for :debug - + FILE_EXTENSION = 'raydebug' def initialize options = {} super @opened = [] end - - public - + def text_token text, kind if kind == :space @out << text @@ -34,12 +32,12 @@ module Encoders @out << kind.to_s << '(' << text << ')' end end - + def begin_group kind @opened << kind @out << kind.to_s << '<' end - + def end_group kind if @opened.last != kind puts @out @@ -48,16 +46,16 @@ module Encoders @opened.pop @out << '>' end - + def begin_line kind @out << kind.to_s << '[' end - + def end_line kind @out << ']' end - + end - + end end |