Sha256: f9c4fe925b8ea782cd5fb49655a8185f057c3bb0175c293e755dc09943a29c3a

Contents?: true

Size: 540 Bytes

Versions: 4

Compression:

Stored size: 540 Bytes

Contents

module CodeRay
	module Encoders

		# = Debug Encoder
		class Debug < Encoder

			include Streamable
			register_for :debug

			FILE_EXTENSION = 'raydebug'

		protected
			def text_token text, kind
				@out <<
					if kind == :space
						text
					else
						text = text.gsub(/[)\\]/, '\\\\\0')
						"#{kind}(#{text})"
					end					
			end

			def block_token action, kind
				@out << super
			end

			def open_token kind
				"#{kind}<"
			end

			def close_token kind
				">"
			end

		end

	end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
coderay-0.5.0.121 ./lib/coderay/encoders/debug.rb
coderay-0.5.0.115 ./lib/coderay/encoders/debug.rb
coderay-0.5.0.100 ./lib/coderay/encoders/debug.rb
coderay-0.4.5.73 ./lib/coderay/encoders/debug.rb