summaryrefslogtreecommitdiff
path: root/lib/coderay/token_kinds.rb
blob: bd8fd6c79bc03c2f1c61242c1668c11e61ee418f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
module CodeRay
  
  # A Hash of all known token kinds and their associated CSS classes.
  TokenKinds = Hash.new do |h, k|
    warn 'Undefined Token kind: %p' % [k] if $CODERAY_DEBUG
    false
  end
  
  # speedup
  TokenKinds.compare_by_identity if TokenKinds.respond_to? :compare_by_identity
  
  TokenKinds.update(  # :nodoc:
    :annotation          => 'annotation',
    :attribute_name      => 'attribute-name',
    :attribute_value     => 'attribute-value',
    :binary              => 'bin',
    :char                => 'char',
    :class               => 'class',
    :class_variable      => 'class-variable',
    :color               => 'color',
    :comment             => 'comment',
    :complex             => 'complex',
    :constant            => 'constant',
    :content             => 'content',
    :debug               => 'debug',
    :decorator           => 'decorator',
    :definition          => 'definition',
    :delimiter           => 'delimiter',
    :directive           => 'directive',
    :doc                 => 'doc',
    :doctype             => 'doctype',
    :doc_string          => 'doc-string',
    :entity              => 'entity',
    :error               => 'error',
    :escape              => 'escape',
    :exception           => 'exception',
    :filename            => 'filename',
    :float               => 'float',
    :function            => 'function',
    :global_variable     => 'global-variable',
    :hex                 => 'hex',
    :id                  => 'id',
    :imaginary           => 'imaginary',
    :important           => 'important',
    :include             => 'include',
    :inline              => 'inline',
    :inline_delimiter    => 'inline-delimiter',
    :instance_variable   => 'instance-variable',
    :integer             => 'integer',
    :key                 => 'key',
    :keyword             => 'keyword',
    :label               => 'label',
    :local_variable      => 'local-variable',
    :modifier            => 'modifier',
    :namespace           => 'namespace',
    :octal               => 'octal',
    :predefined          => 'predefined',
    :predefined_constant => 'predefined-constant',
    :predefined_type     => 'predefined-type',
    :preprocessor        => 'preprocessor',
    :pseudo_class        => 'pseudo-class',
    :regexp              => 'regexp',
    :reserved            => 'reserved',
    :shell               => 'shell',
    :string              => 'string',
    :symbol              => 'symbol',
    :tag                 => 'tag',
    :type                => 'type',
    :value               => 'value',
    :variable            => 'variable',
    
    :change              => 'change',
    :delete              => 'delete',
    :head                => 'head',
    :insert              => 'insert',
    
    :eyecatcher          => 'eyecatcher',
    
    :ident               => false,
    :operator            => false,
    
    :space               => false,
    :plain               => false
  )
  
  TokenKinds[:method]    = TokenKinds[:function]
  TokenKinds[:escape]    = TokenKinds[:delimiter]
  TokenKinds[:docstring] = TokenKinds[:comment]
end