Class: CodeRay::Scanners::Go

Inherits:
Scanner
  • Object
show all
Defined in:
lib/coderay/scanners/go.rb

Constant Summary collapse

KEYWORDS =
[
  'break', 'default', 'func', 'interface', 'select',
  'case', 'defer', 'go', 'map', 'struct',
  'chan', 'else', 'goto', 'package', 'switch',
  'const', 'fallthrough', 'if', 'range', 'type',
  'continue', 'for', 'import', 'return', 'var',
]
PREDEFINED_TYPES =
[
  'bool',
  'uint8', 'uint16', 'uint32', 'uint64',
  'int8', 'int16', 'int32', 'int64',
  'float32', 'float64',
  'complex64', 'complex128',
  'byte', 'rune', 'string', 'error',
  'uint', 'int', 'uintptr',
]
PREDEFINED_CONSTANTS =

:nodoc:

[
  'nil', 'iota',
  'true', 'false',
]
PREDEFINED_FUNCTIONS =

:nodoc:

%w[
  append cap close complex copy delete imag len
  make new panic print println real recover
]
IDENT_KIND =

:nodoc:

WordList.new(:ident).
add(KEYWORDS, :keyword).
add(PREDEFINED_TYPES, :predefined_type).
add(PREDEFINED_CONSTANTS, :predefined_constant).
add(PREDEFINED_FUNCTIONS, :predefined)
ESCAPE =

:nodoc:

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

:nodoc:

/ u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} /x

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