To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / vendor / gems / coderay-0.9.7 / lib / coderay / token_classes.rb @ 442:753f1380d6bc
History | View | Annotate | Download (2.23 KB)
| 1 |
module CodeRay |
|---|---|
| 2 |
class Tokens |
| 3 |
ClassOfKind = Hash.new do |h, k| |
| 4 |
h[k] = k.to_s |
| 5 |
end
|
| 6 |
ClassOfKind.update with = {
|
| 7 |
:annotation => 'at', |
| 8 |
:attribute_name => 'an', |
| 9 |
:attribute_name_fat => 'af', |
| 10 |
:attribute_value => 'av', |
| 11 |
:attribute_value_fat => 'aw', |
| 12 |
:bin => 'bi', |
| 13 |
:char => 'ch', |
| 14 |
:class => 'cl', |
| 15 |
:class_variable => 'cv', |
| 16 |
:color => 'cr', |
| 17 |
:comment => 'c', |
| 18 |
:complex => 'cm', |
| 19 |
:constant => 'co', |
| 20 |
:content => 'k', |
| 21 |
:decorator => 'de', |
| 22 |
:definition => 'df', |
| 23 |
:delimiter => 'dl', |
| 24 |
:directive => 'di', |
| 25 |
:doc => 'do', |
| 26 |
:doctype => 'dt', |
| 27 |
:doc_string => 'ds', |
| 28 |
:entity => 'en', |
| 29 |
:error => 'er', |
| 30 |
:escape => 'e', |
| 31 |
:exception => 'ex', |
| 32 |
:float => 'fl', |
| 33 |
:function => 'fu', |
| 34 |
:global_variable => 'gv', |
| 35 |
:hex => 'hx', |
| 36 |
:imaginary => 'cm', |
| 37 |
:important => 'im', |
| 38 |
:include => 'ic', |
| 39 |
:inline => 'il', |
| 40 |
:inline_delimiter => 'idl', |
| 41 |
:instance_variable => 'iv', |
| 42 |
:integer => 'i', |
| 43 |
:interpreted => 'in', |
| 44 |
:keyword => 'kw', |
| 45 |
:key => 'ke', |
| 46 |
:label => 'la', |
| 47 |
:local_variable => 'lv', |
| 48 |
:modifier => 'mod', |
| 49 |
:oct => 'oc', |
| 50 |
:operator_fat => 'of', |
| 51 |
:pre_constant => 'pc', |
| 52 |
:pre_type => 'pt', |
| 53 |
:predefined => 'pd', |
| 54 |
:preprocessor => 'pp', |
| 55 |
:pseudo_class => 'ps', |
| 56 |
:regexp => 'rx', |
| 57 |
:reserved => 'r', |
| 58 |
:shell => 'sh', |
| 59 |
:string => 's', |
| 60 |
:symbol => 'sy', |
| 61 |
:tag => 'ta', |
| 62 |
:tag_fat => 'tf', |
| 63 |
:tag_special => 'ts', |
| 64 |
:type => 'ty', |
| 65 |
:variable => 'v', |
| 66 |
:value => 'vl', |
| 67 |
:xml_text => 'xt', |
| 68 |
|
| 69 |
:insert => 'ins', |
| 70 |
:delete => 'del', |
| 71 |
:change => 'chg', |
| 72 |
:head => 'head', |
| 73 |
|
| 74 |
:ident => :NO_HIGHLIGHT, # 'id' |
| 75 |
#:operator => 'op',
|
| 76 |
:operator => :NO_HIGHLIGHT, # 'op' |
| 77 |
:space => :NO_HIGHLIGHT, # 'sp' |
| 78 |
:plain => :NO_HIGHLIGHT, |
| 79 |
} |
| 80 |
ClassOfKind[:method] = ClassOfKind[:function] |
| 81 |
ClassOfKind[:open] = ClassOfKind[:close] = ClassOfKind[:delimiter] |
| 82 |
ClassOfKind[:nesting_delimiter] = ClassOfKind[:delimiter] |
| 83 |
ClassOfKind[:escape] = ClassOfKind[:delimiter] |
| 84 |
#ClassOfKind.default = ClassOfKind[:error] or raise 'no class found for :error!'
|
| 85 |
end
|
| 86 |
end
|