diff options
Diffstat (limited to 'lib/coderay')
-rw-r--r-- | lib/coderay/helpers/word_list.rb | 6 | ||||
-rw-r--r-- | lib/coderay/scanner.rb | 4 | ||||
-rw-r--r-- | lib/coderay/scanners/delphi.rb | 4 | ||||
-rw-r--r-- | lib/coderay/scanners/html.rb | 5 | ||||
-rw-r--r-- | lib/coderay/scanners/php.rb | 2 | ||||
-rw-r--r-- | lib/coderay/scanners/sql.rb | 2 |
6 files changed, 10 insertions, 13 deletions
diff --git a/lib/coderay/helpers/word_list.rb b/lib/coderay/helpers/word_list.rb index 7f8eba6..ea969c3 100644 --- a/lib/coderay/helpers/word_list.rb +++ b/lib/coderay/helpers/word_list.rb @@ -15,7 +15,7 @@ module CodeRay # WordList is optimized to be used in Scanners, # typically to decide whether a given ident is a special token. # - # For case insensitive words use CaseIgnoringWordList. + # For case insensitive words use WordList::CaseIgnoring. # # Example: # @@ -60,9 +60,9 @@ module CodeRay end - # A CaseIgnoringWordList is like a WordList, only that + # A CaseIgnoring WordList is like a WordList, only that # keys are compared case-insensitively (normalizing keys using +downcase+). - class CaseIgnoringWordList < WordList + class WordList::CaseIgnoring < WordList def [] key super key.downcase diff --git a/lib/coderay/scanner.rb b/lib/coderay/scanner.rb index e638c2c..ec89b87 100644 --- a/lib/coderay/scanner.rb +++ b/lib/coderay/scanner.rb @@ -4,8 +4,6 @@ require 'strscan' module CodeRay autoload :WordList, 'coderay/helpers/word_list' - # FIXME: Rename CaseIgnoringWordList to WordList::CaseIgnoring. - autoload :CaseIgnoringWordList, 'coderay/helpers/word_list' # = Scanners # @@ -155,7 +153,7 @@ module CodeRay setup end - # Sets back the scanner. Subclasses should to define the reset_instance + # Sets back the scanner. Subclasses should redefine the reset_instance # method instead of this one. def reset super diff --git a/lib/coderay/scanners/delphi.rb b/lib/coderay/scanners/delphi.rb index 1361869..b328155 100644 --- a/lib/coderay/scanners/delphi.rb +++ b/lib/coderay/scanners/delphi.rb @@ -33,11 +33,11 @@ module Scanners 'virtual', 'write', 'writeonly', ] # :nodoc: - IDENT_KIND = CaseIgnoringWordList.new(:ident). + IDENT_KIND = WordList::CaseIgnoring.new(:ident). add(KEYWORDS, :keyword). add(DIRECTIVES, :directive) # :nodoc: - NAME_FOLLOWS = CaseIgnoringWordList.new(false). + NAME_FOLLOWS = WordList::CaseIgnoring.new(false). add(%w(procedure function .)) # :nodoc: protected diff --git a/lib/coderay/scanners/html.rb b/lib/coderay/scanners/html.rb index 2f57e44..206ace0 100644 --- a/lib/coderay/scanners/html.rb +++ b/lib/coderay/scanners/html.rb @@ -32,7 +32,7 @@ module Scanners onvolumechange onwaiting ) - IN_ATTRIBUTE = CaseIgnoringWordList.new(nil). + IN_ATTRIBUTE = WordList::CaseIgnoring.new(nil). add(EVENT_ATTRIBUTES, :script) ATTR_NAME = /[\w.:-]+/ # :nodoc: @@ -58,8 +58,7 @@ module Scanners '"' => /[^&">\n]+/, } # :nodoc: - def reset # :nodoc: - # FIXME: why not overwrite reset_instance? + def reset_instance # :nodoc: super @state = :initial end diff --git a/lib/coderay/scanners/php.rb b/lib/coderay/scanners/php.rb index b2632a2..dadab00 100644 --- a/lib/coderay/scanners/php.rb +++ b/lib/coderay/scanners/php.rb @@ -181,7 +181,7 @@ module Scanners $argc $argv ] - IDENT_KIND = CaseIgnoringWordList.new(:ident). + IDENT_KIND = WordList::CaseIgnoring.new(:ident). add(KEYWORDS, :keyword). add(TYPES, :predefined_type). add(LANGUAGE_CONSTRUCTS, :keyword). diff --git a/lib/coderay/scanners/sql.rb b/lib/coderay/scanners/sql.rb index 807a41d..bb460cc 100644 --- a/lib/coderay/scanners/sql.rb +++ b/lib/coderay/scanners/sql.rb @@ -42,7 +42,7 @@ module CodeRay module Scanners PREDEFINED_CONSTANTS = %w( null true false ) - IDENT_KIND = CaseIgnoringWordList.new(:ident). + IDENT_KIND = WordList::CaseIgnoring.new(:ident). add(KEYWORDS, :keyword). add(OBJECTS, :type). add(COMMANDS, :class). |