diff options
author | murphy <murphy@rubychan.de> | 2011-06-16 00:53:18 +0000 |
---|---|---|
committer | murphy <murphy@rubychan.de> | 2011-06-16 00:53:18 +0000 |
commit | 4c8b5dac9d881b916a49e20401659bf107168e0b (patch) | |
tree | d5ce01f8257f61782a58184f2701149b7d2cc5a6 /lib/coderay | |
parent | 3f5a6704e84b436d6cdb4110740af0c89222d520 (diff) | |
download | coderay-4c8b5dac9d881b916a49e20401659bf107168e0b.tar.gz |
changed :reserved to :keyword in Ruby scanner (issue #43)
Diffstat (limited to 'lib/coderay')
-rw-r--r-- | lib/coderay/scanners/ruby.rb | 2 | ||||
-rw-r--r-- | lib/coderay/scanners/ruby/patterns.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/coderay/scanners/ruby.rb b/lib/coderay/scanners/ruby.rb index 549ae87..299accc 100644 --- a/lib/coderay/scanners/ruby.rb +++ b/lib/coderay/scanners/ruby.rb @@ -90,7 +90,7 @@ module Scanners if match[/\A[A-Z]/] && !(match[/[!?]$/] || match?(/\(/)) kind = :constant end - elsif kind == :reserved + elsif kind == :keyword state = patterns::KEYWORD_NEW_STATE[match] value_expected = true if patterns::KEYWORDS_EXPECTING_VALUE[match] end diff --git a/lib/coderay/scanners/ruby/patterns.rb b/lib/coderay/scanners/ruby/patterns.rb index 5acb25e..a52198e 100644 --- a/lib/coderay/scanners/ruby/patterns.rb +++ b/lib/coderay/scanners/ruby/patterns.rb @@ -4,7 +4,7 @@ module Scanners module Ruby::Patterns # :nodoc: all - RESERVED_WORDS = %w[ + KEYWORDS = %w[ and def end in or unless begin defined? ensure module redo super until BEGIN break do next rescue then @@ -26,7 +26,7 @@ module Scanners ] IDENT_KIND = WordList.new(:ident). - add(RESERVED_WORDS, :reserved). + add(KEYWORDS, :keyword). add(PREDEFINED_CONSTANTS, :predefined_constant) KEYWORD_NEW_STATE = WordList.new(:initial). |