summaryrefslogtreecommitdiff
path: root/lib/coderay/scanners/raydebug.rb
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2013-06-23 14:35:17 +0200
committerKornelius Kalnbach <murphy@rubychan.de>2013-06-23 14:35:17 +0200
commit9651f0b464b6540a1427ea8320abaa01caf197b3 (patch)
tree184c42f0fe01ddce26b7d4cc42c124b695a20b3e /lib/coderay/scanners/raydebug.rb
parent14f3a4f28341237503a51bfa0764c922bb02bdfa (diff)
parentd7f1669cdf1d48204f3e1b0078d467da448c31d2 (diff)
downloadcoderay-9651f0b464b6540a1427ea8320abaa01caf197b3.tar.gz
Merge branch 'master' into upstream
Diffstat (limited to 'lib/coderay/scanners/raydebug.rb')
-rw-r--r--lib/coderay/scanners/raydebug.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/coderay/scanners/raydebug.rb b/lib/coderay/scanners/raydebug.rb
index 7a21354..d39d962 100644
--- a/lib/coderay/scanners/raydebug.rb
+++ b/lib/coderay/scanners/raydebug.rb
@@ -1,11 +1,11 @@
module CodeRay
module Scanners
-
+
# = Debug Scanner
#
# Parses the output of the Encoders::Debug encoder.
class Raydebug < Scanner
-
+
register_for :raydebug
file_extension 'raydebug'
title 'CodeRay Token Dump'
@@ -13,11 +13,11 @@ module Scanners
protected
def scan_tokens encoder, options
-
+
opened_tokens = []
-
+
until eos?
-
+
if match = scan(/\s+/)
encoder.text_token match, :space
@@ -26,7 +26,7 @@ module Scanners
encoder.text_token kind, :class
encoder.text_token '(', :operator
match = self[2]
- encoder.text_token match, kind.to_sym
+ encoder.text_token match, kind.to_sym unless match.empty?
encoder.text_token match, :operator if match = scan(/\)/)
elsif match = scan(/ (\w+) ([<\[]) /x)
@@ -59,8 +59,8 @@ module Scanners
encoder
end
-
+
end
-
+
end
end