Class: CodeRay::Scanners::Groovy

Inherits:
Java
  • Object
show all
Defined in:
lib/coderay/scanners/groovy.rb

Overview

Scanner for Groovy.

Constant Summary collapse

GROOVY_KEYWORDS =

TODO: check list of keywords

%w[
  as assert def in
]
KEYWORDS_EXPECTING_VALUE =

:nodoc:

WordList.new.add %w[
  case instanceof new return throw typeof while as assert in
]
GROOVY_MAGIC_VARIABLES =

:nodoc:

%w[ it ]
IDENT_KIND =

:nodoc:

Java::IDENT_KIND.dup.
add(GROOVY_KEYWORDS, :keyword).
add(GROOVY_MAGIC_VARIABLES, :local_variable)
ESCAPE =

:nodoc:

/ [bfnrtv$\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} /x
UNICODE_ESCAPE =

:nodoc: no 4-byte unicode chars? U8

/ u[a-fA-F0-9]{4} /x
REGEXP_ESCAPE =

:nodoc:

/ [bfnrtv\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} | \d | [bBdDsSwW\/] /x
STRING_CONTENT_PATTERN =

TODO: interpretation inside ‘, “, /

{
  "'" => /(?>\\[^\\'\n]+|[^\\'\n]+)+/,
  '"' => /[^\\$"\n]+/,
  "'''" => /(?>[^\\']+|'(?!''))+/,
  '"""' => /(?>[^\\$"]+|"(?!""))+/,
  '/' => /[^\\$\/\n]+/,
}

Constants inherited from Java

Java::CONSTANTS, Java::DIRECTIVES, Java::IDENT, Java::KEYWORDS, Java::MAGIC_VARIABLES, Java::RESERVED, Java::TYPES

Constants inherited from Scanner

Scanner::DEFAULT_OPTIONS, Scanner::KINDS_NOT_LOC, Scanner::ScanError

Instance Attribute Summary

Attributes inherited from Scanner

#state

Attributes included from Plugin

#plugin_id

Method Summary

Methods inherited from Scanner

#binary_string, #column, #each, encoding, file_extension, #file_extension, #initialize, #lang, lang, #line, normalize, #reset, #string=, #tokenize, #tokens

Methods included from Plugin

#aliases, #plugin_host, #register_for, #title

Constructor Details

This class inherits a constructor from CodeRay::Scanners::Scanner