diff options
author | murphy <murphy@rubychan.de> | 2009-10-19 17:22:26 +0000 |
---|---|---|
committer | murphy <murphy@rubychan.de> | 2009-10-19 17:22:26 +0000 |
commit | b8ffbc27640f3f2a2d6a30a9a340cbe939e0c99c (patch) | |
tree | 1a3995b219fb851ebd5ab0f08e1642e0b31d7462 /lib/coderay/scanners | |
parent | 70b9baf4ad1487b67a343078cdc750203ac6c70d (diff) | |
download | coderay-b8ffbc27640f3f2a2d6a30a9a340cbe939e0c99c.tar.gz |
Updated Groovy scanner: using word lists from Java scanner.
Diffstat (limited to 'lib/coderay/scanners')
-rw-r--r-- | lib/coderay/scanners/groovy.rb | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/lib/coderay/scanners/groovy.rb b/lib/coderay/scanners/groovy.rb index 9486beb..e8901bf 100644 --- a/lib/coderay/scanners/groovy.rb +++ b/lib/coderay/scanners/groovy.rb @@ -9,25 +9,17 @@ module Scanners register_for :groovy # TODO: Check this! - KEYWORDS = Java::KEYWORDS + %w[ + GROOVY_KEYWORDS = %w[ as assert def in ] KEYWORDS_EXPECTING_VALUE = WordList.new.add %w[ case instanceof new return throw typeof while as assert in ] + GROOVY_MAGIC_VARIABLES = %w[ it ] - MAGIC_VARIABLES = Java::MAGIC_VARIABLES + %w[ it ] - # DIRECTIVES = %w[ - # abstract extends final implements native private protected public - # static strictfp synchronized threadsafe throws transient volatile - # ] - - IDENT_KIND = WordList.new(:ident). - add(KEYWORDS, :keyword). - add(MAGIC_VARIABLES, :local_variable). - add(TYPES, :type). - add(BuiltinTypes::List, :pre_type). - add(DIRECTIVES, :directive) + IDENT_KIND = Java::IDENT_KIND.dup. + add(GROOVY_KEYWORDS, :keyword). + add(GROOVY_MAGIC_VARIABLES, :local_variable) ESCAPE = / [bfnrtv$\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} /x UNICODE_ESCAPE = / u[a-fA-F0-9]{4} /x # no 4-byte unicode chars? U[a-fA-F0-9]{8} |