diff options
author | murphy <murphy@rubychan.de> | 2011-05-21 05:31:46 +0000 |
---|---|---|
committer | murphy <murphy@rubychan.de> | 2011-05-21 05:31:46 +0000 |
commit | 9dc849f57c6309c398403883a357a0003db4d91d (patch) | |
tree | 05de2812acba7f294ce3d1094c71fd13ee08192f /lib/coderay | |
parent | 3cf824cb66b56914724a511fead2afdba9899fe1 (diff) | |
download | coderay-9dc849f57c6309c398403883a357a0003db4d91d.tar.gz |
issue #43: replacing :reserved with :keyword for C and C++
Diffstat (limited to 'lib/coderay')
-rw-r--r-- | lib/coderay/scanners/c.rb | 6 | ||||
-rw-r--r-- | lib/coderay/scanners/cpp.rb | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/coderay/scanners/c.rb b/lib/coderay/scanners/c.rb index 03bc1b9..3be7fc2 100644 --- a/lib/coderay/scanners/c.rb +++ b/lib/coderay/scanners/c.rb @@ -7,7 +7,7 @@ module Scanners register_for :c file_extension 'c' - RESERVED_WORDS = [ + KEYWORDS = [ 'asm', 'break', 'case', 'continue', 'default', 'do', 'else', 'enum', 'for', 'goto', 'if', 'return', 'sizeof', 'struct', 'switch', 'typedef', 'union', 'while', @@ -31,7 +31,7 @@ module Scanners ] # :nodoc: IDENT_KIND = WordList.new(:ident). - add(RESERVED_WORDS, :reserved). + add(KEYWORDS, :keyword). add(PREDEFINED_TYPES, :predefined_type). add(DIRECTIVES, :directive). add(PREDEFINED_CONSTANTS, :predefined_constant) # :nodoc: @@ -80,7 +80,7 @@ module Scanners match << matched else label_expected = false - if kind == :reserved + if kind == :keyword case match when 'case', 'default' case_expected = true diff --git a/lib/coderay/scanners/cpp.rb b/lib/coderay/scanners/cpp.rb index 10b4c04..57eadd4 100644 --- a/lib/coderay/scanners/cpp.rb +++ b/lib/coderay/scanners/cpp.rb @@ -11,7 +11,7 @@ module Scanners title 'C++' #-- http://www.cppreference.com/wiki/keywords/start - RESERVED_WORDS = [ + KEYWORDS = [ 'and', 'and_eq', 'asm', 'bitand', 'bitor', 'break', 'case', 'catch', 'class', 'compl', 'const_cast', 'continue', 'default', 'delete', 'do', 'dynamic_cast', 'else', @@ -40,7 +40,7 @@ module Scanners ] # :nodoc: IDENT_KIND = WordList.new(:ident). - add(RESERVED_WORDS, :reserved). + add(KEYWORDS, :keyword). add(PREDEFINED_TYPES, :predefined_type). add(PREDEFINED_VARIABLES, :local_variable). add(DIRECTIVES, :directive). @@ -94,7 +94,7 @@ module Scanners match << matched else label_expected = false - if kind == :reserved + if kind == :keyword case match when 'class' state = :class_name_expected |