From bf12a7879244fefa4a56c05166107e9b93333b95 Mon Sep 17 00:00:00 2001 From: murphy Date: Fri, 15 Oct 2010 22:57:48 +0000 Subject: Cleanup of debug encoder. --- lib/coderay/encoders/debug.rb | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'lib/coderay') 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 -- cgit v1.2.1