diff options
author | murphy <murphy@rubychan.de> | 2009-10-18 18:10:01 +0000 |
---|---|---|
committer | murphy <murphy@rubychan.de> | 2009-10-18 18:10:01 +0000 |
commit | 2c3f071eb694248f6b7635b3d7f25086b861f0e1 (patch) | |
tree | e4c17208ce6992bce23a32dca6400b099ce222e2 /lib/coderay/scanner.rb | |
parent | 32cf28f58e43b8efb51819f2a9ca2b5b91d6d40c (diff) | |
download | coderay-2c3f071eb694248f6b7635b3d7f25086b861f0e1.tar.gz |
Scanner sets KINDS_NOT_LOC, Tokens#scanner.
Diffstat (limited to 'lib/coderay/scanner.rb')
-rw-r--r-- | lib/coderay/scanner.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/coderay/scanner.rb b/lib/coderay/scanner.rb index 839b9fc..229ba19 100644 --- a/lib/coderay/scanner.rb +++ b/lib/coderay/scanner.rb @@ -43,6 +43,7 @@ module CodeRay # You can also use +map+, +any?+, +find+ and even +sort_by+, # if you want. class Scanner < StringScanner + extend Plugin plugin_host Scanners @@ -55,6 +56,8 @@ module CodeRay # # Define @default_options for subclasses. DEFAULT_OPTIONS = { :stream => false } + + KINDS_NOT_LOC = [:comment, :doctype] class << self @@ -128,6 +131,7 @@ module CodeRay "but :stream is #{@options[:stream]}" if block_given? @tokens ||= Tokens.new end + @tokens.scanner = self setup end |