summaryrefslogtreecommitdiff
path: root/lib/coderay
diff options
context:
space:
mode:
Diffstat (limited to 'lib/coderay')
-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