coderay 1.0.0.815pre → 1.0.0.831pre

Sign up to get free protection for your applications and to get access to all the features.
data/lib/coderay.rb CHANGED
@@ -159,8 +159,7 @@ module CodeRay
159
159
  # See also demo/demo_simple.
160
160
  def scan code, lang, options = {}, &block
161
161
  # FIXME: return a proxy for direct-stream encoding
162
- scanner = Scanners[lang].new code, options, &block
163
- scanner.tokenize
162
+ scanner(lang, options, &block).tokenize code
164
163
  end
165
164
 
166
165
  # Scans +filename+ (a path to a code file) with the Scanner for +lang+.
@@ -175,11 +174,9 @@ module CodeRay
175
174
  # require 'coderay'
176
175
  # page = CodeRay.scan_file('some_c_code.c').html
177
176
  def scan_file filename, lang = :auto, options = {}, &block
178
- file = IO.read filename
179
- if lang == :auto
180
- lang = FileType.fetch filename, :text, true
181
- end
182
- scan file, lang, options = {}, &block
177
+ lang = FileType.fetch filename, :text, true if lang == :auto
178
+ code = File.read filename
179
+ scan code, lang, options = {}, &block
183
180
  end
184
181
 
185
182
  # Encode a string.
@@ -261,8 +258,8 @@ module CodeRay
261
258
  # +options+ to it.
262
259
  #
263
260
  # See Scanner.new.
264
- def scanner lang, options = {}
265
- Scanners[lang].new '', options
261
+ def scanner lang, options = {}, &block
262
+ Scanners[lang].new '', options, &block
266
263
  end
267
264
 
268
265
  # Extract the options for the scanner from the +options+ hash.
@@ -8,7 +8,8 @@ module Encoders
8
8
  :remove_comments => :comment_filter,
9
9
  :stats => :statistic,
10
10
  :term => :terminal,
11
- :tty => :terminal
11
+ :tty => :terminal,
12
+ :yml => :yaml
12
13
 
13
14
  # No default because Tokens#nonsense should raise NoMethodError.
14
15
 
@@ -21,7 +21,6 @@ module Encoders
21
21
  # :line_numbers => :inline,
22
22
  # :css => :style
23
23
  # )
24
- # #-> <span class="no">1</span> <span style="color:#036; font-weight:bold;">Some</span> code
25
24
  #
26
25
  # == Options
27
26
  #
@@ -84,7 +84,7 @@ module Encoders
84
84
  line_number_text = bolding.call line_number
85
85
  indent = ' ' * (max_width - line_number.to_s.size) # TODO: Optimize (10^x)
86
86
  line_number += 1
87
- "<span class=\"no\">#{indent}#{line_number_text}</span>#{open}#{line}#{close}\n"
87
+ "<span class=\"line-numbers\">#{indent}#{line_number_text}</span>#{open}#{line}#{close}\n"
88
88
  end
89
89
 
90
90
  when :table
@@ -124,7 +124,7 @@ module Encoders
124
124
 
125
125
  TABLE = Template.new <<-TABLE
126
126
  <table class="CodeRay"><tr>
127
- <td class="line_numbers" title="double click to toggle" ondblclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"><pre><%LINE_NUMBERS%></pre></td>
127
+ <td class="line-numbers" title="double click to toggle" ondblclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"><pre><%LINE_NUMBERS%></pre></td>
128
128
  <td class="code"><pre><%CONTENT%></pre></td>
129
129
  </tr></table>
130
130
  TABLE
@@ -136,7 +136,7 @@ module Encoders
136
136
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
137
137
  <title></title>
138
138
  <style type="text/css">
139
- .CodeRay .line_numbers a, .CodeRay .no a {
139
+ .CodeRay .line-numbers a {
140
140
  text-decoration: inherit;
141
141
  color: inherit;
142
142
  }
@@ -22,7 +22,7 @@ module CodeRay
22
22
  :annotation => '35',
23
23
  :attribute_name => '33',
24
24
  :attribute_value => '31',
25
- :bin => '1;35',
25
+ :binary => '1;35',
26
26
  :char => {
27
27
  :self => '36', :delimiter => '34'
28
28
  },
@@ -47,11 +47,10 @@ module CodeRay
47
47
  :hex => '1;36',
48
48
  :include => '33',
49
49
  :integer => '1;34',
50
- :interpreted => '1;35',
51
50
  :key => '35',
52
51
  :label => '1;15',
53
52
  :local_variable => '33',
54
- :oct => '1;35',
53
+ :octal => '1;35',
55
54
  :operator_name => '1;29',
56
55
  :predefined_constant => '1;36',
57
56
  :predefined_type => '1;30',
@@ -79,7 +78,6 @@ module CodeRay
79
78
  },
80
79
  :symbol => '1;32',
81
80
  :tag => '34',
82
- :tag_special => ['34', '4'],
83
81
  :type => '1;34',
84
82
  :value => '36',
85
83
  :variable => '34',
@@ -1,3 +1,5 @@
1
+ autoload :YAML, 'yaml'
2
+
1
3
  module CodeRay
2
4
  module Encoders
3
5
 
@@ -6,8 +8,6 @@ module Encoders
6
8
  # Slow.
7
9
  class YAML < Encoder
8
10
 
9
- autoload :YAML, 'yaml'
10
-
11
11
  register_for :yaml
12
12
 
13
13
  FILE_EXTENSION = 'yaml'
@@ -20,9 +20,7 @@ module Encoders
20
20
  end
21
21
 
22
22
  def finish options
23
- YAML.dump @data, @out
24
-
25
- super
23
+ output ::YAML.dump(@data)
26
24
  end
27
25
 
28
26
  public
@@ -15,7 +15,7 @@ module CodeRay
15
15
  # WordList is optimized to be used in Scanners,
16
16
  # typically to decide whether a given ident is a special token.
17
17
  #
18
- # For case insensitive words use CaseIgnoringWordList.
18
+ # For case insensitive words use WordList::CaseIgnoring.
19
19
  #
20
20
  # Example:
21
21
  #
@@ -60,9 +60,9 @@ module CodeRay
60
60
  end
61
61
 
62
62
 
63
- # A CaseIgnoringWordList is like a WordList, only that
63
+ # A CaseIgnoring WordList is like a WordList, only that
64
64
  # keys are compared case-insensitively (normalizing keys using +downcase+).
65
- class CaseIgnoringWordList < WordList
65
+ class WordList::CaseIgnoring < WordList
66
66
 
67
67
  def [] key
68
68
  super key.downcase
@@ -4,8 +4,6 @@ require 'strscan'
4
4
  module CodeRay
5
5
 
6
6
  autoload :WordList, 'coderay/helpers/word_list'
7
- # FIXME: Rename CaseIgnoringWordList to WordList::CaseIgnoring.
8
- autoload :CaseIgnoringWordList, 'coderay/helpers/word_list'
9
7
 
10
8
  # = Scanners
11
9
  #
@@ -71,6 +69,8 @@ module CodeRay
71
69
  def normalize code
72
70
  # original = code
73
71
  code = code.to_s unless code.is_a? ::String
72
+ return code if code.empty?
73
+
74
74
  if code.respond_to? :encoding
75
75
  code = encode_with_encoding code, self.encoding
76
76
  else
@@ -100,7 +100,7 @@ module CodeRay
100
100
  def encode_with_encoding code, target_encoding
101
101
  if code.encoding == target_encoding
102
102
  if code.valid_encoding?
103
- return to_unix code
103
+ return to_unix(code)
104
104
  else
105
105
  source_encoding = guess_encoding code
106
106
  end
@@ -155,7 +155,7 @@ module CodeRay
155
155
  setup
156
156
  end
157
157
 
158
- # Sets back the scanner. Subclasses should to define the reset_instance
158
+ # Sets back the scanner. Subclasses should redefine the reset_instance
159
159
  # method instead of this one.
160
160
  def reset
161
161
  super
@@ -185,14 +185,12 @@ module CodeRay
185
185
  @tokens = options[:tokens] || @tokens || Tokens.new
186
186
  @tokens.scanner = self if @tokens.respond_to? :scanner=
187
187
  case source
188
- when String
189
- self.string = source
190
188
  when Array
191
- self.string = source.join
189
+ self.string = self.class.normalize(source.join)
192
190
  when nil
193
191
  reset
194
192
  else
195
- raise ArgumentError, 'expected String, Array, or nil'
193
+ self.string = self.class.normalize(source)
196
194
  end
197
195
 
198
196
  begin
@@ -121,7 +121,7 @@ module Scanners
121
121
 
122
122
  elsif match = scan(/(?:0[0-7]+)(?![89.eEfF])/)
123
123
  label_expected = false
124
- encoder.text_token match, :oct
124
+ encoder.text_token match, :octal
125
125
 
126
126
  elsif match = scan(/(?:\d+)(?![.eEfF])L?L?/)
127
127
  label_expected = false
@@ -133,7 +133,7 @@ module Scanners
133
133
 
134
134
  elsif match = scan(/(?:0[0-7]+)(?![89.eEfF])/)
135
135
  label_expected = false
136
- encoder.text_token match, :oct
136
+ encoder.text_token match, :octal
137
137
 
138
138
  elsif match = scan(/(?:\d+)(?![.eEfF])L?L?/)
139
139
  label_expected = false
@@ -33,11 +33,11 @@ module Scanners
33
33
  'virtual', 'write', 'writeonly',
34
34
  ] # :nodoc:
35
35
 
36
- IDENT_KIND = CaseIgnoringWordList.new(:ident).
36
+ IDENT_KIND = WordList::CaseIgnoring.new(:ident).
37
37
  add(KEYWORDS, :keyword).
38
38
  add(DIRECTIVES, :directive) # :nodoc:
39
39
 
40
- NAME_FOLLOWS = CaseIgnoringWordList.new(false).
40
+ NAME_FOLLOWS = WordList::CaseIgnoring.new(false).
41
41
  add(%w(procedure function .)) # :nodoc:
42
42
 
43
43
  protected
@@ -50,7 +50,9 @@ module Scanners
50
50
  if match = scan(/.*?(?=$|[\t\n\x00]| \(revision)/)
51
51
  encoder.text_token match, :filename
52
52
  if options[:highlight_code]
53
- content_scanner = scanners[FileType.fetch(match, :plaintext)]
53
+ file_type = FileType.fetch(match, :text)
54
+ file_type = :text if file_type == :diff
55
+ content_scanner = scanners[file_type]
54
56
  content_scanner_entry_state = nil
55
57
  end
56
58
  end
@@ -130,7 +130,7 @@ module Scanners
130
130
  if match = scan(/0[xX][0-9A-Fa-f]+/)
131
131
  encoder.text_token match, :hex
132
132
  elsif match = scan(/(?>0[0-7]+)(?![89.eEfF])/)
133
- encoder.text_token match, :oct
133
+ encoder.text_token match, :octal
134
134
  elsif match = scan(/\d+[fFdD]|\d*\.\d+(?:[eE][+-]?\d+)?[fFdD]?|\d+[eE][+-]?\d+[fFdD]?/)
135
135
  encoder.text_token match, :float
136
136
  elsif match = scan(/\d+[lLgG]?/)
@@ -32,7 +32,7 @@ module Scanners
32
32
  onvolumechange onwaiting
33
33
  )
34
34
 
35
- IN_ATTRIBUTE = CaseIgnoringWordList.new(nil).
35
+ IN_ATTRIBUTE = WordList::CaseIgnoring.new(nil).
36
36
  add(EVENT_ATTRIBUTES, :script)
37
37
 
38
38
  ATTR_NAME = /[\w.:-]+/ # :nodoc:
@@ -58,10 +58,10 @@ module Scanners
58
58
  '"' => /[^&">\n]+/,
59
59
  } # :nodoc:
60
60
 
61
- def reset # :nodoc:
62
- # FIXME: why not overwrite reset_instance?
61
+ def reset
63
62
  super
64
63
  @state = :initial
64
+ @plain_string_content = nil
65
65
  end
66
66
 
67
67
  protected
@@ -81,11 +81,12 @@ module Scanners
81
81
  end
82
82
 
83
83
  def scan_tokens encoder, options
84
-
85
84
  state = @state
86
85
  plain_string_content = @plain_string_content
87
86
  in_tag = in_attribute = nil
88
87
 
88
+ encoder.begin_group :string if state == :attribute_value_string
89
+
89
90
  until eos?
90
91
 
91
92
  if state != :in_special_tag && match = scan(/\s+/m)
@@ -239,12 +240,10 @@ module Scanners
239
240
  if options[:keep_state]
240
241
  @state = state
241
242
  @plain_string_content = plain_string_content
242
- else
243
- if state == :attribute_value_string
244
- encoder.end_group :string
245
- end
246
243
  end
247
244
 
245
+ encoder.end_group :string if state == :attribute_value_string
246
+
248
247
  encoder
249
248
  end
250
249
 
@@ -107,7 +107,7 @@ module Scanners
107
107
  if match = scan(/0[xX][0-9A-Fa-f]+/)
108
108
  encoder.text_token match, :hex
109
109
  elsif match = scan(/(?>0[0-7]+)(?![89.eEfF])/)
110
- encoder.text_token match, :oct
110
+ encoder.text_token match, :octal
111
111
  elsif match = scan(/\d+[fFdD]|\d*\.\d+(?:[eE][+-]?\d+)?[fFdD]?|\d+[eE][+-]?\d+[fFdD]?/)
112
112
  encoder.text_token match, :float
113
113
  elsif match = scan(/\d+[lL]?/)
@@ -81,7 +81,7 @@ module Scanners
81
81
  if match = scan(/0[xX][0-9A-Fa-f]+/)
82
82
  encoder.text_token match, :hex
83
83
  elsif match = scan(/(?>0[0-7]+)(?![89.eEfF])/)
84
- encoder.text_token match, :oct
84
+ encoder.text_token match, :octal
85
85
  elsif match = scan(/\d+[fF]|\d*\.\d+(?:[eE][+-]?\d+)?[fF]?|\d+[eE][+-]?\d+[fF]?/)
86
86
  encoder.text_token match, :float
87
87
  elsif match = scan(/\d+/)
@@ -181,7 +181,7 @@ module Scanners
181
181
  $argc $argv
182
182
  ]
183
183
 
184
- IDENT_KIND = CaseIgnoringWordList.new(:ident).
184
+ IDENT_KIND = WordList::CaseIgnoring.new(:ident).
185
185
  add(KEYWORDS, :keyword).
186
186
  add(TYPES, :predefined_type).
187
187
  add(LANGUAGE_CONSTRUCTS, :keyword).
@@ -194,7 +194,7 @@ module Scanners
194
194
  encoder.text_token match, :hex
195
195
 
196
196
  elsif match = scan(/0[bB][01]+[lL]?/)
197
- encoder.text_token match, :bin
197
+ encoder.text_token match, :binary
198
198
 
199
199
  elsif match = scan(/(?:\d*\.\d+|\d+\.\d*)(?:[eE][+-]?\d+)?|\d+[eE][+-]?\d+/)
200
200
  if scan(/[jJ]/)
@@ -205,7 +205,7 @@ module Scanners
205
205
  end
206
206
 
207
207
  elsif match = scan(/0[oO][0-7]+|0[0-7]+(?![89.eE])[lL]?/)
208
- encoder.text_token match, :oct
208
+ encoder.text_token match, :octal
209
209
 
210
210
  elsif match = scan(/\d+([lL])?/)
211
211
  if self[1] == nil && scan(/[jJ]/)
@@ -178,7 +178,7 @@ module Scanners
178
178
  encoder.text_token match, :error
179
179
  method_call_expected = false
180
180
  else
181
- encoder.text_token match, self[1] ? :float : :integer
181
+ encoder.text_token match, self[1] ? :float : :integer # TODO: send :hex/:octal/:binary
182
182
  end
183
183
  value_expected = false
184
184
 
@@ -42,7 +42,7 @@ module CodeRay module Scanners
42
42
 
43
43
  PREDEFINED_CONSTANTS = %w( null true false )
44
44
 
45
- IDENT_KIND = CaseIgnoringWordList.new(:ident).
45
+ IDENT_KIND = WordList::CaseIgnoring.new(:ident).
46
46
  add(KEYWORDS, :keyword).
47
47
  add(OBJECTS, :type).
48
48
  add(COMMANDS, :class).
@@ -97,7 +97,7 @@ module CodeRay module Scanners
97
97
  encoder.text_token match, :hex
98
98
 
99
99
  elsif match = scan(/0[0-7]+(?![89.eEfF])/)
100
- encoder.text_token match, :oct
100
+ encoder.text_token match, :octal
101
101
 
102
102
  elsif match = scan(/[-+]?(?>\d+)(?![.eEfF])/)
103
103
  encoder.text_token match, :integer
@@ -108,10 +108,10 @@ module Scanners
108
108
  encoder.text_token match, :class_variable
109
109
  next
110
110
  when match = scan(/\d\d:\d\d:\d\d/)
111
- encoder.text_token match, :oct
111
+ encoder.text_token match, :octal
112
112
  next
113
113
  when match = scan(/\d\d\d\d-\d\d-\d\d\s\d\d:\d\d:\d\d(\.\d+)? [-+]\d\d:\d\d/)
114
- encoder.text_token match, :oct
114
+ encoder.text_token match, :octal
115
115
  next
116
116
  when match = scan(/:\w+/)
117
117
  encoder.text_token match, :symbol
@@ -26,7 +26,7 @@ span.CodeRay { white-space: pre; border: 0px; padding: 2px; }
26
26
  table.CodeRay { border-collapse: collapse; width: 100%; padding: 2px; }
27
27
  table.CodeRay td { padding: 2px 4px; vertical-align: top; }
28
28
 
29
- .CodeRay .line_numbers, .CodeRay .no {
29
+ .CodeRay .line-numbers {
30
30
  background-color: #{numbers_background};
31
31
  color: gray;
32
32
  text-align: right;
@@ -34,15 +34,15 @@ table.CodeRay td { padding: 2px 4px; vertical-align: top; }
34
34
  -moz-user-select: none;
35
35
  user-select: none;
36
36
  }
37
- .CodeRay .line_numbers a, .CodeRay .no a {
37
+ .CodeRay .line-numbers a {
38
38
  background-color: #{numbers_background} !important;
39
39
  color: gray !important;
40
40
  text-decoration: none !important;
41
41
  }
42
- .CodeRay .line_numbers a:target, .CodeRay .no a:target { color: blue !important; }
43
- .CodeRay .line_numbers .highlighted, .CodeRay .no .highlighted { color: red !important; }
44
- .CodeRay .line_numbers .highlighted a, .CodeRay .no .highlighted a { color: red !important; }
45
- .CodeRay .no { padding: 0px 4px; }
42
+ .CodeRay .line-numbers a:target { color: blue !important; }
43
+ .CodeRay .line-numbers .highlighted { color: red !important; }
44
+ .CodeRay .line-numbers .highlighted a { color: red !important; }
45
+ .CodeRay span.line-numbers { padding: 0px 4px; }
46
46
  .CodeRay .line { display: block; float: left; width: 100%; }
47
47
  .CodeRay .code { width: 100%; }
48
48
  .CodeRay .code pre { overflow: auto; }
@@ -51,102 +51,89 @@ table.CodeRay td { padding: 2px 4px; vertical-align: top; }
51
51
  TOKEN_COLORS = <<-'TOKENS'
52
52
  .debug { color: white !important; background: blue !important; }
53
53
 
54
- .an { color:#007 }
55
- .at { color:#f08 }
56
- .av { color:#700 }
57
- .bi { color:#509 }
58
- .c { color:#888 }
59
- .c .dl { color:#444 }
60
- .c .ch { color:#444 }
61
-
62
- .ch { color:#D20 }
63
- .ch .k { color:#D20 }
64
- .ch .dl { color:#710 }
65
-
66
- .cl { color:#B06; font-weight:bold }
67
- .cm { color:#A08 }
68
- .co { color:#036; font-weight:bold }
69
- .cr { color:#0A0 }
70
- .cv { color:#369 }
71
- .de { color:#B0B }
72
- .df { color:#099; font-weight:bold }
73
- .di { color:#088; font-weight:bold }
74
- .dl { color:black }
75
- .do { color:#970 }
76
- .dt { color:#34b }
77
- .ds { color:#D42; font-weight:bold }
78
- .e { color:#666 }
79
- .en { color:#800; font-weight:bold }
80
- .er { color:#F00; background-color:#FAA }
81
- .ex { color:#C00; font-weight:bold }
82
- .fl { color:#60E }
83
- .fu { color:#06B; font-weight:bold }
84
- .gv { color:#d70 }
85
- .hx { color:#02b }
86
- .i { color:#00D }
87
- .ic { color:#B44; font-weight:bold }
88
-
89
- .il { background-color: hsla(0,0%,0%,0.1); color: black }
90
- .idl { font-weight: bold; color: #666 }
91
-
92
- .im { color:#f00 }
93
- .in { color:#B2B; font-weight:bold }
94
- .iv { color:#33B }
95
- .la { color:#970; font-weight:bold }
96
- .lv { color:#963 }
97
- .ns { color:#707; font-weight:bold }
98
- .oc { color:#40E }
99
- .op { }
100
- .pc { color:#069 }
101
- .pd { color:#369; font-weight:bold }
102
- .pp { color:#579 }
103
- .ps { color:#00C; font-weight:bold }
104
- .pt { color:#0a5; font-weight:bold }
105
- .r { color:#080; font-weight:bold }
106
- .kw { color:#080; font-weight:bold }
107
-
108
- .ke { color: #606 }
109
- .ke .dl { color: #404 }
110
- .ke .ch { color: #60f }
111
- .vl { color: #088; }
112
-
113
- .rx { background-color:hsla(300,100%,50%,0.09); }
114
- .rx .k { color:#808 }
115
- .rx .dl { color:#404 }
116
- .rx .mod { color:#C2C }
117
-
118
- .s { background-color:hsla(0,100%,50%,0.08); }
119
- .s .k { color: #D20 }
120
- .s .ch { color: #b0b }
121
- .s .dl { color: #710 }
122
- .s .mod { color: #E40 }
123
-
124
- .sh { background-color:hsla(120,100%,50%,0.09); }
125
- .sh .k { color:#2B2 }
126
- .sh .dl { color:#161 }
127
-
128
- .sy { color:#A60 }
129
- .sy .k { color:#A60 }
130
- .sy .dl { color:#630 }
131
-
132
- .ta { color:#070 }
133
- .ts { color:#D70; font-weight:bold }
134
- .ty { color:#339; font-weight:bold }
135
- .v { color:#037 }
136
- .xt { color:#444 }
137
-
138
- .ins { background: hsla(120,100%,50%,0.1) }
139
- .del { background: hsla(0,100%,50%,0.1) }
140
- .chg { color: #bbf; background: #007; }
54
+ .annotation { color:#007 }
55
+ .attribute-name { color:#f08 }
56
+ .attribute-value { color:#700 }
57
+ .binary { color:#509 }
58
+ .char .content { color:#D20 }
59
+ .char .delimiter { color:#710 }
60
+ .char { color:#D20 }
61
+ .class { color:#B06; font-weight:bold }
62
+ .class-variable { color:#369 }
63
+ .color { color:#0A0 }
64
+ .comment { color:#888 }
65
+ .comment .char { color:#444 }
66
+ .comment .delimiter { color:#444 }
67
+ .complex { color:#A08 }
68
+ .constant { color:#036; font-weight:bold }
69
+ .decorator { color:#B0B }
70
+ .definition { color:#099; font-weight:bold }
71
+ .delimiter { color:black }
72
+ .directive { color:#088; font-weight:bold }
73
+ .doc { color:#970 }
74
+ .doc-string { color:#D42; font-weight:bold }
75
+ .doctype { color:#34b }
76
+ .entity { color:#800; font-weight:bold }
77
+ .error { color:#F00; background-color:#FAA }
78
+ .escape { color:#666 }
79
+ .exception { color:#C00; font-weight:bold }
80
+ .float { color:#60E }
81
+ .function { color:#06B; font-weight:bold }
82
+ .global-variable { color:#d70 }
83
+ .hex { color:#02b }
84
+ .imaginary { color:#f00 }
85
+ .include { color:#B44; font-weight:bold }
86
+ .inline { background-color: hsla(0,0%,0%,0.1); color: black }
87
+ .inline-delimiter { font-weight: bold; color: #666 }
88
+ .instance-variable { color:#33B }
89
+ .integer { color:#00D }
90
+ .key .char { color: #60f }
91
+ .key .delimiter { color: #404 }
92
+ .key { color: #606 }
93
+ .keyword { color:#080; font-weight:bold }
94
+ .label { color:#970; font-weight:bold }
95
+ .local-variable { color:#963 }
96
+ .namespace { color:#707; font-weight:bold }
97
+ .octal { color:#40E }
98
+ .operator { }
99
+ .predefined { color:#369; font-weight:bold }
100
+ .predefined-class { color:#069 }
101
+ .predefined-type { color:#0a5; font-weight:bold }
102
+ .preprocessor { color:#579 }
103
+ .pseudo-class { color:#00C; font-weight:bold }
104
+ .regexp .content { color:#808 }
105
+ .regexp .delimiter { color:#404 }
106
+ .regexp .modifier { color:#C2C }
107
+ .regexp { background-color:hsla(300,100%,50%,0.09); }
108
+ .reserved { color:#080; font-weight:bold }
109
+ .shell .content { color:#2B2 }
110
+ .shell .delimiter { color:#161 }
111
+ .shell { background-color:hsla(120,100%,50%,0.09); }
112
+ .string .char { color: #b0b }
113
+ .string .content { color: #D20 }
114
+ .string .delimiter { color: #710 }
115
+ .string .modifier { color: #E40 }
116
+ .string { background-color:hsla(0,100%,50%,0.08); }
117
+ .symbol .content { color:#A60 }
118
+ .symbol .delimiter { color:#630 }
119
+ .symbol { color:#A60 }
120
+ .tag { color:#070 }
121
+ .type { color:#339; font-weight:bold }
122
+ .value { color: #088; }
123
+ .variable { color:#037 }
124
+
125
+ .insert { background: hsla(120,100%,50%,0.1) }
126
+ .delete { background: hsla(0,100%,50%,0.1) }
127
+ .change { color: #bbf; background: #007; }
141
128
  .head { color: #f8f; background: #505 }
142
129
  .head .filename { color: white; }
143
130
 
144
- .del .eye { background-color: hsla(0,100%,50%,0.2); border: 1px solid hsla(0,100%,45%,0.5); margin: -1px; border-bottom: none; border-top-left-radius: 5px; border-top-right-radius: 5px; }
145
- .ins .eye { background-color: hsla(120,100%,50%,0.2); border: 1px solid hsla(120,100%,25%,0.5); margin: -1px; border-top: none; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; }
131
+ .delete .eyecatcher { background-color: hsla(0,100%,50%,0.2); border: 1px solid hsla(0,100%,45%,0.5); margin: -1px; border-bottom: none; border-top-left-radius: 5px; border-top-right-radius: 5px; }
132
+ .insert .eyecatcher { background-color: hsla(120,100%,50%,0.2); border: 1px solid hsla(120,100%,25%,0.5); margin: -1px; border-top: none; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; }
146
133
 
147
- .ins .ins { color: #0c0; background:transparent; font-weight:bold }
148
- .del .del { color: #c00; background:transparent; font-weight:bold }
149
- .chg .chg { color: #88f }
134
+ .insert .insert { color: #0c0; background:transparent; font-weight:bold }
135
+ .delete .delete { color: #c00; background:transparent; font-weight:bold }
136
+ .change .change { color: #88f }
150
137
  .head .head { color: #f4f }
151
138
  TOKENS
152
139
 
@@ -10,77 +10,76 @@ module CodeRay
10
10
  TokenKinds.compare_by_identity if TokenKinds.respond_to? :compare_by_identity
11
11
 
12
12
  TokenKinds.update( # :nodoc:
13
- :annotation => 'at',
14
- :attribute_name => 'an',
15
- :attribute_value => 'av',
16
- :bin => 'bi',
17
- :char => 'ch',
18
- :class => 'cl',
19
- :class_variable => 'cv',
20
- :color => 'cr',
21
- :comment => 'c',
22
- :complex => 'cm',
23
- :constant => 'co',
24
- :content => 'k',
25
- :decorator => 'de',
26
- :definition => 'df',
27
- :delimiter => 'dl',
28
- :directive => 'di',
29
- :doc => 'do',
30
- :doctype => 'dt',
31
- :doc_string => 'ds',
32
- :entity => 'en',
33
- :error => 'er',
34
- :escape => 'e',
35
- :exception => 'ex',
36
- :filename => 'filename',
37
- :float => 'fl',
38
- :function => 'fu',
39
- :global_variable => 'gv',
40
- :hex => 'hx',
41
- :imaginary => 'cm',
42
- :important => 'im',
43
- :include => 'ic',
44
- :inline => 'il',
45
- :inline_delimiter => 'idl',
46
- :instance_variable => 'iv',
47
- :integer => 'i',
48
- :interpreted => 'in',
49
- :key => 'ke',
50
- :keyword => 'kw',
51
- :label => 'la',
52
- :local_variable => 'lv',
53
- :modifier => 'mod',
54
- :namespace => 'ns',
55
- :oct => 'oc',
56
- :predefined => 'pd',
57
- :preprocessor => 'pp',
58
- :predefined_constant => 'pc',
59
- :predefined_type => 'pt',
60
- :pseudo_class => 'ps',
61
- :regexp => 'rx',
62
- :reserved => 'r',
63
- :shell => 'sh',
64
- :string => 's',
65
- :symbol => 'sy',
66
- :tag => 'ta',
67
- :tag_special => 'ts',
68
- :type => 'ty',
69
- :value => 'vl',
70
- :variable => 'v',
13
+ :annotation => 'annotation',
14
+ :attribute_name => 'attribute-name',
15
+ :attribute_value => 'attribute-value',
16
+ :binary => 'bin',
17
+ :char => 'char',
18
+ :class => 'class',
19
+ :class_variable => 'class-variable',
20
+ :color => 'color',
21
+ :comment => 'comment',
22
+ :complex => 'complex',
23
+ :constant => 'constant',
24
+ :content => 'content',
25
+ :debug => 'debug',
26
+ :decorator => 'decorator',
27
+ :definition => 'definition',
28
+ :delimiter => 'delimiter',
29
+ :directive => 'directive',
30
+ :doc => 'doc',
31
+ :doctype => 'doctype',
32
+ :doc_string => 'doc-string',
33
+ :entity => 'entity',
34
+ :error => 'error',
35
+ :escape => 'escape',
36
+ :exception => 'exception',
37
+ :filename => 'filename',
38
+ :float => 'float',
39
+ :function => 'function',
40
+ :global_variable => 'global-variable',
41
+ :hex => 'hex',
42
+ :imaginary => 'imaginary',
43
+ :important => 'important',
44
+ :include => 'include',
45
+ :inline => 'inline',
46
+ :inline_delimiter => 'inline-delimiter',
47
+ :instance_variable => 'instance-variable',
48
+ :integer => 'integer',
49
+ :key => 'key',
50
+ :keyword => 'keyword',
51
+ :label => 'label',
52
+ :local_variable => 'local-variable',
53
+ :modifier => 'modifier',
54
+ :namespace => 'namespace',
55
+ :octal => 'octal',
56
+ :predefined => 'predefined',
57
+ :predefined_constant => 'predefined-constant',
58
+ :predefined_type => 'predefined-type',
59
+ :preprocessor => 'preprocessor',
60
+ :pseudo_class => 'pseudo-class',
61
+ :regexp => 'regexp',
62
+ :reserved => 'reserved',
63
+ :shell => 'shell',
64
+ :string => 'string',
65
+ :symbol => 'symbol',
66
+ :tag => 'tag',
67
+ :type => 'type',
68
+ :value => 'value',
69
+ :variable => 'variable',
71
70
 
72
- :insert => 'ins',
73
- :delete => 'del',
74
- :change => 'chg',
75
- :head => 'head',
71
+ :change => 'change',
72
+ :delete => 'delete',
73
+ :head => 'head',
74
+ :insert => 'insert',
76
75
 
77
- :eyecatcher => 'eye',
76
+ :eyecatcher => 'eyecatcher',
78
77
 
79
- :ident => false, # 'id'
80
- :operator => false, # 'op'
78
+ :ident => false,
79
+ :operator => false,
81
80
 
82
- :space => false, # 'sp'
83
- :plain => false
81
+ :space => false,
82
+ :plain => false
84
83
  )
85
84
 
86
85
  TokenKinds[:method] = TokenKinds[:function]
@@ -30,8 +30,8 @@ class BasicTest < Test::Unit::TestCase
30
30
  end
31
31
  end
32
32
 
33
- RUBY_TEST_HTML = 'puts <span class="s"><span class="dl">&quot;</span>' +
34
- '<span class="k">Hello, World!</span><span class="dl">&quot;</span></span>'
33
+ RUBY_TEST_HTML = 'puts <span class="string"><span class="delimiter">&quot;</span>' +
34
+ '<span class="content">Hello, World!</span><span class="delimiter">&quot;</span></span>'
35
35
  def test_simple_highlight
36
36
  assert_nothing_raised do
37
37
  assert_equal RUBY_TEST_HTML, CodeRay.scan(RUBY_TEST_CODE, :ruby).html
@@ -59,7 +59,7 @@ class BasicTest < Test::Unit::TestCase
59
59
  end
60
60
 
61
61
  def test_highlight_file
62
- assert_match "require <span class=\"s\"><span class=\"dl\">'</span><span class=\"k\">test/unit</span><span class=\"dl\">'</span></span>\n", CodeRay.highlight_file(__FILE__)
62
+ assert_match "require <span class=\"string\"><span class=\"delimiter\">'</span><span class=\"content\">test/unit</span><span class=\"delimiter\">'</span></span>\n", CodeRay.highlight_file(__FILE__)
63
63
  end
64
64
 
65
65
  def test_duo
@@ -147,7 +147,7 @@ more code # and another comment, in-line.
147
147
  assert_kind_of String, css_class, "TokenKinds[%p] == %p" % [kind, css_class]
148
148
  end
149
149
  end
150
- assert_equal 'r', CodeRay::TokenKinds[:reserved]
150
+ assert_equal 'reserved', CodeRay::TokenKinds[:reserved]
151
151
  assert_equal false, CodeRay::TokenKinds[:shibboleet]
152
152
  end
153
153
 
@@ -213,9 +213,7 @@ more code # and another comment, in-line.
213
213
  def test_scanner_tokenize
214
214
  assert_equal ['foo', :plain], CodeRay::Scanners::Plain.new.tokenize('foo')
215
215
  assert_equal [['foo', :plain], ['bar', :plain]], CodeRay::Scanners::Plain.new.tokenize(['foo', 'bar'])
216
- assert_raise ArgumentError do
217
- CodeRay::Scanners::Plain.new.tokenize 42
218
- end
216
+ CodeRay::Scanners::Plain.new.tokenize 42
219
217
  end
220
218
 
221
219
  def test_scanner_tokens
@@ -22,7 +22,7 @@ end
22
22
  CODE
23
23
  assert_equal <<-DIV, div
24
24
  <table class="CodeRay"><tr>
25
- <td class="line_numbers" title="double click to toggle" ondblclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"><pre><a href="#n1" name="n1">1</a>
25
+ <td class="line-numbers" title="double click to toggle" ondblclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"><pre><a href="#n1" name="n1">1</a>
26
26
  <a href="#n2" name="n2">2</a>
27
27
  <a href="#n3" name="n3">3</a>
28
28
  </pre></td>
@@ -38,9 +38,9 @@ end
38
38
  <body style="background-color: white;">
39
39
 
40
40
  <table class="CodeRay"><tr>
41
- <td class="line_numbers" title="double click to toggle" ondblclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"><pre>
41
+ <td class="line-numbers" title="double click to toggle" ondblclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"><pre>
42
42
  </pre></td>
43
- <td class="code"><pre>puts <span class="s"><span class="dl">&quot;</span><span class="k">Hello, world!</span><span class="dl">&quot;</span></span></pre></td>
43
+ <td class="code"><pre>puts <span class="string"><span class="delimiter">&quot;</span><span class="content">Hello, world!</span><span class="delimiter">&quot;</span></span></pre></td>
44
44
  </tr></table>
45
45
 
46
46
  </body>
@@ -90,7 +90,7 @@ Token Types (7):
90
90
  div = tokens.div(:css => :class)
91
91
  assert_equal <<-DIV, div
92
92
  <div class="CodeRay">
93
- <div class="code"><pre>{ <span class="ke"><span class="dl">&quot;</span><span class="k">just</span><span class="dl">&quot;</span></span>: <span class="s"><span class="dl">&quot;</span><span class="k">an</span><span class="dl">&quot;</span></span>, <span class="ke"><span class="dl">&quot;</span><span class="k">example</span><span class="dl">&quot;</span></span>: <span class="i">42</span> }</pre></div>
93
+ <div class="code"><pre>{ <span class="key"><span class="delimiter">&quot;</span><span class="content">just</span><span class="delimiter">&quot;</span></span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">an</span><span class="delimiter">&quot;</span></span>, <span class="key"><span class="delimiter">&quot;</span><span class="content">example</span><span class="delimiter">&quot;</span></span>: <span class="integer">42</span> }</pre></div>
94
94
  </div>
95
95
  DIV
96
96
 
metadata CHANGED
@@ -1,36 +1,26 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: coderay
3
- version: !ruby/object:Gem::Version
4
- hash: 961912872
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0.831pre
5
5
  prerelease: 9
6
- segments:
7
- - 1
8
- - 0
9
- - 0
10
- - 815
11
- - pre
12
- version: 1.0.0.815pre
13
6
  platform: ruby
14
- authors:
7
+ authors:
15
8
  - Kornelius Kalnbach
16
9
  autorequire:
17
10
  bindir: bin
18
11
  cert_chain: []
19
-
20
- date: 2011-08-19 00:00:00 +02:00
21
- default_executable:
12
+ date: 2011-08-23 00:00:00.000000000Z
22
13
  dependencies: []
23
-
24
- description: Fast and easy syntax highlighting for selected languages, written in Ruby. Comes with RedCloth integration and LOC counter.
25
- email:
14
+ description: Fast and easy syntax highlighting for selected languages, written in
15
+ Ruby. Comes with RedCloth integration and LOC counter.
16
+ email:
26
17
  - murphy@rubychan.de
27
- executables:
18
+ executables:
28
19
  - coderay
29
20
  extensions: []
30
-
31
- extra_rdoc_files:
21
+ extra_rdoc_files:
32
22
  - README_INDEX.rdoc
33
- files:
23
+ files:
34
24
  - lib/coderay/duo.rb
35
25
  - lib/coderay/encoder.rb
36
26
  - lib/coderay/encoders/_map.rb
@@ -88,8 +78,6 @@ files:
88
78
  - lib/coderay/style.rb
89
79
  - lib/coderay/styles/_map.rb
90
80
  - lib/coderay/styles/alpha.rb
91
- - lib/coderay/styles/cycnus.rb
92
- - lib/coderay/styles/murphy.rb
93
81
  - lib/coderay/token_kinds.rb
94
82
  - lib/coderay/tokens.rb
95
83
  - lib/coderay/version.rb
@@ -102,47 +90,34 @@ files:
102
90
  - test/functional/for_redcloth.rb
103
91
  - test/functional/suite.rb
104
92
  - bin/coderay
105
- has_rdoc: true
106
93
  homepage: http://coderay.rubychan.de
107
94
  licenses: []
108
-
109
95
  post_install_message:
110
- rdoc_options:
96
+ rdoc_options:
111
97
  - -SNw2
112
98
  - -mREADME_INDEX.rdoc
113
99
  - -t CodeRay Documentation
114
- require_paths:
100
+ require_paths:
115
101
  - lib
116
- required_ruby_version: !ruby/object:Gem::Requirement
102
+ required_ruby_version: !ruby/object:Gem::Requirement
117
103
  none: false
118
- requirements:
119
- - - ">="
120
- - !ruby/object:Gem::Version
121
- hash: 57
122
- segments:
123
- - 1
124
- - 8
125
- - 7
104
+ requirements:
105
+ - - ! '>='
106
+ - !ruby/object:Gem::Version
126
107
  version: 1.8.7
127
- required_rubygems_version: !ruby/object:Gem::Requirement
108
+ required_rubygems_version: !ruby/object:Gem::Requirement
128
109
  none: false
129
- requirements:
130
- - - ">"
131
- - !ruby/object:Gem::Version
132
- hash: 25
133
- segments:
134
- - 1
135
- - 3
136
- - 1
110
+ requirements:
111
+ - - ! '>'
112
+ - !ruby/object:Gem::Version
137
113
  version: 1.3.1
138
114
  requirements: []
139
-
140
115
  rubyforge_project: coderay
141
- rubygems_version: 1.6.2
116
+ rubygems_version: 1.8.8
142
117
  signing_key:
143
118
  specification_version: 3
144
119
  summary: Fast syntax highlighting for selected languages.
145
- test_files:
120
+ test_files:
146
121
  - test/functional/basic.rb
147
122
  - test/functional/examples.rb
148
123
  - test/functional/for_redcloth.rb
@@ -1,144 +0,0 @@
1
- module CodeRay
2
- module Styles
3
-
4
- # A colorful theme that is also the default for CodeRay output.
5
- class Cycnus < Style
6
-
7
- register_for :cycnus
8
-
9
- code_background = '#f8f8f8'
10
- numbers_background = '#def'
11
- border_color = 'silver'
12
- normal_color = '#000'
13
-
14
- CSS_MAIN_STYLES = <<-MAIN # :nodoc:
15
- .CodeRay {
16
- background-color: #{code_background};
17
- border: 1px solid #{border_color};
18
- font-family: 'Courier New', 'Terminal', monospace;
19
- color: #{normal_color};
20
- }
21
- .CodeRay pre { margin: 0px; }
22
-
23
- span.CodeRay { white-space: pre; border: 0px; padding: 2px; }
24
-
25
- table.CodeRay { border-collapse: collapse; width: 100%; padding: 2px; }
26
- table.CodeRay td { padding: 2px 4px; vertical-align: top; }
27
-
28
- .CodeRay .line_numbers, .CodeRay .no {
29
- background-color: #{numbers_background};
30
- color: gray;
31
- text-align: right;
32
- }
33
- .CodeRay .line_numbers .highlighted, .CodeRay .no .highlighted { color: red; }
34
- .CodeRay .no { padding: 0px 4px; }
35
- .CodeRay .line { display: block; float: left; width: 100%; }
36
- .CodeRay .code { width: 100%; }
37
- .CodeRay .code pre { overflow: auto; }
38
- MAIN
39
-
40
- TOKEN_COLORS = <<-'TOKENS'
41
- .debug { color: white !important; background: blue !important; }
42
-
43
- .an { color:#007 }
44
- .at { color:#f08 }
45
- .av { color:#700 }
46
- .bi { color:#509; font-weight:bold }
47
- .c { color:#888; }
48
-
49
- .ch { color:#04D }
50
- .ch .k { color:#04D }
51
- .ch .dl { color:#039 }
52
-
53
- .cl { color:#B06; font-weight:bold }
54
- .cm { color:#A08; font-weight:bold }
55
- .co { color:#036; font-weight:bold }
56
- .cr { color:#0A0 }
57
- .cv { color:#369 }
58
- .de { color:#B0B; }
59
- .df { color:#099; font-weight:bold }
60
- .di { color:#088; font-weight:bold }
61
- .dl { color:black }
62
- .do { color:#970 }
63
- .dt { color:#34b }
64
- .ds { color:#D42; font-weight:bold }
65
- .e { color:#666; font-weight:bold }
66
- .en { color:#800; font-weight:bold }
67
- .er { color:#F00; background-color:#FAA }
68
- .ex { color:#C00; font-weight:bold }
69
- .fl { color:#60E; font-weight:bold }
70
- .fu { color:#06B; font-weight:bold }
71
- .gv { color:#d70; font-weight:bold }
72
- .hx { color:#058; font-weight:bold }
73
- .i { color:#00D; font-weight:bold }
74
- .ic { color:#B44; font-weight:bold }
75
-
76
- .il { background: #ddd; color: black }
77
- .il .il { background: #ccc }
78
- .il .il .il { background: #bbb }
79
- .il .idl { background: #ddd; font-weight: bold; color: #666 }
80
- .idl { background-color: #bbb; font-weight: bold; color: #666; }
81
-
82
- .im { color:#f00; }
83
- .in { color:#B2B; font-weight:bold }
84
- .iv { color:#33B }
85
- .la { color:#970; font-weight:bold }
86
- .lv { color:#963 }
87
- .ns { color:#707; font-weight:bold }
88
- .oc { color:#40E; font-weight:bold }
89
- .op { }
90
- .pc { color:#058; font-weight:bold }
91
- .pd { color:#369; font-weight:bold }
92
- .pp { color:#579; }
93
- .ps { color:#00C; font-weight:bold }
94
- .pt { color:#074; font-weight:bold }
95
- .r, .kw { color:#080; font-weight:bold }
96
-
97
- .ke { color: #808; }
98
- .ke .dl { color: #606; }
99
- .ke .ch { color: #80f; }
100
- .vl { color: #088; }
101
-
102
- .rx { background-color:#fff0ff; color:#808 }
103
- .rx .k { }
104
- .rx .dl { color:#404 }
105
- .rx .mod { color:#C2C }
106
- .rx .fu { color:#404; font-weight: bold }
107
-
108
- .s { background-color:#fff0f0; color: #D20; }
109
- .s .s { background-color:#ffe0e0 }
110
- .s .s .s { background-color:#ffd0d0 }
111
- .s .k { }
112
- .s .ch { color: #b0b; }
113
- .s .dl { color: #710; }
114
-
115
- .sh { background-color:#f0fff0; color:#2B2 }
116
- .sh .k { }
117
- .sh .dl { color:#161 }
118
-
119
- .sy { color:#A60 }
120
- .sy .k { color:#A60 }
121
- .sy .dl { color:#630 }
122
-
123
- .ta { color:#070 }
124
- .ts { color:#D70; font-weight:bold }
125
- .ty { color:#339; font-weight:bold }
126
- .v { color:#036 }
127
- .xt { color:#444 }
128
-
129
- .ins { background: #afa; }
130
- .del { background: #faa; }
131
- .chg { color: #aaf; background: #007; }
132
- .head { color: #f8f; background: #505 }
133
- .head .filename { color: white; }
134
-
135
- .ins .ins { color: #080; font-weight:bold }
136
- .del .del { color: #800; font-weight:bold }
137
- .chg .chg { color: #66f; }
138
- .head .head { color: #f4f; }
139
- TOKENS
140
-
141
- end
142
-
143
- end
144
- end
@@ -1,123 +0,0 @@
1
- module CodeRay
2
- module Styles
3
-
4
- # A alternative color theme.
5
- class Murphy < Style
6
-
7
- register_for :murphy
8
-
9
- code_background = '#001129'
10
- numbers_background = code_background
11
- border_color = 'silver'
12
- normal_color = '#C0C0C0'
13
-
14
- CSS_MAIN_STYLES = <<-MAIN # :nodoc:
15
- .CodeRay {
16
- background-color: #{code_background};
17
- border: 1px solid #{border_color};
18
- font-family: 'Courier New', 'Terminal', monospace;
19
- color: #{normal_color};
20
- }
21
- .CodeRay pre { margin: 0px; }
22
-
23
- span.CodeRay { white-space: pre; border: 0px; padding: 2px; }
24
-
25
- table.CodeRay { border-collapse: collapse; width: 100%; padding: 2px; }
26
- table.CodeRay td { padding: 2px 4px; vertical-align: top; }
27
-
28
- .CodeRay .line_numbers, .CodeRay .no {
29
- background-color: #{numbers_background};
30
- color: gray;
31
- text-align: right;
32
- }
33
- .CodeRay .line_numbers .highlighted, .CodeRay .no .highlighted { color: red; }
34
- .CodeRay .no { padding: 0px 4px; }
35
- .CodeRay .code { width: 100%; }
36
- .CodeRay .code pre { overflow: auto; }
37
- MAIN
38
-
39
- TOKEN_COLORS = <<-'TOKENS'
40
- .an { color:#007; }
41
- .av { color:#700; }
42
- .bi { color:#509; font-weight:bold; }
43
- .c { color:#555; background-color: black; }
44
-
45
- .ch { color:#88F; }
46
- .ch .k { color:#04D; }
47
- .ch .dl { color:#039; }
48
-
49
- .cl { color:#e9e; font-weight:bold; }
50
- .co { color:#5ED; font-weight:bold; }
51
- .cr { color:#0A0; }
52
- .cv { color:#ccf; }
53
- .df { color:#099; font-weight:bold; }
54
- .di { color:#088; font-weight:bold; }
55
- .dl { color:black; }
56
- .do { color:#970; }
57
- .ds { color:#D42; font-weight:bold; }
58
- .e { color:#666; font-weight:bold; }
59
- .er { color:#F00; background-color:#FAA; }
60
- .ex { color:#F00; font-weight:bold; }
61
- .fl { color:#60E; font-weight:bold; }
62
- .fu { color:#5ed; font-weight:bold; }
63
- .gv { color:#f84; }
64
- .hx { color:#058; font-weight:bold; }
65
- .i { color:#66f; font-weight:bold; }
66
- .ic { color:#B44; font-weight:bold; }
67
- .il { }
68
- .in { color:#B2B; font-weight:bold; }
69
- .iv { color:#aaf; }
70
- .la { color:#970; font-weight:bold; }
71
- .lv { color:#963; }
72
- .oc { color:#40E; font-weight:bold; }
73
- .op { }
74
- .pc { color:#08f; font-weight:bold; }
75
- .pd { color:#369; font-weight:bold; }
76
- .pp { color:#579; }
77
- .pt { color:#66f; font-weight:bold; }
78
- .r { color:#5de; font-weight:bold; }
79
- .r, .kw { color:#5de; font-weight:bold }
80
-
81
- .ke { color: #808; }
82
-
83
- .rx { background-color:#221133; }
84
- .rx .k { color:#f8f; }
85
- .rx .dl { color:#f0f; }
86
- .rx .mod { color:#f0b; }
87
- .rx .fu { color:#404; font-weight: bold; }
88
-
89
- .s { background-color:#331122; }
90
- .s .s { background-color:#ffe0e0; }
91
- .s .s .s { background-color:#ffd0d0; }
92
- .s .k { color:#F88; }
93
- .s .dl { color:#f55; }
94
-
95
- .sh { background-color:#f0fff0; }
96
- .sh .k { color:#2B2; }
97
- .sh .dl { color:#161; }
98
-
99
- .sy { color:#Fc8; }
100
- .sy .k { color:#Fc8; }
101
- .sy .dl { color:#F84; }
102
-
103
- .ta { color:#070; }
104
- .ts { color:#D70; font-weight:bold; }
105
- .ty { color:#339; font-weight:bold; }
106
- .v { color:#036; }
107
- .xt { color:#444; }
108
-
109
- .ins { background: #afa; }
110
- .del { background: #faa; }
111
- .chg { color: #aaf; background: #007; }
112
- .head { color: #f8f; background: #505 }
113
-
114
- .ins .ins { color: #080; font-weight:bold }
115
- .del .del { color: #800; font-weight:bold }
116
- .chg .chg { color: #66f; }
117
- .head .head { color: #f4f; }
118
- TOKENS
119
-
120
- end
121
-
122
- end
123
- end