summaryrefslogtreecommitdiff
path: root/lib/coderay/scanners/debug.rb
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2011-03-01 00:30:15 +0000
committermurphy <murphy@rubychan.de>2011-03-01 00:30:15 +0000
commit9adbbf5913979b3e73d6a01d83530ac88748abad (patch)
treed0313998a65eb6181e4e9e6373d009fc99e1d270 /lib/coderay/scanners/debug.rb
parent1b964e718e552b7b4025a8c8f217e6b0f18349e5 (diff)
downloadcoderay-9adbbf5913979b3e73d6a01d83530ac88748abad.tar.gz
Debug scanner, please use TokenKinds.
Diffstat (limited to 'lib/coderay/scanners/debug.rb')
-rw-r--r--lib/coderay/scanners/debug.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/coderay/scanners/debug.rb b/lib/coderay/scanners/debug.rb
index 86a7962..566bfa7 100644
--- a/lib/coderay/scanners/debug.rb
+++ b/lib/coderay/scanners/debug.rb
@@ -1,29 +1,29 @@
module CodeRay
module Scanners
-
+
# = Debug Scanner
#
# Interprets the output of the Encoders::Debug encoder.
class Debug < Scanner
-
+
register_for :debug
title 'CodeRay Token Dump Import'
protected
def scan_tokens encoder, options
-
+
opened_tokens = []
-
+
until eos?
-
+
if match = scan(/\s+/)
encoder.text_token match, :space
elsif match = scan(/ (\w+) \( ( [^\)\\]* ( \\. [^\)\\]* )* ) \)? /x)
kind = self[1].to_sym
- match = self[2].gsub(/\\(.)/, '\1')
- unless Tokens::AbbreviationForKind.has_key? kind
+ match = self[2].gsub(/\\(.)/m, '\1')
+ unless TokenKinds.has_key? kind
kind = :error
match = matched
end
@@ -58,8 +58,8 @@ module Scanners
encoder
end
-
+
end
-
+
end
end