From 2c3f071eb694248f6b7635b3d7f25086b861f0e1 Mon Sep 17 00:00:00 2001 From: murphy Date: Sun, 18 Oct 2009 18:10:01 +0000 Subject: Scanner sets KINDS_NOT_LOC, Tokens#scanner. --- lib/coderay/scanner.rb | 4 ++++ 1 file changed, 4 insertions(+) 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 -- cgit v1.2.1