diff options
author | murphy <murphy@rubychan.de> | 2006-07-11 05:40:21 +0000 |
---|---|---|
committer | murphy <murphy@rubychan.de> | 2006-07-11 05:40:21 +0000 |
commit | 7bb2aef0553091a10c197e302475c9f14de8a860 (patch) | |
tree | 72ea9444276fe97dc99ae82aa9e46070ec7ba9ea /lib/coderay/encoders/tokens.rb | |
parent | 26a8e5a0388199ac686db28d631b05a5b5aa02e1 (diff) | |
download | coderay-7bb2aef0553091a10c197e302475c9f14de8a860.tar.gz |
rake test now runs in debug mode.
All .rb files converted to UNIX format (where did the \r come from?)
Diffstat (limited to 'lib/coderay/encoders/tokens.rb')
-rw-r--r-- | lib/coderay/encoders/tokens.rb | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/lib/coderay/encoders/tokens.rb b/lib/coderay/encoders/tokens.rb index 743cc0e..2428589 100644 --- a/lib/coderay/encoders/tokens.rb +++ b/lib/coderay/encoders/tokens.rb @@ -1,44 +1,44 @@ -module CodeRay
-module Encoders
-
- # The Tokens encoder converts the tokens to a simple
- # readable format. It doesn't use colors and is mainly
- # intended for console output.
- #
- # The tokens are converted with Tokens.write_token.
- #
- # The format is:
- #
- # <token-kind> \t <escaped token-text> \n
- #
- # Example:
- #
- # require 'coderay'
- # puts CodeRay.scan("puts 3 + 4", :ruby).tokens
- #
- # prints:
- #
- # ident puts
- # space
- # integer 3
- # space
- # operator +
- # space
- # integer 4
- #
- class Tokens < Encoder
-
- include Streamable
- register_for :tokens
-
- FILE_EXTENSION = 'tok'
-
- protected
- def token *args
- @out << CodeRay::Tokens.write_token(*args)
- end
-
- end
-
-end
-end
+module CodeRay +module Encoders + + # The Tokens encoder converts the tokens to a simple + # readable format. It doesn't use colors and is mainly + # intended for console output. + # + # The tokens are converted with Tokens.write_token. + # + # The format is: + # + # <token-kind> \t <escaped token-text> \n + # + # Example: + # + # require 'coderay' + # puts CodeRay.scan("puts 3 + 4", :ruby).tokens + # + # prints: + # + # ident puts + # space + # integer 3 + # space + # operator + + # space + # integer 4 + # + class Tokens < Encoder + + include Streamable + register_for :tokens + + FILE_EXTENSION = 'tok' + + protected + def token *args + @out << CodeRay::Tokens.write_token(*args) + end + + end + +end +end |