guard-srb 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rubocop.yml +37 -0
- data/.tool-versions +1 -0
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/Gemfile +14 -0
- data/Gemfile.lock +125 -0
- data/Guardfile +16 -0
- data/LICENSE.txt +21 -0
- data/README.md +92 -0
- data/Rakefile +18 -0
- data/lib/guard/srb/runner.rb +70 -0
- data/lib/guard/srb/templates/Guardfile +3 -0
- data/lib/guard/srb/version.rb +8 -0
- data/lib/guard/srb.rb +105 -0
- data/sorbet/config +5 -0
- data/sorbet/rbi/annotations/rainbow.rbi +269 -0
- data/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
- data/sorbet/rbi/gems/coderay@1.1.3.rbi +3437 -0
- data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +1079 -0
- data/sorbet/rbi/gems/ffi@1.15.5.rbi +8 -0
- data/sorbet/rbi/gems/formatador@1.1.0.rbi +8 -0
- data/sorbet/rbi/gems/guard-compat@1.2.1.rbi +103 -0
- data/sorbet/rbi/gems/guard-minitest@2.4.6.rbi +299 -0
- data/sorbet/rbi/gems/guard@2.16.2.rbi +2286 -0
- data/sorbet/rbi/gems/json@2.6.3.rbi +1541 -0
- data/sorbet/rbi/gems/listen@3.8.0.rbi +1181 -0
- data/sorbet/rbi/gems/lumberjack@1.2.8.rbi +1501 -0
- data/sorbet/rbi/gems/method_source@1.0.0.rbi +272 -0
- data/sorbet/rbi/gems/minitest@5.18.0.rbi +2354 -0
- data/sorbet/rbi/gems/mocha@2.0.2.rbi +3934 -0
- data/sorbet/rbi/gems/nenv@0.3.0.rbi +146 -0
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +161 -0
- data/sorbet/rbi/gems/notiffany@0.1.3.rbi +1078 -0
- data/sorbet/rbi/gems/parallel@1.23.0.rbi +273 -0
- data/sorbet/rbi/gems/parser@3.2.2.1.rbi +9454 -0
- data/sorbet/rbi/gems/pry@0.14.2.rbi +10079 -0
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +402 -0
- data/sorbet/rbi/gems/rake@13.0.6.rbi +3119 -0
- data/sorbet/rbi/gems/rb-fsevent@0.11.2.rbi +8 -0
- data/sorbet/rbi/gems/rb-inotify@0.10.1.rbi +8 -0
- data/sorbet/rbi/gems/rbi@0.0.16.rbi +3049 -0
- data/sorbet/rbi/gems/regexp_parser@2.8.0.rbi +3765 -0
- data/sorbet/rbi/gems/rexml@3.2.5.rbi +4717 -0
- data/sorbet/rbi/gems/rubocop-ast@1.28.1.rbi +6967 -0
- data/sorbet/rbi/gems/rubocop@1.50.2.rbi +55367 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1317 -0
- data/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi +8 -0
- data/sorbet/rbi/gems/shellany@0.0.1.rbi +101 -0
- data/sorbet/rbi/gems/spoom@1.2.1.rbi +2536 -0
- data/sorbet/rbi/gems/tapioca@0.11.6.rbi +3246 -0
- data/sorbet/rbi/gems/thor@1.2.2.rbi +3965 -0
- data/sorbet/rbi/gems/unicode-display_width@2.4.2.rbi +65 -0
- data/sorbet/rbi/gems/unparser@0.6.7.rbi +4515 -0
- data/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi +426 -0
- data/sorbet/rbi/gems/yard@0.9.34.rbi +17907 -0
- data/sorbet/rbi/todo.rbi +7 -0
- data/sorbet/tapioca/config.yml +13 -0
- data/sorbet/tapioca/require.rb +14 -0
- metadata +155 -0
@@ -0,0 +1,3437 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for types exported from the `coderay` gem.
|
5
|
+
# Please instead update this file by running `bin/tapioca gem coderay`.
|
6
|
+
|
7
|
+
# = CodeRay Library
|
8
|
+
#
|
9
|
+
# CodeRay is a Ruby library for syntax highlighting.
|
10
|
+
#
|
11
|
+
# I try to make CodeRay easy to use and intuitive, but at the same time fully
|
12
|
+
# featured, complete, fast and efficient.
|
13
|
+
#
|
14
|
+
# See README.
|
15
|
+
#
|
16
|
+
# It consists mainly of
|
17
|
+
# * the main engine: CodeRay (Scanners::Scanner, Tokens, Encoders::Encoder)
|
18
|
+
# * the plugin system: PluginHost, Plugin
|
19
|
+
# * the scanners in CodeRay::Scanners
|
20
|
+
# * the encoders in CodeRay::Encoders
|
21
|
+
# * the styles in CodeRay::Styles
|
22
|
+
#
|
23
|
+
# Here's a fancy graphic to light up this gray docu:
|
24
|
+
#
|
25
|
+
# http://cycnus.de/raindark/coderay/scheme.png
|
26
|
+
#
|
27
|
+
# == Documentation
|
28
|
+
#
|
29
|
+
# See CodeRay, Encoders, Scanners, Tokens.
|
30
|
+
#
|
31
|
+
# == Usage
|
32
|
+
#
|
33
|
+
# Remember you need RubyGems to use CodeRay, unless you have it in your load
|
34
|
+
# path. Run Ruby with -rubygems option if required.
|
35
|
+
#
|
36
|
+
# === Highlight Ruby code in a string as html
|
37
|
+
#
|
38
|
+
# require 'coderay'
|
39
|
+
# print CodeRay.scan('puts "Hello, world!"', :ruby).html
|
40
|
+
#
|
41
|
+
# # prints something like this:
|
42
|
+
# puts <span class="s">"Hello, world!"</span>
|
43
|
+
#
|
44
|
+
#
|
45
|
+
# === Highlight C code from a file in a html div
|
46
|
+
#
|
47
|
+
# require 'coderay'
|
48
|
+
# print CodeRay.scan(File.read('ruby.h'), :c).div
|
49
|
+
# print CodeRay.scan_file('ruby.h').html.div
|
50
|
+
#
|
51
|
+
# You can include this div in your page. The used CSS styles can be printed with
|
52
|
+
#
|
53
|
+
# % coderay_stylesheet
|
54
|
+
#
|
55
|
+
# === Highlight without typing too much
|
56
|
+
#
|
57
|
+
# If you are one of the hasty (or lazy, or extremely curious) people, just run this file:
|
58
|
+
#
|
59
|
+
# % ruby -rubygems /path/to/coderay/coderay.rb > example.html
|
60
|
+
#
|
61
|
+
# and look at the file it created in your browser.
|
62
|
+
#
|
63
|
+
# = CodeRay Module
|
64
|
+
#
|
65
|
+
# The CodeRay module provides convenience methods for the engine.
|
66
|
+
#
|
67
|
+
# * The +lang+ and +format+ arguments select Scanner and Encoder to use. These are
|
68
|
+
# simply lower-case symbols, like <tt>:python</tt> or <tt>:html</tt>.
|
69
|
+
# * All methods take an optional hash as last parameter, +options+, that is send to
|
70
|
+
# the Encoder / Scanner.
|
71
|
+
# * Input and language are always sorted in this order: +code+, +lang+.
|
72
|
+
# (This is in alphabetical order, if you need a mnemonic ;)
|
73
|
+
#
|
74
|
+
# You should be able to highlight everything you want just using these methods;
|
75
|
+
# so there is no need to dive into CodeRay's deep class hierarchy.
|
76
|
+
#
|
77
|
+
# The examples in the demo directory demonstrate common cases using this interface.
|
78
|
+
#
|
79
|
+
# = Basic Access Ways
|
80
|
+
#
|
81
|
+
# Read this to get a general view what CodeRay provides.
|
82
|
+
#
|
83
|
+
# == Scanning
|
84
|
+
#
|
85
|
+
# Scanning means analysing an input string, splitting it up into Tokens.
|
86
|
+
# Each Token knows about what type it is: string, comment, class name, etc.
|
87
|
+
#
|
88
|
+
# Each +lang+ (language) has its own Scanner; for example, <tt>:ruby</tt> code is
|
89
|
+
# handled by CodeRay::Scanners::Ruby.
|
90
|
+
#
|
91
|
+
# CodeRay.scan:: Scan a string in a given language into Tokens.
|
92
|
+
# This is the most common method to use.
|
93
|
+
# CodeRay.scan_file:: Scan a file and guess the language using FileType.
|
94
|
+
#
|
95
|
+
# The Tokens object you get from these methods can encode itself; see Tokens.
|
96
|
+
#
|
97
|
+
# == Encoding
|
98
|
+
#
|
99
|
+
# Encoding means compiling Tokens into an output. This can be colored HTML or
|
100
|
+
# LaTeX, a textual statistic or just the number of non-whitespace tokens.
|
101
|
+
#
|
102
|
+
# Each Encoder provides output in a specific +format+, so you select Encoders via
|
103
|
+
# formats like <tt>:html</tt> or <tt>:statistic</tt>.
|
104
|
+
#
|
105
|
+
# CodeRay.encode:: Scan and encode a string in a given language.
|
106
|
+
# CodeRay.encode_tokens:: Encode the given tokens.
|
107
|
+
# CodeRay.encode_file:: Scan a file, guess the language using FileType and encode it.
|
108
|
+
#
|
109
|
+
# == All-in-One Encoding
|
110
|
+
#
|
111
|
+
# CodeRay.encode:: Highlight a string with a given input and output format.
|
112
|
+
#
|
113
|
+
# == Instanciating
|
114
|
+
#
|
115
|
+
# You can use an Encoder instance to highlight multiple inputs. This way, the setup
|
116
|
+
# for this Encoder must only be done once.
|
117
|
+
#
|
118
|
+
# CodeRay.encoder:: Create an Encoder instance with format and options.
|
119
|
+
# CodeRay.scanner:: Create an Scanner instance for lang, with '' as default code.
|
120
|
+
#
|
121
|
+
# To make use of CodeRay.scanner, use CodeRay::Scanner::code=.
|
122
|
+
#
|
123
|
+
# The scanning methods provide more flexibility; we recommend to use these.
|
124
|
+
#
|
125
|
+
# == Reusing Scanners and Encoders
|
126
|
+
#
|
127
|
+
# If you want to re-use scanners and encoders (because that is faster), see
|
128
|
+
# CodeRay::Duo for the most convenient (and recommended) interface.
|
129
|
+
#
|
130
|
+
# source://coderay//lib/coderay.rb#126
|
131
|
+
module CodeRay
|
132
|
+
class << self
|
133
|
+
# Assuming the path is a subpath of lib/coderay/
|
134
|
+
#
|
135
|
+
# source://coderay//lib/coderay.rb#133
|
136
|
+
def coderay_path(*path); end
|
137
|
+
|
138
|
+
# Encode a string.
|
139
|
+
#
|
140
|
+
# This scans +code+ with the the Scanner for +lang+ and then
|
141
|
+
# encodes it with the Encoder for +format+.
|
142
|
+
# +options+ will be passed to the Encoder.
|
143
|
+
#
|
144
|
+
# See CodeRay::Encoder.encode.
|
145
|
+
#
|
146
|
+
# source://coderay//lib/coderay.rb#196
|
147
|
+
def encode(code, lang, format, options = T.unsafe(nil)); end
|
148
|
+
|
149
|
+
# Encodes +filename+ (a path to a code file) with the Scanner for +lang+.
|
150
|
+
#
|
151
|
+
# See CodeRay.scan_file.
|
152
|
+
# Notice that the second argument is the output +format+, not the input language.
|
153
|
+
#
|
154
|
+
# Example:
|
155
|
+
# require 'coderay'
|
156
|
+
# page = CodeRay.encode_file 'some_c_code.c', :html
|
157
|
+
#
|
158
|
+
# source://coderay//lib/coderay.rb#221
|
159
|
+
def encode_file(filename, format, options = T.unsafe(nil)); end
|
160
|
+
|
161
|
+
# Encode pre-scanned Tokens.
|
162
|
+
# Use this together with CodeRay.scan:
|
163
|
+
#
|
164
|
+
# require 'coderay'
|
165
|
+
#
|
166
|
+
# # Highlight a short Ruby code example in a HTML span
|
167
|
+
# tokens = CodeRay.scan '1 + 2', :ruby
|
168
|
+
# puts CodeRay.encode_tokens(tokens, :span)
|
169
|
+
#
|
170
|
+
# source://coderay//lib/coderay.rb#209
|
171
|
+
def encode_tokens(tokens, format, options = T.unsafe(nil)); end
|
172
|
+
|
173
|
+
# Finds the Encoder class for +format+ and creates an instance, passing
|
174
|
+
# +options+ to it.
|
175
|
+
#
|
176
|
+
# Example:
|
177
|
+
# require 'coderay'
|
178
|
+
#
|
179
|
+
# stats = CodeRay.encoder(:statistic)
|
180
|
+
# stats.encode("puts 17 + 4\n", :ruby)
|
181
|
+
#
|
182
|
+
# puts '%d out of %d tokens have the kind :integer.' % [
|
183
|
+
# stats.type_stats[:integer].count,
|
184
|
+
# stats.real_token_count
|
185
|
+
# ]
|
186
|
+
# #-> 2 out of 4 tokens have the kind :integer.
|
187
|
+
#
|
188
|
+
# source://coderay//lib/coderay.rb#260
|
189
|
+
def encoder(format, options = T.unsafe(nil)); end
|
190
|
+
|
191
|
+
# Extract the options for the scanner from the +options+ hash.
|
192
|
+
#
|
193
|
+
# Returns an empty Hash if <tt>:scanner_options</tt> is not set.
|
194
|
+
#
|
195
|
+
# This is used if a method like CodeRay.encode has to provide options
|
196
|
+
# for Encoder _and_ scanner.
|
197
|
+
#
|
198
|
+
# source://coderay//lib/coderay.rb#278
|
199
|
+
def get_scanner_options(options); end
|
200
|
+
|
201
|
+
# Highlight a string into a HTML <div>.
|
202
|
+
#
|
203
|
+
# CSS styles use classes, so you have to include a stylesheet
|
204
|
+
# in your output.
|
205
|
+
#
|
206
|
+
# See encode.
|
207
|
+
#
|
208
|
+
# source://coderay//lib/coderay.rb#232
|
209
|
+
def highlight(code, lang, options = T.unsafe(nil), format = T.unsafe(nil)); end
|
210
|
+
|
211
|
+
# Highlight a file into a HTML <div>.
|
212
|
+
#
|
213
|
+
# CSS styles use classes, so you have to include a stylesheet
|
214
|
+
# in your output.
|
215
|
+
#
|
216
|
+
# See encode.
|
217
|
+
#
|
218
|
+
# source://coderay//lib/coderay.rb#242
|
219
|
+
def highlight_file(filename, options = T.unsafe(nil), format = T.unsafe(nil)); end
|
220
|
+
|
221
|
+
# Scans the given +code+ (a String) with the Scanner for +lang+.
|
222
|
+
#
|
223
|
+
# This is a simple way to use CodeRay. Example:
|
224
|
+
# require 'coderay'
|
225
|
+
# page = CodeRay.scan("puts 'Hello, world!'", :ruby).html
|
226
|
+
#
|
227
|
+
# See also demo/demo_simple.
|
228
|
+
#
|
229
|
+
# source://coderay//lib/coderay.rb#168
|
230
|
+
def scan(code, lang, options = T.unsafe(nil), &block); end
|
231
|
+
|
232
|
+
# Scans +filename+ (a path to a code file) with the Scanner for +lang+.
|
233
|
+
#
|
234
|
+
# If +lang+ is :auto or omitted, the CodeRay::FileType module is used to
|
235
|
+
# determine it. If it cannot find out what type it is, it uses
|
236
|
+
# CodeRay::Scanners::Text.
|
237
|
+
#
|
238
|
+
# Calls CodeRay.scan.
|
239
|
+
#
|
240
|
+
# Example:
|
241
|
+
# require 'coderay'
|
242
|
+
# page = CodeRay.scan_file('some_c_code.c').html
|
243
|
+
#
|
244
|
+
# source://coderay//lib/coderay.rb#183
|
245
|
+
def scan_file(filename, lang = T.unsafe(nil), options = T.unsafe(nil), &block); end
|
246
|
+
|
247
|
+
# Finds the Scanner class for +lang+ and creates an instance, passing
|
248
|
+
# +options+ to it.
|
249
|
+
#
|
250
|
+
# See Scanner.new.
|
251
|
+
#
|
252
|
+
# source://coderay//lib/coderay.rb#268
|
253
|
+
def scanner(lang, options = T.unsafe(nil), &block); end
|
254
|
+
end
|
255
|
+
end
|
256
|
+
|
257
|
+
# source://coderay//lib/coderay.rb#130
|
258
|
+
CodeRay::CODERAY_PATH = T.let(T.unsafe(nil), String)
|
259
|
+
|
260
|
+
# = Duo
|
261
|
+
#
|
262
|
+
# A Duo is a convenient way to use CodeRay. You just create a Duo,
|
263
|
+
# giving it a lang (language of the input code) and a format (desired
|
264
|
+
# output format), and call Duo#highlight with the code.
|
265
|
+
#
|
266
|
+
# Duo makes it easy to re-use both scanner and encoder for a repetitive
|
267
|
+
# task. It also provides a very easy interface syntax:
|
268
|
+
#
|
269
|
+
# require 'coderay'
|
270
|
+
# CodeRay::Duo[:python, :div].highlight 'import this'
|
271
|
+
#
|
272
|
+
# Until you want to do uncommon things with CodeRay, I recommend to use
|
273
|
+
# this method, since it takes care of everything.
|
274
|
+
#
|
275
|
+
# source://coderay//lib/coderay/duo.rb#17
|
276
|
+
class CodeRay::Duo
|
277
|
+
# Create a new Duo, holding a lang and a format to highlight code.
|
278
|
+
#
|
279
|
+
# simple:
|
280
|
+
# CodeRay::Duo[:ruby, :html].highlight 'bla 42'
|
281
|
+
#
|
282
|
+
# with options:
|
283
|
+
# CodeRay::Duo[:ruby, :html, :hint => :debug].highlight '????::??'
|
284
|
+
#
|
285
|
+
# alternative syntax without options:
|
286
|
+
# CodeRay::Duo[:ruby => :statistic].encode 'class << self; end'
|
287
|
+
#
|
288
|
+
# alternative syntax with options:
|
289
|
+
# CodeRay::Duo[{ :ruby => :statistic }, :do => :something].encode 'abc'
|
290
|
+
#
|
291
|
+
# The options are forwarded to scanner and encoder
|
292
|
+
# (see CodeRay.get_scanner_options).
|
293
|
+
#
|
294
|
+
# @return [Duo] a new instance of Duo
|
295
|
+
#
|
296
|
+
# source://coderay//lib/coderay/duo.rb#37
|
297
|
+
def initialize(lang = T.unsafe(nil), format = T.unsafe(nil), options = T.unsafe(nil)); end
|
298
|
+
|
299
|
+
# Tokenize and highlight the code using +scanner+ and +encoder+.
|
300
|
+
# Allows to use Duo like a proc object:
|
301
|
+
#
|
302
|
+
# CodeRay::Duo[:python => :yaml].call(code)
|
303
|
+
#
|
304
|
+
# or, in Ruby 1.9 and later:
|
305
|
+
#
|
306
|
+
# CodeRay::Duo[:python => :yaml].(code)
|
307
|
+
#
|
308
|
+
# source://coderay//lib/coderay/duo.rb#64
|
309
|
+
def call(code, options = T.unsafe(nil)); end
|
310
|
+
|
311
|
+
# Tokenize and highlight the code using +scanner+ and +encoder+.
|
312
|
+
#
|
313
|
+
# source://coderay//lib/coderay/duo.rb#64
|
314
|
+
def encode(code, options = T.unsafe(nil)); end
|
315
|
+
|
316
|
+
# The encoder of the duo. Only created once.
|
317
|
+
#
|
318
|
+
# source://coderay//lib/coderay/duo.rb#59
|
319
|
+
def encoder; end
|
320
|
+
|
321
|
+
# Returns the value of attribute format.
|
322
|
+
#
|
323
|
+
# source://coderay//lib/coderay/duo.rb#19
|
324
|
+
def format; end
|
325
|
+
|
326
|
+
# Sets the attribute format
|
327
|
+
#
|
328
|
+
# @param value the value to set the attribute format to.
|
329
|
+
#
|
330
|
+
# source://coderay//lib/coderay/duo.rb#19
|
331
|
+
def format=(_arg0); end
|
332
|
+
|
333
|
+
# Tokenize and highlight the code using +scanner+ and +encoder+.
|
334
|
+
#
|
335
|
+
# source://coderay//lib/coderay/duo.rb#64
|
336
|
+
def highlight(code, options = T.unsafe(nil)); end
|
337
|
+
|
338
|
+
# Returns the value of attribute lang.
|
339
|
+
#
|
340
|
+
# source://coderay//lib/coderay/duo.rb#19
|
341
|
+
def lang; end
|
342
|
+
|
343
|
+
# Sets the attribute lang
|
344
|
+
#
|
345
|
+
# @param value the value to set the attribute lang to.
|
346
|
+
#
|
347
|
+
# source://coderay//lib/coderay/duo.rb#19
|
348
|
+
def lang=(_arg0); end
|
349
|
+
|
350
|
+
# Returns the value of attribute options.
|
351
|
+
#
|
352
|
+
# source://coderay//lib/coderay/duo.rb#19
|
353
|
+
def options; end
|
354
|
+
|
355
|
+
# Sets the attribute options
|
356
|
+
#
|
357
|
+
# @param value the value to set the attribute options to.
|
358
|
+
#
|
359
|
+
# source://coderay//lib/coderay/duo.rb#19
|
360
|
+
def options=(_arg0); end
|
361
|
+
|
362
|
+
# The scanner of the duo. Only created once.
|
363
|
+
#
|
364
|
+
# source://coderay//lib/coderay/duo.rb#54
|
365
|
+
def scanner; end
|
366
|
+
|
367
|
+
class << self
|
368
|
+
# To allow calls like Duo[:ruby, :html].highlight.
|
369
|
+
def [](*_arg0); end
|
370
|
+
end
|
371
|
+
end
|
372
|
+
|
373
|
+
# This module holds the Encoder class and its subclasses.
|
374
|
+
# For example, the HTML encoder is named CodeRay::Encoders::HTML
|
375
|
+
# can be found in coderay/encoders/html.
|
376
|
+
#
|
377
|
+
# Encoders also provides methods and constants for the register
|
378
|
+
# mechanism and the [] method that returns the Encoder class
|
379
|
+
# belonging to the given format.
|
380
|
+
#
|
381
|
+
# source://coderay//lib/coderay/encoders.rb#10
|
382
|
+
module CodeRay::Encoders
|
383
|
+
extend ::CodeRay::PluginHost
|
384
|
+
end
|
385
|
+
|
386
|
+
# A simple Filter that removes all tokens of the :comment kind.
|
387
|
+
#
|
388
|
+
# Alias: +remove_comments+
|
389
|
+
#
|
390
|
+
# Usage:
|
391
|
+
# CodeRay.scan('print # foo', :ruby).comment_filter.text
|
392
|
+
# #-> "print "
|
393
|
+
#
|
394
|
+
# See also: TokenKindFilter, LinesOfCode
|
395
|
+
#
|
396
|
+
# source://coderay//lib/coderay/encoders/comment_filter.rb#15
|
397
|
+
class CodeRay::Encoders::CommentFilter < ::CodeRay::Encoders::TokenKindFilter; end
|
398
|
+
|
399
|
+
# source://coderay//lib/coderay/encoders/comment_filter.rb#19
|
400
|
+
CodeRay::Encoders::CommentFilter::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
|
401
|
+
|
402
|
+
# Returns the number of tokens.
|
403
|
+
#
|
404
|
+
# Text and block tokens are counted.
|
405
|
+
#
|
406
|
+
# source://coderay//lib/coderay/encoders/count.rb#7
|
407
|
+
class CodeRay::Encoders::Count < ::CodeRay::Encoders::Encoder
|
408
|
+
# source://coderay//lib/coderay/encoders/count.rb#29
|
409
|
+
def begin_group(kind); end
|
410
|
+
|
411
|
+
# source://coderay//lib/coderay/encoders/count.rb#29
|
412
|
+
def begin_line(kind); end
|
413
|
+
|
414
|
+
# source://coderay//lib/coderay/encoders/count.rb#29
|
415
|
+
def end_group(kind); end
|
416
|
+
|
417
|
+
# source://coderay//lib/coderay/encoders/count.rb#29
|
418
|
+
def end_line(kind); end
|
419
|
+
|
420
|
+
# source://coderay//lib/coderay/encoders/count.rb#25
|
421
|
+
def text_token(text, kind); end
|
422
|
+
|
423
|
+
protected
|
424
|
+
|
425
|
+
# source://coderay//lib/coderay/encoders/count.rb#19
|
426
|
+
def finish(options); end
|
427
|
+
|
428
|
+
# source://coderay//lib/coderay/encoders/count.rb#13
|
429
|
+
def setup(options); end
|
430
|
+
end
|
431
|
+
|
432
|
+
# = Debug Encoder
|
433
|
+
#
|
434
|
+
# Fast encoder producing simple debug output.
|
435
|
+
#
|
436
|
+
# It is readable and diff-able and is used for testing.
|
437
|
+
#
|
438
|
+
# You cannot fully restore the tokens information from the
|
439
|
+
# output, because consecutive :space tokens are merged.
|
440
|
+
#
|
441
|
+
# See also: Scanners::Debug
|
442
|
+
#
|
443
|
+
# source://coderay//lib/coderay/encoders/debug.rb#14
|
444
|
+
class CodeRay::Encoders::Debug < ::CodeRay::Encoders::Encoder
|
445
|
+
# source://coderay//lib/coderay/encoders/debug.rb#30
|
446
|
+
def begin_group(kind); end
|
447
|
+
|
448
|
+
# source://coderay//lib/coderay/encoders/debug.rb#38
|
449
|
+
def begin_line(kind); end
|
450
|
+
|
451
|
+
# source://coderay//lib/coderay/encoders/debug.rb#34
|
452
|
+
def end_group(kind); end
|
453
|
+
|
454
|
+
# source://coderay//lib/coderay/encoders/debug.rb#42
|
455
|
+
def end_line(kind); end
|
456
|
+
|
457
|
+
# source://coderay//lib/coderay/encoders/debug.rb#20
|
458
|
+
def text_token(text, kind); end
|
459
|
+
end
|
460
|
+
|
461
|
+
# source://coderay//lib/coderay/encoders/debug.rb#18
|
462
|
+
CodeRay::Encoders::Debug::FILE_EXTENSION = T.let(T.unsafe(nil), String)
|
463
|
+
|
464
|
+
# = Debug Lint Encoder
|
465
|
+
#
|
466
|
+
# Debug encoder with additional checks for:
|
467
|
+
#
|
468
|
+
# - empty tokens
|
469
|
+
# - incorrect nesting
|
470
|
+
#
|
471
|
+
# It will raise an InvalidTokenStream exception when any of the above occurs.
|
472
|
+
#
|
473
|
+
# See also: Encoders::Debug
|
474
|
+
#
|
475
|
+
# source://coderay//lib/coderay/encoders/debug_lint.rb#16
|
476
|
+
class CodeRay::Encoders::DebugLint < ::CodeRay::Encoders::Debug
|
477
|
+
# source://coderay//lib/coderay/encoders/debug_lint.rb#26
|
478
|
+
def begin_group(kind); end
|
479
|
+
|
480
|
+
# source://coderay//lib/coderay/encoders/debug_lint.rb#37
|
481
|
+
def begin_line(kind); end
|
482
|
+
|
483
|
+
# @raise [Lint::IncorrectTokenGroupNesting]
|
484
|
+
#
|
485
|
+
# source://coderay//lib/coderay/encoders/debug_lint.rb#31
|
486
|
+
def end_group(kind); end
|
487
|
+
|
488
|
+
# @raise [Lint::IncorrectTokenGroupNesting]
|
489
|
+
#
|
490
|
+
# source://coderay//lib/coderay/encoders/debug_lint.rb#42
|
491
|
+
def end_line(kind); end
|
492
|
+
|
493
|
+
# @raise [Lint::EmptyToken]
|
494
|
+
#
|
495
|
+
# source://coderay//lib/coderay/encoders/debug_lint.rb#20
|
496
|
+
def text_token(text, kind); end
|
497
|
+
|
498
|
+
protected
|
499
|
+
|
500
|
+
# source://coderay//lib/coderay/encoders/debug_lint.rb#55
|
501
|
+
def finish(options); end
|
502
|
+
|
503
|
+
# source://coderay//lib/coderay/encoders/debug_lint.rb#50
|
504
|
+
def setup(options); end
|
505
|
+
end
|
506
|
+
|
507
|
+
# Wraps HTML output into a DIV element, using inline styles by default.
|
508
|
+
#
|
509
|
+
# See Encoders::HTML for available options.
|
510
|
+
#
|
511
|
+
# source://coderay//lib/coderay/encoders/div.rb#9
|
512
|
+
class CodeRay::Encoders::Div < ::CodeRay::Encoders::HTML; end
|
513
|
+
|
514
|
+
# source://coderay//lib/coderay/encoders/div.rb#15
|
515
|
+
CodeRay::Encoders::Div::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
|
516
|
+
|
517
|
+
# source://coderay//lib/coderay/encoders/div.rb#11
|
518
|
+
CodeRay::Encoders::Div::FILE_EXTENSION = T.let(T.unsafe(nil), String)
|
519
|
+
|
520
|
+
# = Encoder
|
521
|
+
#
|
522
|
+
# The Encoder base class. Together with Scanner and
|
523
|
+
# Tokens, it forms the highlighting triad.
|
524
|
+
#
|
525
|
+
# Encoder instances take a Tokens object and do something with it.
|
526
|
+
#
|
527
|
+
# The most common Encoder is surely the HTML encoder
|
528
|
+
# (CodeRay::Encoders::HTML). It highlights the code in a colorful
|
529
|
+
# html page.
|
530
|
+
# If you want the highlighted code in a div or a span instead,
|
531
|
+
# use its subclasses Div and Span.
|
532
|
+
#
|
533
|
+
# source://coderay//lib/coderay/encoders/encoder.rb#16
|
534
|
+
class CodeRay::Encoders::Encoder
|
535
|
+
extend ::CodeRay::Plugin
|
536
|
+
|
537
|
+
# Creates a new Encoder.
|
538
|
+
# +options+ is saved and used for all encode operations, as long
|
539
|
+
# as you don't overwrite it there by passing additional options.
|
540
|
+
#
|
541
|
+
# Encoder objects provide three encode methods:
|
542
|
+
# - encode simply takes a +code+ string and a +lang+
|
543
|
+
# - encode_tokens expects a +tokens+ object instead
|
544
|
+
#
|
545
|
+
# Each method has an optional +options+ parameter. These are
|
546
|
+
# added to the options you passed at creation.
|
547
|
+
#
|
548
|
+
# @return [Encoder] a new instance of Encoder
|
549
|
+
#
|
550
|
+
# source://coderay//lib/coderay/encoders/encoder.rb#55
|
551
|
+
def initialize(options = T.unsafe(nil)); end
|
552
|
+
|
553
|
+
# source://coderay//lib/coderay/encoders/encoder.rb#87
|
554
|
+
def <<(token); end
|
555
|
+
|
556
|
+
# Starts a token group with the given +kind+.
|
557
|
+
#
|
558
|
+
# source://coderay//lib/coderay/encoders/encoder.rb#123
|
559
|
+
def begin_group(kind); end
|
560
|
+
|
561
|
+
# Starts a new line token group with the given +kind+.
|
562
|
+
#
|
563
|
+
# source://coderay//lib/coderay/encoders/encoder.rb#131
|
564
|
+
def begin_line(kind); end
|
565
|
+
|
566
|
+
# Encode the given +code+ using the Scanner for +lang+.
|
567
|
+
#
|
568
|
+
# source://coderay//lib/coderay/encoders/encoder.rb#70
|
569
|
+
def encode(code, lang, options = T.unsafe(nil)); end
|
570
|
+
|
571
|
+
# Encode a Tokens object.
|
572
|
+
#
|
573
|
+
# source://coderay//lib/coderay/encoders/encoder.rb#61
|
574
|
+
def encode_tokens(tokens, options = T.unsafe(nil)); end
|
575
|
+
|
576
|
+
# Ends a token group with the given +kind+.
|
577
|
+
#
|
578
|
+
# source://coderay//lib/coderay/encoders/encoder.rb#127
|
579
|
+
def end_group(kind); end
|
580
|
+
|
581
|
+
# Ends a new line token group with the given +kind+.
|
582
|
+
#
|
583
|
+
# source://coderay//lib/coderay/encoders/encoder.rb#135
|
584
|
+
def end_line(kind); end
|
585
|
+
|
586
|
+
# The default file extension for this encoder.
|
587
|
+
#
|
588
|
+
# source://coderay//lib/coderay/encoders/encoder.rb#83
|
589
|
+
def file_extension; end
|
590
|
+
|
591
|
+
# Encode the given +code+ using the Scanner for +lang+.
|
592
|
+
# You can use highlight instead of encode, if that seems
|
593
|
+
# more clear to you.
|
594
|
+
#
|
595
|
+
# source://coderay//lib/coderay/encoders/encoder.rb#70
|
596
|
+
def highlight(code, lang, options = T.unsafe(nil)); end
|
597
|
+
|
598
|
+
# The options you gave the Encoder at creating.
|
599
|
+
#
|
600
|
+
# source://coderay//lib/coderay/encoders/encoder.rb#43
|
601
|
+
def options; end
|
602
|
+
|
603
|
+
# The options you gave the Encoder at creating.
|
604
|
+
#
|
605
|
+
# source://coderay//lib/coderay/encoders/encoder.rb#43
|
606
|
+
def options=(_arg0); end
|
607
|
+
|
608
|
+
# The options you gave the Encoder at creating.
|
609
|
+
#
|
610
|
+
# source://coderay//lib/coderay/encoders/encoder.rb#43
|
611
|
+
def scanner; end
|
612
|
+
|
613
|
+
# The options you gave the Encoder at creating.
|
614
|
+
#
|
615
|
+
# source://coderay//lib/coderay/encoders/encoder.rb#43
|
616
|
+
def scanner=(_arg0); end
|
617
|
+
|
618
|
+
# Called for each text token ([text, kind]), where text is a String.
|
619
|
+
#
|
620
|
+
# source://coderay//lib/coderay/encoders/encoder.rb#118
|
621
|
+
def text_token(text, kind); end
|
622
|
+
|
623
|
+
# Called with +content+ and +kind+ of the currently scanned token.
|
624
|
+
# For simple scanners, it's enougth to implement this method.
|
625
|
+
#
|
626
|
+
# By default, it calls text_token, begin_group, end_group, begin_line,
|
627
|
+
# or end_line, depending on the +content+.
|
628
|
+
#
|
629
|
+
# source://coderay//lib/coderay/encoders/encoder.rb#100
|
630
|
+
def token(content, kind); end
|
631
|
+
|
632
|
+
# Do the encoding.
|
633
|
+
#
|
634
|
+
# The already created +tokens+ object must be used; it must be a
|
635
|
+
# Tokens object.
|
636
|
+
#
|
637
|
+
# source://coderay//lib/coderay/encoders/encoder.rb#168
|
638
|
+
def tokens(tokens, options = T.unsafe(nil)); end
|
639
|
+
|
640
|
+
protected
|
641
|
+
|
642
|
+
# Do the encoding.
|
643
|
+
#
|
644
|
+
# The already created +tokens+ object must be used; it must be a
|
645
|
+
# Tokens object.
|
646
|
+
#
|
647
|
+
# source://coderay//lib/coderay/encoders/encoder.rb#168
|
648
|
+
def compile(tokens, options = T.unsafe(nil)); end
|
649
|
+
|
650
|
+
# Called with merged options after encoding starts.
|
651
|
+
# The return value is the result of encoding, typically @out.
|
652
|
+
#
|
653
|
+
# source://coderay//lib/coderay/encoders/encoder.rb#160
|
654
|
+
def finish(options); end
|
655
|
+
|
656
|
+
# source://coderay//lib/coderay/encoders/encoder.rb#148
|
657
|
+
def get_output(options); end
|
658
|
+
|
659
|
+
# Append data.to_s to the output. Returns the argument.
|
660
|
+
#
|
661
|
+
# source://coderay//lib/coderay/encoders/encoder.rb#153
|
662
|
+
def output(data); end
|
663
|
+
|
664
|
+
# Called with merged options before encoding starts.
|
665
|
+
# Sets @out to an empty string.
|
666
|
+
#
|
667
|
+
# See the HTML Encoder for an example of option caching.
|
668
|
+
#
|
669
|
+
# source://coderay//lib/coderay/encoders/encoder.rb#144
|
670
|
+
def setup(options); end
|
671
|
+
|
672
|
+
class << self
|
673
|
+
# If FILE_EXTENSION isn't defined, this method returns the
|
674
|
+
# downcase class name instead.
|
675
|
+
#
|
676
|
+
# source://coderay//lib/coderay/encoders/encoder.rb#24
|
677
|
+
def const_missing(sym); end
|
678
|
+
|
679
|
+
# The default file extension for output file of this encoder class.
|
680
|
+
#
|
681
|
+
# source://coderay//lib/coderay/encoders/encoder.rb#33
|
682
|
+
def file_extension; end
|
683
|
+
end
|
684
|
+
end
|
685
|
+
|
686
|
+
# Subclasses are to store their default options in this constant.
|
687
|
+
#
|
688
|
+
# source://coderay//lib/coderay/encoders/encoder.rb#40
|
689
|
+
CodeRay::Encoders::Encoder::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
|
690
|
+
|
691
|
+
# source://coderay//lib/coderay/helpers/plugin.rb#41
|
692
|
+
CodeRay::Encoders::Encoder::PLUGIN_HOST = CodeRay::Encoders
|
693
|
+
|
694
|
+
# A Filter encoder has another Tokens instance as output.
|
695
|
+
# It can be subclass to select, remove, or modify tokens in the stream.
|
696
|
+
#
|
697
|
+
# Subclasses of Filter are called "Filters" and can be chained.
|
698
|
+
#
|
699
|
+
# == Options
|
700
|
+
#
|
701
|
+
# === :tokens
|
702
|
+
#
|
703
|
+
# The Tokens object which will receive the output.
|
704
|
+
#
|
705
|
+
# Default: Tokens.new
|
706
|
+
#
|
707
|
+
# See also: TokenKindFilter
|
708
|
+
#
|
709
|
+
# source://coderay//lib/coderay/encoders/filter.rb#18
|
710
|
+
class CodeRay::Encoders::Filter < ::CodeRay::Encoders::Encoder
|
711
|
+
# source://coderay//lib/coderay/encoders/filter.rb#39
|
712
|
+
def begin_group(kind); end
|
713
|
+
|
714
|
+
# source://coderay//lib/coderay/encoders/filter.rb#43
|
715
|
+
def begin_line(kind); end
|
716
|
+
|
717
|
+
# source://coderay//lib/coderay/encoders/filter.rb#47
|
718
|
+
def end_group(kind); end
|
719
|
+
|
720
|
+
# source://coderay//lib/coderay/encoders/filter.rb#51
|
721
|
+
def end_line(kind); end
|
722
|
+
|
723
|
+
# source://coderay//lib/coderay/encoders/filter.rb#35
|
724
|
+
def text_token(text, kind); end
|
725
|
+
|
726
|
+
protected
|
727
|
+
|
728
|
+
# source://coderay//lib/coderay/encoders/filter.rb#29
|
729
|
+
def finish(options); end
|
730
|
+
|
731
|
+
# source://coderay//lib/coderay/encoders/filter.rb#23
|
732
|
+
def setup(options); end
|
733
|
+
end
|
734
|
+
|
735
|
+
# = HTML Encoder
|
736
|
+
#
|
737
|
+
# This is CodeRay's most important highlighter:
|
738
|
+
# It provides save, fast XHTML generation and CSS support.
|
739
|
+
#
|
740
|
+
# == Usage
|
741
|
+
#
|
742
|
+
# require 'coderay'
|
743
|
+
# puts CodeRay.scan('Some /code/', :ruby).html #-> a HTML page
|
744
|
+
# puts CodeRay.scan('Some /code/', :ruby).html(:wrap => :span)
|
745
|
+
# #-> <span class="CodeRay"><span class="co">Some</span> /code/</span>
|
746
|
+
# puts CodeRay.scan('Some /code/', :ruby).span #-> the same
|
747
|
+
#
|
748
|
+
# puts CodeRay.scan('Some code', :ruby).html(
|
749
|
+
# :wrap => nil,
|
750
|
+
# :line_numbers => :inline,
|
751
|
+
# :css => :style
|
752
|
+
# )
|
753
|
+
#
|
754
|
+
# == Options
|
755
|
+
#
|
756
|
+
# === :tab_width
|
757
|
+
# Convert \t characters to +n+ spaces (a number or false.)
|
758
|
+
# false will keep tab characters untouched.
|
759
|
+
#
|
760
|
+
# Default: 8
|
761
|
+
#
|
762
|
+
# === :css
|
763
|
+
# How to include the styles; can be :class or :style.
|
764
|
+
#
|
765
|
+
# Default: :class
|
766
|
+
#
|
767
|
+
# === :wrap
|
768
|
+
# Wrap in :page, :div, :span or nil.
|
769
|
+
#
|
770
|
+
# You can also use Encoders::Div and Encoders::Span.
|
771
|
+
#
|
772
|
+
# Default: nil
|
773
|
+
#
|
774
|
+
# === :title
|
775
|
+
#
|
776
|
+
# The title of the HTML page (works only when :wrap is set to :page.)
|
777
|
+
#
|
778
|
+
# Default: 'CodeRay output'
|
779
|
+
#
|
780
|
+
# === :break_lines
|
781
|
+
#
|
782
|
+
# Split multiline blocks at line breaks.
|
783
|
+
# Forced to true if :line_numbers option is set to :inline.
|
784
|
+
#
|
785
|
+
# Default: false
|
786
|
+
#
|
787
|
+
# === :line_numbers
|
788
|
+
# Include line numbers in :table, :inline, or nil (no line numbers)
|
789
|
+
#
|
790
|
+
# Default: nil
|
791
|
+
#
|
792
|
+
# === :line_number_anchors
|
793
|
+
# Adds anchors and links to the line numbers. Can be false (off), true (on),
|
794
|
+
# or a prefix string that will be prepended to the anchor name.
|
795
|
+
#
|
796
|
+
# The prefix must consist only of letters, digits, and underscores.
|
797
|
+
#
|
798
|
+
# Default: true, default prefix name: "line"
|
799
|
+
#
|
800
|
+
# === :line_number_start
|
801
|
+
# Where to start with line number counting.
|
802
|
+
#
|
803
|
+
# Default: 1
|
804
|
+
#
|
805
|
+
# === :bold_every
|
806
|
+
# Make every +n+-th number appear bold.
|
807
|
+
#
|
808
|
+
# Default: 10
|
809
|
+
#
|
810
|
+
# === :highlight_lines
|
811
|
+
#
|
812
|
+
# Highlights certain line numbers.
|
813
|
+
# Can be any Enumerable, typically just an Array or Range, of numbers.
|
814
|
+
#
|
815
|
+
# Bolding is deactivated when :highlight_lines is set. It only makes sense
|
816
|
+
# in combination with :line_numbers.
|
817
|
+
#
|
818
|
+
# Default: nil
|
819
|
+
#
|
820
|
+
# === :hint
|
821
|
+
# Include some information into the output using the title attribute.
|
822
|
+
# Can be :info (show token kind on mouse-over), :info_long (with full path)
|
823
|
+
# or :debug (via inspect).
|
824
|
+
#
|
825
|
+
# Default: false
|
826
|
+
#
|
827
|
+
# source://coderay//lib/coderay/encoders/html.rb#97
|
828
|
+
class CodeRay::Encoders::HTML < ::CodeRay::Encoders::Encoder
|
829
|
+
# token groups, eg. strings
|
830
|
+
#
|
831
|
+
# source://coderay//lib/coderay/encoders/html.rb#235
|
832
|
+
def begin_group(kind); end
|
833
|
+
|
834
|
+
# whole lines to be highlighted, eg. a deleted line in a diff
|
835
|
+
#
|
836
|
+
# source://coderay//lib/coderay/encoders/html.rb#247
|
837
|
+
def begin_line(kind); end
|
838
|
+
|
839
|
+
# Returns the value of attribute css.
|
840
|
+
#
|
841
|
+
# source://coderay//lib/coderay/encoders/html.rb#126
|
842
|
+
def css; end
|
843
|
+
|
844
|
+
# source://coderay//lib/coderay/encoders/html.rb#241
|
845
|
+
def end_group(kind); end
|
846
|
+
|
847
|
+
# source://coderay//lib/coderay/encoders/html.rb#261
|
848
|
+
def end_line(kind); end
|
849
|
+
|
850
|
+
# source://coderay//lib/coderay/encoders/html.rb#221
|
851
|
+
def text_token(text, kind); end
|
852
|
+
|
853
|
+
protected
|
854
|
+
|
855
|
+
# source://coderay//lib/coderay/encoders/html.rb#316
|
856
|
+
def break_lines(text, style); end
|
857
|
+
|
858
|
+
# source://coderay//lib/coderay/encoders/html.rb#310
|
859
|
+
def check_group_nesting(name, kind); end
|
860
|
+
|
861
|
+
# source://coderay//lib/coderay/encoders/html.rb#268
|
862
|
+
def check_options!(options); end
|
863
|
+
|
864
|
+
# source://coderay//lib/coderay/encoders/html.rb#324
|
865
|
+
def close_span; end
|
866
|
+
|
867
|
+
# source://coderay//lib/coderay/encoders/html.rb#280
|
868
|
+
def css_class_for_kinds(kinds); end
|
869
|
+
|
870
|
+
# source://coderay//lib/coderay/encoders/html.rb#195
|
871
|
+
def finish(options); end
|
872
|
+
|
873
|
+
# source://coderay//lib/coderay/encoders/html.rb#289
|
874
|
+
def make_span_for_kinds(method, hint); end
|
875
|
+
|
876
|
+
# source://coderay//lib/coderay/encoders/html.rb#172
|
877
|
+
def setup(options); end
|
878
|
+
|
879
|
+
# source://coderay//lib/coderay/encoders/html.rb#284
|
880
|
+
def style_for_kinds(kinds); end
|
881
|
+
|
882
|
+
class << self
|
883
|
+
# source://coderay//lib/coderay/encoders/html.rb#130
|
884
|
+
def make_html_escape_hash; end
|
885
|
+
|
886
|
+
# Generate a hint about the given +kinds+ in a +hint+ style.
|
887
|
+
#
|
888
|
+
# +hint+ may be :info, :info_long or :debug.
|
889
|
+
#
|
890
|
+
# source://coderay//lib/coderay/encoders/html.rb#157
|
891
|
+
def token_path_to_hint(hint, kinds); end
|
892
|
+
end
|
893
|
+
end
|
894
|
+
|
895
|
+
# source://coderay//lib/coderay/encoders/html/css.rb#5
|
896
|
+
class CodeRay::Encoders::HTML::CSS
|
897
|
+
# @return [CSS] a new instance of CSS
|
898
|
+
#
|
899
|
+
# source://coderay//lib/coderay/encoders/html/css.rb#13
|
900
|
+
def initialize(style = T.unsafe(nil)); end
|
901
|
+
|
902
|
+
# source://coderay//lib/coderay/encoders/html/css.rb#23
|
903
|
+
def get_style_for_css_classes(css_classes); end
|
904
|
+
|
905
|
+
# Returns the value of attribute stylesheet.
|
906
|
+
#
|
907
|
+
# source://coderay//lib/coderay/encoders/html/css.rb#7
|
908
|
+
def stylesheet; end
|
909
|
+
|
910
|
+
private
|
911
|
+
|
912
|
+
# source://coderay//lib/coderay/encoders/html/css.rb#49
|
913
|
+
def parse(stylesheet); end
|
914
|
+
|
915
|
+
class << self
|
916
|
+
# source://coderay//lib/coderay/encoders/html/css.rb#9
|
917
|
+
def load_stylesheet(style = T.unsafe(nil)); end
|
918
|
+
end
|
919
|
+
end
|
920
|
+
|
921
|
+
# source://coderay//lib/coderay/encoders/html/css.rb#36
|
922
|
+
CodeRay::Encoders::HTML::CSS::CSS_CLASS_PATTERN = T.let(T.unsafe(nil), Regexp)
|
923
|
+
|
924
|
+
# source://coderay//lib/coderay/encoders/html.rb#103
|
925
|
+
CodeRay::Encoders::HTML::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
|
926
|
+
|
927
|
+
# source://coderay//lib/coderay/encoders/html.rb#101
|
928
|
+
CodeRay::Encoders::HTML::FILE_EXTENSION = T.let(T.unsafe(nil), String)
|
929
|
+
|
930
|
+
# source://coderay//lib/coderay/encoders/html.rb#143
|
931
|
+
CodeRay::Encoders::HTML::HTML_ESCAPE = T.let(T.unsafe(nil), Hash)
|
932
|
+
|
933
|
+
# source://coderay//lib/coderay/encoders/html.rb#144
|
934
|
+
CodeRay::Encoders::HTML::HTML_ESCAPE_PATTERN = T.let(T.unsafe(nil), Regexp)
|
935
|
+
|
936
|
+
# source://coderay//lib/coderay/encoders/html/numbering.rb#6
|
937
|
+
module CodeRay::Encoders::HTML::Numbering
|
938
|
+
class << self
|
939
|
+
# source://coderay//lib/coderay/encoders/html/numbering.rb#8
|
940
|
+
def number!(output, mode = T.unsafe(nil), options = T.unsafe(nil)); end
|
941
|
+
end
|
942
|
+
end
|
943
|
+
|
944
|
+
# This module is included in the output String of the HTML Encoder.
|
945
|
+
#
|
946
|
+
# It provides methods like wrap, div, page etc.
|
947
|
+
#
|
948
|
+
# Remember to use #clone instead of #dup to keep the modules the object was
|
949
|
+
# extended with.
|
950
|
+
#
|
951
|
+
# TODO: Rewrite this without monkey patching.
|
952
|
+
#
|
953
|
+
# source://coderay//lib/coderay/encoders/html/output.rb#14
|
954
|
+
module CodeRay::Encoders::HTML::Output
|
955
|
+
# source://coderay//lib/coderay/encoders/html/output.rb#57
|
956
|
+
def apply_title!(title); end
|
957
|
+
|
958
|
+
# Returns the value of attribute css.
|
959
|
+
#
|
960
|
+
# source://coderay//lib/coderay/encoders/html/output.rb#16
|
961
|
+
def css; end
|
962
|
+
|
963
|
+
# Sets the attribute css
|
964
|
+
#
|
965
|
+
# @param value the value to set the attribute css to.
|
966
|
+
#
|
967
|
+
# source://coderay//lib/coderay/encoders/html/output.rb#16
|
968
|
+
def css=(_arg0); end
|
969
|
+
|
970
|
+
# source://coderay//lib/coderay/encoders/html/output.rb#86
|
971
|
+
def stylesheet(in_tag = T.unsafe(nil)); end
|
972
|
+
|
973
|
+
# source://coderay//lib/coderay/encoders/html/output.rb#62
|
974
|
+
def wrap!(element, *args); end
|
975
|
+
|
976
|
+
# source://coderay//lib/coderay/encoders/html/output.rb#52
|
977
|
+
def wrap_in!(template); end
|
978
|
+
|
979
|
+
# source://coderay//lib/coderay/encoders/html/output.rb#47
|
980
|
+
def wrapped_in; end
|
981
|
+
|
982
|
+
# Sets the attribute wrapped_in
|
983
|
+
#
|
984
|
+
# @param value the value to set the attribute wrapped_in to.
|
985
|
+
#
|
986
|
+
# source://coderay//lib/coderay/encoders/html/output.rb#50
|
987
|
+
def wrapped_in=(_arg0); end
|
988
|
+
|
989
|
+
# @return [Boolean]
|
990
|
+
#
|
991
|
+
# source://coderay//lib/coderay/encoders/html/output.rb#43
|
992
|
+
def wrapped_in?(element); end
|
993
|
+
|
994
|
+
class << self
|
995
|
+
# Raises an exception if an object that doesn't respond to to_str is extended by Output,
|
996
|
+
# to prevent users from misuse. Use Module#remove_method to disable.
|
997
|
+
#
|
998
|
+
# source://coderay//lib/coderay/encoders/html/output.rb#22
|
999
|
+
def extended(o); end
|
1000
|
+
|
1001
|
+
# source://coderay//lib/coderay/encoders/html/output.rb#26
|
1002
|
+
def make_stylesheet(css, in_tag = T.unsafe(nil)); end
|
1003
|
+
|
1004
|
+
# source://coderay//lib/coderay/encoders/html/output.rb#36
|
1005
|
+
def page_template_for_css(css); end
|
1006
|
+
end
|
1007
|
+
end
|
1008
|
+
|
1009
|
+
# source://coderay//lib/coderay/encoders/html/output.rb#117
|
1010
|
+
CodeRay::Encoders::HTML::Output::DIV = T.let(T.unsafe(nil), CodeRay::Encoders::HTML::Output::Template)
|
1011
|
+
|
1012
|
+
# source://coderay//lib/coderay/encoders/html/output.rb#130
|
1013
|
+
CodeRay::Encoders::HTML::Output::PAGE = T.let(T.unsafe(nil), CodeRay::Encoders::HTML::Output::Template)
|
1014
|
+
|
1015
|
+
# source://coderay//lib/coderay/encoders/html/output.rb#115
|
1016
|
+
CodeRay::Encoders::HTML::Output::SPAN = T.let(T.unsafe(nil), CodeRay::Encoders::HTML::Output::Template)
|
1017
|
+
|
1018
|
+
# source://coderay//lib/coderay/encoders/html/output.rb#123
|
1019
|
+
CodeRay::Encoders::HTML::Output::TABLE = T.let(T.unsafe(nil), CodeRay::Encoders::HTML::Output::Template)
|
1020
|
+
|
1021
|
+
# -- don't include the templates in docu
|
1022
|
+
#
|
1023
|
+
# source://coderay//lib/coderay/encoders/html/output.rb#92
|
1024
|
+
class CodeRay::Encoders::HTML::Output::Template < ::String
|
1025
|
+
# source://coderay//lib/coderay/encoders/html/output.rb#104
|
1026
|
+
def apply(target, replacement); end
|
1027
|
+
|
1028
|
+
class << self
|
1029
|
+
# source://coderay//lib/coderay/encoders/html/output.rb#94
|
1030
|
+
def wrap!(str, template, target); end
|
1031
|
+
end
|
1032
|
+
end
|
1033
|
+
|
1034
|
+
# source://coderay//lib/coderay/encoders/html.rb#146
|
1035
|
+
CodeRay::Encoders::HTML::TOKEN_KIND_TO_INFO = T.let(T.unsafe(nil), Hash)
|
1036
|
+
|
1037
|
+
# source://coderay//lib/coderay/encoders/html.rb#150
|
1038
|
+
CodeRay::Encoders::HTML::TRANSPARENT_TOKEN_KINDS = T.let(T.unsafe(nil), Set)
|
1039
|
+
|
1040
|
+
# A simple JSON Encoder.
|
1041
|
+
#
|
1042
|
+
# Example:
|
1043
|
+
# CodeRay.scan('puts "Hello world!"', :ruby).json
|
1044
|
+
# yields
|
1045
|
+
# [
|
1046
|
+
# {"type"=>"text", "text"=>"puts", "kind"=>"ident"},
|
1047
|
+
# {"type"=>"text", "text"=>" ", "kind"=>"space"},
|
1048
|
+
# {"type"=>"block", "action"=>"open", "kind"=>"string"},
|
1049
|
+
# {"type"=>"text", "text"=>"\"", "kind"=>"delimiter"},
|
1050
|
+
# {"type"=>"text", "text"=>"Hello world!", "kind"=>"content"},
|
1051
|
+
# {"type"=>"text", "text"=>"\"", "kind"=>"delimiter"},
|
1052
|
+
# {"type"=>"block", "action"=>"close", "kind"=>"string"},
|
1053
|
+
# ]
|
1054
|
+
#
|
1055
|
+
# source://coderay//lib/coderay/encoders/json.rb#18
|
1056
|
+
class CodeRay::Encoders::JSON < ::CodeRay::Encoders::Encoder
|
1057
|
+
# source://coderay//lib/coderay/encoders/json.rb#64
|
1058
|
+
def begin_group(kind); end
|
1059
|
+
|
1060
|
+
# source://coderay//lib/coderay/encoders/json.rb#72
|
1061
|
+
def begin_line(kind); end
|
1062
|
+
|
1063
|
+
# source://coderay//lib/coderay/encoders/json.rb#68
|
1064
|
+
def end_group(kind); end
|
1065
|
+
|
1066
|
+
# source://coderay//lib/coderay/encoders/json.rb#76
|
1067
|
+
def end_line(kind); end
|
1068
|
+
|
1069
|
+
# source://coderay//lib/coderay/encoders/json.rb#60
|
1070
|
+
def text_token(text, kind); end
|
1071
|
+
|
1072
|
+
protected
|
1073
|
+
|
1074
|
+
# source://coderay//lib/coderay/encoders/json.rb#49
|
1075
|
+
def append(data); end
|
1076
|
+
|
1077
|
+
# source://coderay//lib/coderay/encoders/json.rb#45
|
1078
|
+
def finish(options); end
|
1079
|
+
|
1080
|
+
# source://coderay//lib/coderay/encoders/json.rb#38
|
1081
|
+
def setup(options); end
|
1082
|
+
end
|
1083
|
+
|
1084
|
+
# source://coderay//lib/coderay/encoders/json.rb#35
|
1085
|
+
CodeRay::Encoders::JSON::FILE_EXTENSION = T.let(T.unsafe(nil), String)
|
1086
|
+
|
1087
|
+
# Counts the LoC (Lines of Code). Returns an Integer >= 0.
|
1088
|
+
#
|
1089
|
+
# Alias: +loc+
|
1090
|
+
#
|
1091
|
+
# Everything that is not comment, markup, doctype/shebang, or an empty line,
|
1092
|
+
# is considered to be code.
|
1093
|
+
#
|
1094
|
+
# For example,
|
1095
|
+
# * HTML files not containing JavaScript have 0 LoC
|
1096
|
+
# * in a Java class without comments, LoC is the number of non-empty lines
|
1097
|
+
#
|
1098
|
+
# A Scanner class should define the token kinds that are not code in the
|
1099
|
+
# KINDS_NOT_LOC constant, which defaults to [:comment, :doctype].
|
1100
|
+
#
|
1101
|
+
# source://coderay//lib/coderay/encoders/lines_of_code.rb#17
|
1102
|
+
class CodeRay::Encoders::LinesOfCode < ::CodeRay::Encoders::TokenKindFilter
|
1103
|
+
protected
|
1104
|
+
|
1105
|
+
# source://coderay//lib/coderay/encoders/lines_of_code.rb#38
|
1106
|
+
def finish(options); end
|
1107
|
+
|
1108
|
+
# source://coderay//lib/coderay/encoders/lines_of_code.rb#25
|
1109
|
+
def setup(options); end
|
1110
|
+
end
|
1111
|
+
|
1112
|
+
# source://coderay//lib/coderay/encoders/lines_of_code.rb#21
|
1113
|
+
CodeRay::Encoders::LinesOfCode::NON_EMPTY_LINE = T.let(T.unsafe(nil), Regexp)
|
1114
|
+
|
1115
|
+
# = Lint Encoder
|
1116
|
+
#
|
1117
|
+
# Checks for:
|
1118
|
+
#
|
1119
|
+
# - empty tokens
|
1120
|
+
# - incorrect nesting
|
1121
|
+
#
|
1122
|
+
# It will raise an InvalidTokenStream exception when any of the above occurs.
|
1123
|
+
#
|
1124
|
+
# See also: Encoders::DebugLint
|
1125
|
+
#
|
1126
|
+
# source://coderay//lib/coderay/encoders/lint.rb#14
|
1127
|
+
class CodeRay::Encoders::Lint < ::CodeRay::Encoders::Debug
|
1128
|
+
# source://coderay//lib/coderay/encoders/lint.rb#28
|
1129
|
+
def begin_group(kind); end
|
1130
|
+
|
1131
|
+
# source://coderay//lib/coderay/encoders/lint.rb#37
|
1132
|
+
def begin_line(kind); end
|
1133
|
+
|
1134
|
+
# @raise [IncorrectTokenGroupNesting]
|
1135
|
+
#
|
1136
|
+
# source://coderay//lib/coderay/encoders/lint.rb#32
|
1137
|
+
def end_group(kind); end
|
1138
|
+
|
1139
|
+
# @raise [IncorrectTokenGroupNesting]
|
1140
|
+
#
|
1141
|
+
# source://coderay//lib/coderay/encoders/lint.rb#41
|
1142
|
+
def end_line(kind); end
|
1143
|
+
|
1144
|
+
# @raise [EmptyToken]
|
1145
|
+
#
|
1146
|
+
# source://coderay//lib/coderay/encoders/lint.rb#23
|
1147
|
+
def text_token(text, kind); end
|
1148
|
+
|
1149
|
+
protected
|
1150
|
+
|
1151
|
+
# source://coderay//lib/coderay/encoders/lint.rb#52
|
1152
|
+
def finish(options); end
|
1153
|
+
|
1154
|
+
# source://coderay//lib/coderay/encoders/lint.rb#48
|
1155
|
+
def setup(options); end
|
1156
|
+
end
|
1157
|
+
|
1158
|
+
# source://coderay//lib/coderay/encoders/lint.rb#19
|
1159
|
+
class CodeRay::Encoders::Lint::EmptyToken < ::CodeRay::Encoders::Lint::InvalidTokenStream; end
|
1160
|
+
|
1161
|
+
# source://coderay//lib/coderay/encoders/lint.rb#21
|
1162
|
+
class CodeRay::Encoders::Lint::IncorrectTokenGroupNesting < ::CodeRay::Encoders::Lint::InvalidTokenStream; end
|
1163
|
+
|
1164
|
+
# source://coderay//lib/coderay/encoders/lint.rb#18
|
1165
|
+
class CodeRay::Encoders::Lint::InvalidTokenStream < ::StandardError; end
|
1166
|
+
|
1167
|
+
# source://coderay//lib/coderay/encoders/lint.rb#20
|
1168
|
+
class CodeRay::Encoders::Lint::UnknownTokenKind < ::CodeRay::Encoders::Lint::InvalidTokenStream; end
|
1169
|
+
|
1170
|
+
# = Null Encoder
|
1171
|
+
#
|
1172
|
+
# Does nothing and returns an empty string.
|
1173
|
+
#
|
1174
|
+
# source://coderay//lib/coderay/encoders/null.rb#7
|
1175
|
+
class CodeRay::Encoders::Null < ::CodeRay::Encoders::Encoder
|
1176
|
+
# source://coderay//lib/coderay/encoders/null.rb#11
|
1177
|
+
def text_token(text, kind); end
|
1178
|
+
end
|
1179
|
+
|
1180
|
+
# Wraps the output into a HTML page, using CSS classes and
|
1181
|
+
# line numbers in the table format by default.
|
1182
|
+
#
|
1183
|
+
# See Encoders::HTML for available options.
|
1184
|
+
#
|
1185
|
+
# source://coderay//lib/coderay/encoders/page.rb#10
|
1186
|
+
class CodeRay::Encoders::Page < ::CodeRay::Encoders::HTML; end
|
1187
|
+
|
1188
|
+
# source://coderay//lib/coderay/encoders/page.rb#16
|
1189
|
+
CodeRay::Encoders::Page::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
|
1190
|
+
|
1191
|
+
# source://coderay//lib/coderay/encoders/page.rb#12
|
1192
|
+
CodeRay::Encoders::Page::FILE_EXTENSION = T.let(T.unsafe(nil), String)
|
1193
|
+
|
1194
|
+
# Wraps HTML output into a SPAN element, using inline styles by default.
|
1195
|
+
#
|
1196
|
+
# See Encoders::HTML for available options.
|
1197
|
+
#
|
1198
|
+
# source://coderay//lib/coderay/encoders/span.rb#9
|
1199
|
+
class CodeRay::Encoders::Span < ::CodeRay::Encoders::HTML; end
|
1200
|
+
|
1201
|
+
# source://coderay//lib/coderay/encoders/span.rb#15
|
1202
|
+
CodeRay::Encoders::Span::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
|
1203
|
+
|
1204
|
+
# source://coderay//lib/coderay/encoders/span.rb#11
|
1205
|
+
CodeRay::Encoders::Span::FILE_EXTENSION = T.let(T.unsafe(nil), String)
|
1206
|
+
|
1207
|
+
# Makes a statistic for the given tokens.
|
1208
|
+
#
|
1209
|
+
# Alias: +stats+
|
1210
|
+
#
|
1211
|
+
# source://coderay//lib/coderay/encoders/statistic.rb#7
|
1212
|
+
class CodeRay::Encoders::Statistic < ::CodeRay::Encoders::Encoder
|
1213
|
+
# source://coderay//lib/coderay/encoders/statistic.rb#70
|
1214
|
+
def begin_group(kind); end
|
1215
|
+
|
1216
|
+
# source://coderay//lib/coderay/encoders/statistic.rb#78
|
1217
|
+
def begin_line(kind); end
|
1218
|
+
|
1219
|
+
# source://coderay//lib/coderay/encoders/statistic.rb#86
|
1220
|
+
def block_token(action, kind); end
|
1221
|
+
|
1222
|
+
# source://coderay//lib/coderay/encoders/statistic.rb#74
|
1223
|
+
def end_group(kind); end
|
1224
|
+
|
1225
|
+
# source://coderay//lib/coderay/encoders/statistic.rb#82
|
1226
|
+
def end_line(kind); end
|
1227
|
+
|
1228
|
+
# source://coderay//lib/coderay/encoders/statistic.rb#11
|
1229
|
+
def real_token_count; end
|
1230
|
+
|
1231
|
+
# source://coderay//lib/coderay/encoders/statistic.rb#62
|
1232
|
+
def text_token(text, kind); end
|
1233
|
+
|
1234
|
+
# source://coderay//lib/coderay/encoders/statistic.rb#11
|
1235
|
+
def type_stats; end
|
1236
|
+
|
1237
|
+
protected
|
1238
|
+
|
1239
|
+
# source://coderay//lib/coderay/encoders/statistic.rb#42
|
1240
|
+
def finish(options); end
|
1241
|
+
|
1242
|
+
# source://coderay//lib/coderay/encoders/statistic.rb#17
|
1243
|
+
def setup(options); end
|
1244
|
+
end
|
1245
|
+
|
1246
|
+
# source://coderay//lib/coderay/encoders/statistic.rb#24
|
1247
|
+
CodeRay::Encoders::Statistic::STATS = T.let(T.unsafe(nil), String)
|
1248
|
+
|
1249
|
+
# source://coderay//lib/coderay/encoders/statistic.rb#38
|
1250
|
+
CodeRay::Encoders::Statistic::TOKEN_TYPES_ROW = T.let(T.unsafe(nil), String)
|
1251
|
+
|
1252
|
+
# source://coderay//lib/coderay/encoders/statistic.rb#13
|
1253
|
+
class CodeRay::Encoders::Statistic::TypeStats < ::Struct
|
1254
|
+
# Returns the value of attribute count
|
1255
|
+
#
|
1256
|
+
# @return [Object] the current value of count
|
1257
|
+
def count; end
|
1258
|
+
|
1259
|
+
# Sets the attribute count
|
1260
|
+
#
|
1261
|
+
# @param value [Object] the value to set the attribute count to.
|
1262
|
+
# @return [Object] the newly set value
|
1263
|
+
#
|
1264
|
+
# source://coderay//lib/coderay/encoders/statistic.rb#13
|
1265
|
+
def count=(_); end
|
1266
|
+
|
1267
|
+
# Returns the value of attribute size
|
1268
|
+
#
|
1269
|
+
# @return [Object] the current value of size
|
1270
|
+
def size; end
|
1271
|
+
|
1272
|
+
# Sets the attribute size
|
1273
|
+
#
|
1274
|
+
# @param value [Object] the value to set the attribute size to.
|
1275
|
+
# @return [Object] the newly set value
|
1276
|
+
#
|
1277
|
+
# source://coderay//lib/coderay/encoders/statistic.rb#13
|
1278
|
+
def size=(_); end
|
1279
|
+
|
1280
|
+
class << self
|
1281
|
+
def [](*_arg0); end
|
1282
|
+
def inspect; end
|
1283
|
+
def members; end
|
1284
|
+
def new(*_arg0); end
|
1285
|
+
end
|
1286
|
+
end
|
1287
|
+
|
1288
|
+
# source://coderay//lib/coderay/encoders/terminal.rb#17
|
1289
|
+
class CodeRay::Encoders::Terminal < ::CodeRay::Encoders::Encoder
|
1290
|
+
# source://coderay//lib/coderay/encoders/terminal.rb#156
|
1291
|
+
def begin_group(kind); end
|
1292
|
+
|
1293
|
+
# source://coderay//lib/coderay/encoders/terminal.rb#156
|
1294
|
+
def begin_line(kind); end
|
1295
|
+
|
1296
|
+
# source://coderay//lib/coderay/encoders/terminal.rb#162
|
1297
|
+
def end_group(kind); end
|
1298
|
+
|
1299
|
+
# source://coderay//lib/coderay/encoders/terminal.rb#172
|
1300
|
+
def end_line(kind); end
|
1301
|
+
|
1302
|
+
# source://coderay//lib/coderay/encoders/terminal.rb#141
|
1303
|
+
def text_token(text, kind); end
|
1304
|
+
|
1305
|
+
protected
|
1306
|
+
|
1307
|
+
# source://coderay//lib/coderay/encoders/terminal.rb#133
|
1308
|
+
def setup(options); end
|
1309
|
+
|
1310
|
+
private
|
1311
|
+
|
1312
|
+
# source://coderay//lib/coderay/encoders/terminal.rb#179
|
1313
|
+
def open_token(kind); end
|
1314
|
+
end
|
1315
|
+
|
1316
|
+
# source://coderay//lib/coderay/encoders/terminal.rb#21
|
1317
|
+
CodeRay::Encoders::Terminal::TOKEN_COLORS = T.let(T.unsafe(nil), Hash)
|
1318
|
+
|
1319
|
+
# Concats the tokens into a single string, resulting in the original
|
1320
|
+
# code string if no tokens were removed.
|
1321
|
+
#
|
1322
|
+
# Alias: +plain+, +plaintext+
|
1323
|
+
#
|
1324
|
+
# == Options
|
1325
|
+
#
|
1326
|
+
# === :separator
|
1327
|
+
# A separator string to join the tokens.
|
1328
|
+
#
|
1329
|
+
# Default: empty String
|
1330
|
+
#
|
1331
|
+
# source://coderay//lib/coderay/encoders/text.rb#15
|
1332
|
+
class CodeRay::Encoders::Text < ::CodeRay::Encoders::Encoder
|
1333
|
+
# source://coderay//lib/coderay/encoders/text.rb#25
|
1334
|
+
def text_token(text, kind); end
|
1335
|
+
|
1336
|
+
protected
|
1337
|
+
|
1338
|
+
# source://coderay//lib/coderay/encoders/text.rb#36
|
1339
|
+
def setup(options); end
|
1340
|
+
end
|
1341
|
+
|
1342
|
+
# source://coderay//lib/coderay/encoders/text.rb#21
|
1343
|
+
CodeRay::Encoders::Text::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
|
1344
|
+
|
1345
|
+
# source://coderay//lib/coderay/encoders/text.rb#19
|
1346
|
+
CodeRay::Encoders::Text::FILE_EXTENSION = T.let(T.unsafe(nil), String)
|
1347
|
+
|
1348
|
+
# A Filter that selects tokens based on their token kind.
|
1349
|
+
#
|
1350
|
+
# == Options
|
1351
|
+
#
|
1352
|
+
# === :exclude
|
1353
|
+
#
|
1354
|
+
# One or many symbols (in an Array) which shall be excluded.
|
1355
|
+
#
|
1356
|
+
# Default: []
|
1357
|
+
#
|
1358
|
+
# === :include
|
1359
|
+
#
|
1360
|
+
# One or many symbols (in an array) which shall be included.
|
1361
|
+
#
|
1362
|
+
# Default: :all, which means all tokens are included.
|
1363
|
+
#
|
1364
|
+
# Exclusion wins over inclusion.
|
1365
|
+
#
|
1366
|
+
# See also: CommentFilter
|
1367
|
+
#
|
1368
|
+
# source://coderay//lib/coderay/encoders/token_kind_filter.rb#25
|
1369
|
+
class CodeRay::Encoders::TokenKindFilter < ::CodeRay::Encoders::Filter
|
1370
|
+
# Add the token group to the output stream if +kind+ matches the
|
1371
|
+
# conditions.
|
1372
|
+
#
|
1373
|
+
# If it does not, all tokens inside the group are excluded from the
|
1374
|
+
# stream, even if their kinds match.
|
1375
|
+
#
|
1376
|
+
# source://coderay//lib/coderay/encoders/token_kind_filter.rb#66
|
1377
|
+
def begin_group(kind); end
|
1378
|
+
|
1379
|
+
# See +begin_group+.
|
1380
|
+
#
|
1381
|
+
# source://coderay//lib/coderay/encoders/token_kind_filter.rb#77
|
1382
|
+
def begin_line(kind); end
|
1383
|
+
|
1384
|
+
# Take care of re-enabling the delegation of tokens to the output stream
|
1385
|
+
# if an exluded group has ended.
|
1386
|
+
#
|
1387
|
+
# source://coderay//lib/coderay/encoders/token_kind_filter.rb#89
|
1388
|
+
def end_group(kind); end
|
1389
|
+
|
1390
|
+
# See +end_group+.
|
1391
|
+
#
|
1392
|
+
# source://coderay//lib/coderay/encoders/token_kind_filter.rb#99
|
1393
|
+
def end_line(kind); end
|
1394
|
+
|
1395
|
+
# Add the token to the output stream if +kind+ matches the conditions.
|
1396
|
+
#
|
1397
|
+
# source://coderay//lib/coderay/encoders/token_kind_filter.rb#57
|
1398
|
+
def text_token(text, kind); end
|
1399
|
+
|
1400
|
+
protected
|
1401
|
+
|
1402
|
+
# @return [Boolean]
|
1403
|
+
#
|
1404
|
+
# source://coderay//lib/coderay/encoders/token_kind_filter.rb#49
|
1405
|
+
def include_group?(kind); end
|
1406
|
+
|
1407
|
+
# @return [Boolean]
|
1408
|
+
#
|
1409
|
+
# source://coderay//lib/coderay/encoders/token_kind_filter.rb#45
|
1410
|
+
def include_text_token?(text, kind); end
|
1411
|
+
|
1412
|
+
# source://coderay//lib/coderay/encoders/token_kind_filter.rb#35
|
1413
|
+
def setup(options); end
|
1414
|
+
end
|
1415
|
+
|
1416
|
+
# source://coderay//lib/coderay/encoders/token_kind_filter.rb#29
|
1417
|
+
CodeRay::Encoders::TokenKindFilter::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
|
1418
|
+
|
1419
|
+
# = XML Encoder
|
1420
|
+
#
|
1421
|
+
# Uses REXML. Very slow.
|
1422
|
+
#
|
1423
|
+
# source://coderay//lib/coderay/encoders/xml.rb#7
|
1424
|
+
class CodeRay::Encoders::XML < ::CodeRay::Encoders::Encoder
|
1425
|
+
# source://coderay//lib/coderay/encoders/xml.rb#58
|
1426
|
+
def begin_group(kind); end
|
1427
|
+
|
1428
|
+
# source://coderay//lib/coderay/encoders/xml.rb#62
|
1429
|
+
def end_group(kind); end
|
1430
|
+
|
1431
|
+
# source://coderay//lib/coderay/encoders/xml.rb#38
|
1432
|
+
def text_token(text, kind); end
|
1433
|
+
|
1434
|
+
protected
|
1435
|
+
|
1436
|
+
# source://coderay//lib/coderay/encoders/xml.rb#31
|
1437
|
+
def finish(options); end
|
1438
|
+
|
1439
|
+
# source://coderay//lib/coderay/encoders/xml.rb#22
|
1440
|
+
def setup(options); end
|
1441
|
+
end
|
1442
|
+
|
1443
|
+
# source://coderay//lib/coderay/encoders/xml.rb#15
|
1444
|
+
CodeRay::Encoders::XML::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
|
1445
|
+
|
1446
|
+
# source://coderay//lib/coderay/encoders/xml.rb#11
|
1447
|
+
CodeRay::Encoders::XML::FILE_EXTENSION = T.let(T.unsafe(nil), String)
|
1448
|
+
|
1449
|
+
# = YAML Encoder
|
1450
|
+
#
|
1451
|
+
# Slow.
|
1452
|
+
#
|
1453
|
+
# source://coderay//lib/coderay/encoders/yaml.rb#9
|
1454
|
+
class CodeRay::Encoders::YAML < ::CodeRay::Encoders::Encoder
|
1455
|
+
# source://coderay//lib/coderay/encoders/yaml.rb#31
|
1456
|
+
def begin_group(kind); end
|
1457
|
+
|
1458
|
+
# source://coderay//lib/coderay/encoders/yaml.rb#39
|
1459
|
+
def begin_line(kind); end
|
1460
|
+
|
1461
|
+
# source://coderay//lib/coderay/encoders/yaml.rb#35
|
1462
|
+
def end_group(kind); end
|
1463
|
+
|
1464
|
+
# source://coderay//lib/coderay/encoders/yaml.rb#43
|
1465
|
+
def end_line(kind); end
|
1466
|
+
|
1467
|
+
# source://coderay//lib/coderay/encoders/yaml.rb#27
|
1468
|
+
def text_token(text, kind); end
|
1469
|
+
|
1470
|
+
protected
|
1471
|
+
|
1472
|
+
# source://coderay//lib/coderay/encoders/yaml.rb#22
|
1473
|
+
def finish(options); end
|
1474
|
+
|
1475
|
+
# source://coderay//lib/coderay/encoders/yaml.rb#16
|
1476
|
+
def setup(options); end
|
1477
|
+
end
|
1478
|
+
|
1479
|
+
# source://coderay//lib/coderay/encoders/yaml.rb#13
|
1480
|
+
CodeRay::Encoders::YAML::FILE_EXTENSION = T.let(T.unsafe(nil), String)
|
1481
|
+
|
1482
|
+
# = FileType
|
1483
|
+
#
|
1484
|
+
# A simple filetype recognizer.
|
1485
|
+
#
|
1486
|
+
# == Usage
|
1487
|
+
#
|
1488
|
+
# # determine the type of the given
|
1489
|
+
# lang = FileType[file_name]
|
1490
|
+
#
|
1491
|
+
# # return :text if the file type is unknown
|
1492
|
+
# lang = FileType.fetch file_name, :text
|
1493
|
+
#
|
1494
|
+
# # try the shebang line, too
|
1495
|
+
# lang = FileType.fetch file_name, :text, true
|
1496
|
+
#
|
1497
|
+
# source://coderay//lib/coderay/helpers/file_type.rb#17
|
1498
|
+
module CodeRay::FileType
|
1499
|
+
class << self
|
1500
|
+
# Try to determine the file type of the file.
|
1501
|
+
#
|
1502
|
+
# +filename+ is a relative or absolute path to a file.
|
1503
|
+
#
|
1504
|
+
# The file itself is only accessed when +read_shebang+ is set to true.
|
1505
|
+
# That means you can get filetypes from files that don't exist.
|
1506
|
+
#
|
1507
|
+
# source://coderay//lib/coderay/helpers/file_type.rb#29
|
1508
|
+
def [](filename, read_shebang = T.unsafe(nil)); end
|
1509
|
+
|
1510
|
+
# This works like Hash#fetch.
|
1511
|
+
#
|
1512
|
+
# If the filetype cannot be found, the +default+ value
|
1513
|
+
# is returned.
|
1514
|
+
#
|
1515
|
+
# source://coderay//lib/coderay/helpers/file_type.rb#50
|
1516
|
+
def fetch(filename, default = T.unsafe(nil), read_shebang = T.unsafe(nil)); end
|
1517
|
+
|
1518
|
+
protected
|
1519
|
+
|
1520
|
+
# source://coderay//lib/coderay/helpers/file_type.rb#66
|
1521
|
+
def type_from_shebang(filename); end
|
1522
|
+
end
|
1523
|
+
end
|
1524
|
+
|
1525
|
+
# source://coderay//lib/coderay/helpers/file_type.rb#79
|
1526
|
+
CodeRay::FileType::TypeFromExt = T.let(T.unsafe(nil), Hash)
|
1527
|
+
|
1528
|
+
# source://coderay//lib/coderay/helpers/file_type.rb#139
|
1529
|
+
CodeRay::FileType::TypeFromName = T.let(T.unsafe(nil), Hash)
|
1530
|
+
|
1531
|
+
# source://coderay//lib/coderay/helpers/file_type.rb#137
|
1532
|
+
CodeRay::FileType::TypeFromShebang = T.let(T.unsafe(nil), Regexp)
|
1533
|
+
|
1534
|
+
# source://coderay//lib/coderay/helpers/file_type.rb#19
|
1535
|
+
class CodeRay::FileType::UnknownFileType < ::Exception; end
|
1536
|
+
|
1537
|
+
# = Plugin
|
1538
|
+
#
|
1539
|
+
# Plugins have to include this module.
|
1540
|
+
#
|
1541
|
+
# IMPORTANT: Use extend for this module.
|
1542
|
+
#
|
1543
|
+
# See CodeRay::PluginHost for examples.
|
1544
|
+
#
|
1545
|
+
# source://coderay//lib/coderay/helpers/plugin.rb#10
|
1546
|
+
module CodeRay::Plugin
|
1547
|
+
# source://coderay//lib/coderay/helpers/plugin.rb#46
|
1548
|
+
def aliases; end
|
1549
|
+
|
1550
|
+
# The PluginHost for this Plugin class.
|
1551
|
+
#
|
1552
|
+
# source://coderay//lib/coderay/helpers/plugin.rb#39
|
1553
|
+
def plugin_host(host = T.unsafe(nil)); end
|
1554
|
+
|
1555
|
+
# Returns the value of attribute plugin_id.
|
1556
|
+
#
|
1557
|
+
# source://coderay//lib/coderay/helpers/plugin.rb#12
|
1558
|
+
def plugin_id; end
|
1559
|
+
|
1560
|
+
# Register this class for the given +id+.
|
1561
|
+
#
|
1562
|
+
# Example:
|
1563
|
+
# class MyPlugin < PluginHost::BaseClass
|
1564
|
+
# register_for :my_id
|
1565
|
+
# ...
|
1566
|
+
# end
|
1567
|
+
#
|
1568
|
+
# See PluginHost.register.
|
1569
|
+
#
|
1570
|
+
# source://coderay//lib/coderay/helpers/plugin.rb#23
|
1571
|
+
def register_for(id); end
|
1572
|
+
|
1573
|
+
# Returns the title of the plugin, or sets it to the
|
1574
|
+
# optional argument +title+.
|
1575
|
+
#
|
1576
|
+
# source://coderay//lib/coderay/helpers/plugin.rb#30
|
1577
|
+
def title(title = T.unsafe(nil)); end
|
1578
|
+
end
|
1579
|
+
|
1580
|
+
# = PluginHost
|
1581
|
+
#
|
1582
|
+
# A simple subclass/subfolder plugin system.
|
1583
|
+
#
|
1584
|
+
# Example:
|
1585
|
+
# class Generators
|
1586
|
+
# extend PluginHost
|
1587
|
+
# plugin_path 'app/generators'
|
1588
|
+
# end
|
1589
|
+
#
|
1590
|
+
# class Generator
|
1591
|
+
# extend Plugin
|
1592
|
+
# PLUGIN_HOST = Generators
|
1593
|
+
# end
|
1594
|
+
#
|
1595
|
+
# class FancyGenerator < Generator
|
1596
|
+
# register_for :fancy
|
1597
|
+
# end
|
1598
|
+
#
|
1599
|
+
# Generators[:fancy] #-> FancyGenerator
|
1600
|
+
# # or
|
1601
|
+
# CodeRay.require_plugin 'Generators/fancy'
|
1602
|
+
# # or
|
1603
|
+
# Generators::Fancy
|
1604
|
+
#
|
1605
|
+
# source://coderay//lib/coderay/helpers/plugin_host.rb#27
|
1606
|
+
module CodeRay::PluginHost
|
1607
|
+
# Returns the Plugin for +id+.
|
1608
|
+
#
|
1609
|
+
# Example:
|
1610
|
+
# yaml_plugin = MyPluginHost[:yaml]
|
1611
|
+
#
|
1612
|
+
# source://coderay//lib/coderay/helpers/plugin_host.rb#49
|
1613
|
+
def [](id, *args, &blk); end
|
1614
|
+
|
1615
|
+
# Returns an array of all Plugins.
|
1616
|
+
#
|
1617
|
+
# Note: This loads all plugins using load_all.
|
1618
|
+
#
|
1619
|
+
# source://coderay//lib/coderay/helpers/plugin_host.rb#151
|
1620
|
+
def all_plugins; end
|
1621
|
+
|
1622
|
+
# Tries to +load+ the missing plugin by translating +const+ to the
|
1623
|
+
# underscore form (eg. LinesOfCode becomes lines_of_code).
|
1624
|
+
#
|
1625
|
+
# source://coderay//lib/coderay/helpers/plugin_host.rb#61
|
1626
|
+
def const_missing(const); end
|
1627
|
+
|
1628
|
+
# Define the default plugin to use when no plugin is found
|
1629
|
+
# for a given id, or return the default plugin.
|
1630
|
+
#
|
1631
|
+
# See also map.
|
1632
|
+
#
|
1633
|
+
# class MyColorHost < PluginHost
|
1634
|
+
# map :navy => :dark_blue
|
1635
|
+
# default :gray
|
1636
|
+
# end
|
1637
|
+
#
|
1638
|
+
# MyColorHost.default # loads and returns the Gray plugin
|
1639
|
+
#
|
1640
|
+
# source://coderay//lib/coderay/helpers/plugin_host.rb#114
|
1641
|
+
def default(id = T.unsafe(nil)); end
|
1642
|
+
|
1643
|
+
# Returns an array of all .rb files in the plugin path.
|
1644
|
+
#
|
1645
|
+
# The extension .rb is not included.
|
1646
|
+
#
|
1647
|
+
# source://coderay//lib/coderay/helpers/plugin_host.rb#140
|
1648
|
+
def list; end
|
1649
|
+
|
1650
|
+
# Returns the Plugin for +id+.
|
1651
|
+
#
|
1652
|
+
# Example:
|
1653
|
+
# yaml_plugin = MyPluginHost[:yaml]
|
1654
|
+
#
|
1655
|
+
# source://coderay//lib/coderay/helpers/plugin_host.rb#49
|
1656
|
+
def load(id, *args, &blk); end
|
1657
|
+
|
1658
|
+
# Loads all plugins using list and load.
|
1659
|
+
#
|
1660
|
+
# source://coderay//lib/coderay/helpers/plugin_host.rb#39
|
1661
|
+
def load_all; end
|
1662
|
+
|
1663
|
+
# Loads the map file (see map).
|
1664
|
+
#
|
1665
|
+
# This is done automatically when plugin_path is called.
|
1666
|
+
#
|
1667
|
+
# source://coderay//lib/coderay/helpers/plugin_host.rb#159
|
1668
|
+
def load_plugin_map; end
|
1669
|
+
|
1670
|
+
# Map a plugin_id to another.
|
1671
|
+
#
|
1672
|
+
# Usage: Put this in a file plugin_path/_map.rb.
|
1673
|
+
#
|
1674
|
+
# class MyColorHost < PluginHost
|
1675
|
+
# map :navy => :dark_blue,
|
1676
|
+
# :maroon => :brown,
|
1677
|
+
# :luna => :moon
|
1678
|
+
# end
|
1679
|
+
#
|
1680
|
+
# source://coderay//lib/coderay/helpers/plugin_host.rb#95
|
1681
|
+
def map(hash); end
|
1682
|
+
|
1683
|
+
# A Hash of plugion_id => Plugin pairs.
|
1684
|
+
#
|
1685
|
+
# source://coderay//lib/coderay/helpers/plugin_host.rb#133
|
1686
|
+
def plugin_hash; end
|
1687
|
+
|
1688
|
+
# The path where the plugins can be found.
|
1689
|
+
#
|
1690
|
+
# source://coderay//lib/coderay/helpers/plugin_host.rb#79
|
1691
|
+
def plugin_path(*args); end
|
1692
|
+
|
1693
|
+
# Every plugin must register itself for +id+ by calling register_for,
|
1694
|
+
# which calls this method.
|
1695
|
+
#
|
1696
|
+
# See Plugin#register_for.
|
1697
|
+
#
|
1698
|
+
# source://coderay//lib/coderay/helpers/plugin_host.rb#128
|
1699
|
+
def register(plugin, id); end
|
1700
|
+
|
1701
|
+
protected
|
1702
|
+
|
1703
|
+
# Return a plugin hash that automatically loads plugins.
|
1704
|
+
#
|
1705
|
+
# source://coderay//lib/coderay/helpers/plugin_host.rb#172
|
1706
|
+
def make_plugin_hash; end
|
1707
|
+
|
1708
|
+
# Returns the expected path to the plugin file for the given id.
|
1709
|
+
#
|
1710
|
+
# source://coderay//lib/coderay/helpers/plugin_host.rb#196
|
1711
|
+
def path_to(plugin_id); end
|
1712
|
+
|
1713
|
+
# Converts +id+ to a valid plugin ID String, or returns +nil+.
|
1714
|
+
#
|
1715
|
+
# Raises +ArgumentError+ for all other objects, or if the
|
1716
|
+
# given String includes non-alphanumeric characters (\W).
|
1717
|
+
#
|
1718
|
+
# source://coderay//lib/coderay/helpers/plugin_host.rb#204
|
1719
|
+
def validate_id(id); end
|
1720
|
+
|
1721
|
+
class << self
|
1722
|
+
# Adds the module/class to the PLUGIN_HOSTS list.
|
1723
|
+
#
|
1724
|
+
# source://coderay//lib/coderay/helpers/plugin_host.rb#72
|
1725
|
+
def extended(mod); end
|
1726
|
+
end
|
1727
|
+
end
|
1728
|
+
|
1729
|
+
# source://coderay//lib/coderay/helpers/plugin_host.rb#33
|
1730
|
+
class CodeRay::PluginHost::HostNotFound < ::LoadError; end
|
1731
|
+
|
1732
|
+
# source://coderay//lib/coderay/helpers/plugin_host.rb#35
|
1733
|
+
CodeRay::PluginHost::PLUGIN_HOSTS = T.let(T.unsafe(nil), Array)
|
1734
|
+
|
1735
|
+
# dummy hash
|
1736
|
+
#
|
1737
|
+
# source://coderay//lib/coderay/helpers/plugin_host.rb#36
|
1738
|
+
CodeRay::PluginHost::PLUGIN_HOSTS_BY_ID = T.let(T.unsafe(nil), Hash)
|
1739
|
+
|
1740
|
+
# Raised if Encoders::[] fails because:
|
1741
|
+
# * a file could not be found
|
1742
|
+
# * the requested Plugin is not registered
|
1743
|
+
#
|
1744
|
+
# source://coderay//lib/coderay/helpers/plugin_host.rb#32
|
1745
|
+
class CodeRay::PluginHost::PluginNotFound < ::LoadError; end
|
1746
|
+
|
1747
|
+
# = Scanners
|
1748
|
+
#
|
1749
|
+
# This module holds the Scanner class and its subclasses.
|
1750
|
+
# For example, the Ruby scanner is named CodeRay::Scanners::Ruby
|
1751
|
+
# can be found in coderay/scanners/ruby.
|
1752
|
+
#
|
1753
|
+
# Scanner also provides methods and constants for the register
|
1754
|
+
# mechanism and the [] method that returns the Scanner class
|
1755
|
+
# belonging to the given lang.
|
1756
|
+
#
|
1757
|
+
# See PluginHost.
|
1758
|
+
#
|
1759
|
+
# source://coderay//lib/coderay/scanners.rb#18
|
1760
|
+
module CodeRay::Scanners
|
1761
|
+
extend ::CodeRay::PluginHost
|
1762
|
+
end
|
1763
|
+
|
1764
|
+
# Scanner for C.
|
1765
|
+
#
|
1766
|
+
# source://coderay//lib/coderay/scanners/c.rb#5
|
1767
|
+
class CodeRay::Scanners::C < ::CodeRay::Scanners::Scanner
|
1768
|
+
protected
|
1769
|
+
|
1770
|
+
# source://coderay//lib/coderay/scanners/c.rb#44
|
1771
|
+
def scan_tokens(encoder, options); end
|
1772
|
+
end
|
1773
|
+
|
1774
|
+
# source://coderay//lib/coderay/scanners/c.rb#27
|
1775
|
+
CodeRay::Scanners::C::DIRECTIVES = T.let(T.unsafe(nil), Array)
|
1776
|
+
|
1777
|
+
# source://coderay//lib/coderay/scanners/c.rb#39
|
1778
|
+
CodeRay::Scanners::C::ESCAPE = T.let(T.unsafe(nil), Regexp)
|
1779
|
+
|
1780
|
+
# source://coderay//lib/coderay/scanners/c.rb#33
|
1781
|
+
CodeRay::Scanners::C::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList)
|
1782
|
+
|
1783
|
+
# source://coderay//lib/coderay/scanners/c.rb#10
|
1784
|
+
CodeRay::Scanners::C::KEYWORDS = T.let(T.unsafe(nil), Array)
|
1785
|
+
|
1786
|
+
# source://coderay//lib/coderay/scanners/c.rb#23
|
1787
|
+
CodeRay::Scanners::C::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array)
|
1788
|
+
|
1789
|
+
# source://coderay//lib/coderay/scanners/c.rb#17
|
1790
|
+
CodeRay::Scanners::C::PREDEFINED_TYPES = T.let(T.unsafe(nil), Array)
|
1791
|
+
|
1792
|
+
# source://coderay//lib/coderay/scanners/c.rb#40
|
1793
|
+
CodeRay::Scanners::C::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp)
|
1794
|
+
|
1795
|
+
# Scanner for C++.
|
1796
|
+
#
|
1797
|
+
# Aliases: +cplusplus+, c++
|
1798
|
+
CodeRay::Scanners::CPlusPlus = CodeRay::Scanners::Text
|
1799
|
+
|
1800
|
+
# source://coderay//lib/coderay/scanners/css.rb#4
|
1801
|
+
class CodeRay::Scanners::CSS < ::CodeRay::Scanners::Scanner
|
1802
|
+
protected
|
1803
|
+
|
1804
|
+
# source://coderay//lib/coderay/scanners/css.rb#55
|
1805
|
+
def scan_tokens(encoder, options); end
|
1806
|
+
|
1807
|
+
# source://coderay//lib/coderay/scanners/css.rb#50
|
1808
|
+
def setup; end
|
1809
|
+
end
|
1810
|
+
|
1811
|
+
# source://coderay//lib/coderay/scanners/css.rb#8
|
1812
|
+
CodeRay::Scanners::CSS::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array)
|
1813
|
+
|
1814
|
+
# source://coderay//lib/coderay/scanners/css.rb#16
|
1815
|
+
module CodeRay::Scanners::CSS::RE; end
|
1816
|
+
|
1817
|
+
# source://coderay//lib/coderay/scanners/css.rb#31
|
1818
|
+
CodeRay::Scanners::CSS::RE::AtKeyword = T.let(T.unsafe(nil), Regexp)
|
1819
|
+
|
1820
|
+
# source://coderay//lib/coderay/scanners/css.rb#45
|
1821
|
+
CodeRay::Scanners::CSS::RE::AttributeSelector = T.let(T.unsafe(nil), Regexp)
|
1822
|
+
|
1823
|
+
# source://coderay//lib/coderay/scanners/css.rb#43
|
1824
|
+
CodeRay::Scanners::CSS::RE::Class = T.let(T.unsafe(nil), Regexp)
|
1825
|
+
|
1826
|
+
# source://coderay//lib/coderay/scanners/css.rb#38
|
1827
|
+
CodeRay::Scanners::CSS::RE::Dimension = T.let(T.unsafe(nil), Regexp)
|
1828
|
+
|
1829
|
+
# source://coderay//lib/coderay/scanners/css.rb#19
|
1830
|
+
CodeRay::Scanners::CSS::RE::Escape = T.let(T.unsafe(nil), Regexp)
|
1831
|
+
|
1832
|
+
# source://coderay//lib/coderay/scanners/css.rb#40
|
1833
|
+
CodeRay::Scanners::CSS::RE::Function = T.let(T.unsafe(nil), Regexp)
|
1834
|
+
|
1835
|
+
# source://coderay//lib/coderay/scanners/css.rb#17
|
1836
|
+
CodeRay::Scanners::CSS::RE::Hex = T.let(T.unsafe(nil), Regexp)
|
1837
|
+
|
1838
|
+
# source://coderay//lib/coderay/scanners/css.rb#26
|
1839
|
+
CodeRay::Scanners::CSS::RE::HexColor = T.let(T.unsafe(nil), Regexp)
|
1840
|
+
|
1841
|
+
# source://coderay//lib/coderay/scanners/css.rb#42
|
1842
|
+
CodeRay::Scanners::CSS::RE::Id = T.let(T.unsafe(nil), Regexp)
|
1843
|
+
|
1844
|
+
# source://coderay//lib/coderay/scanners/css.rb#30
|
1845
|
+
CodeRay::Scanners::CSS::RE::Ident = T.let(T.unsafe(nil), Regexp)
|
1846
|
+
|
1847
|
+
# source://coderay//lib/coderay/scanners/css.rb#20
|
1848
|
+
CodeRay::Scanners::CSS::RE::NMChar = T.let(T.unsafe(nil), Regexp)
|
1849
|
+
|
1850
|
+
# source://coderay//lib/coderay/scanners/css.rb#21
|
1851
|
+
CodeRay::Scanners::CSS::RE::NMStart = T.let(T.unsafe(nil), Regexp)
|
1852
|
+
|
1853
|
+
# source://coderay//lib/coderay/scanners/css.rb#29
|
1854
|
+
CodeRay::Scanners::CSS::RE::Name = T.let(T.unsafe(nil), Regexp)
|
1855
|
+
|
1856
|
+
# source://coderay//lib/coderay/scanners/css.rb#28
|
1857
|
+
CodeRay::Scanners::CSS::RE::Num = T.let(T.unsafe(nil), Regexp)
|
1858
|
+
|
1859
|
+
# source://coderay//lib/coderay/scanners/css.rb#32
|
1860
|
+
CodeRay::Scanners::CSS::RE::Percentage = T.let(T.unsafe(nil), Regexp)
|
1861
|
+
|
1862
|
+
# source://coderay//lib/coderay/scanners/css.rb#44
|
1863
|
+
CodeRay::Scanners::CSS::RE::PseudoClass = T.let(T.unsafe(nil), Regexp)
|
1864
|
+
|
1865
|
+
# source://coderay//lib/coderay/scanners/css.rb#24
|
1866
|
+
CodeRay::Scanners::CSS::RE::String = T.let(T.unsafe(nil), Regexp)
|
1867
|
+
|
1868
|
+
# TODO: buggy regexp
|
1869
|
+
#
|
1870
|
+
# source://coderay//lib/coderay/scanners/css.rb#22
|
1871
|
+
CodeRay::Scanners::CSS::RE::String1 = T.let(T.unsafe(nil), Regexp)
|
1872
|
+
|
1873
|
+
# TODO: buggy regexp
|
1874
|
+
#
|
1875
|
+
# source://coderay//lib/coderay/scanners/css.rb#23
|
1876
|
+
CodeRay::Scanners::CSS::RE::String2 = T.let(T.unsafe(nil), Regexp)
|
1877
|
+
|
1878
|
+
# differs from standard because it allows uppercase hex too
|
1879
|
+
#
|
1880
|
+
# source://coderay//lib/coderay/scanners/css.rb#18
|
1881
|
+
CodeRay::Scanners::CSS::RE::Unicode = T.let(T.unsafe(nil), Regexp)
|
1882
|
+
|
1883
|
+
# source://coderay//lib/coderay/scanners/css.rb#36
|
1884
|
+
CodeRay::Scanners::CSS::RE::Unit = T.let(T.unsafe(nil), Regexp)
|
1885
|
+
|
1886
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#6
|
1887
|
+
class CodeRay::Scanners::Clojure < ::CodeRay::Scanners::Scanner
|
1888
|
+
protected
|
1889
|
+
|
1890
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#145
|
1891
|
+
def scan_tokens(encoder, options); end
|
1892
|
+
end
|
1893
|
+
|
1894
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#95
|
1895
|
+
CodeRay::Scanners::Clojure::BASIC_IDENTIFIER = T.let(T.unsafe(nil), Regexp)
|
1896
|
+
|
1897
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#133
|
1898
|
+
CodeRay::Scanners::Clojure::COMPLEX10 = T.let(T.unsafe(nil), Regexp)
|
1899
|
+
|
1900
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#134
|
1901
|
+
CodeRay::Scanners::Clojure::COMPLEX16 = T.let(T.unsafe(nil), Regexp)
|
1902
|
+
|
1903
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#136
|
1904
|
+
CodeRay::Scanners::Clojure::COMPLEX2 = T.let(T.unsafe(nil), Regexp)
|
1905
|
+
|
1906
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#135
|
1907
|
+
CodeRay::Scanners::Clojure::COMPLEX8 = T.let(T.unsafe(nil), Regexp)
|
1908
|
+
|
1909
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#16
|
1910
|
+
CodeRay::Scanners::Clojure::CORE_FORMS = T.let(T.unsafe(nil), Array)
|
1911
|
+
|
1912
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#120
|
1913
|
+
CodeRay::Scanners::Clojure::DECIMAL = T.let(T.unsafe(nil), Regexp)
|
1914
|
+
|
1915
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#98
|
1916
|
+
CodeRay::Scanners::Clojure::DIGIT = T.let(T.unsafe(nil), Regexp)
|
1917
|
+
|
1918
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#99
|
1919
|
+
CodeRay::Scanners::Clojure::DIGIT10 = T.let(T.unsafe(nil), Regexp)
|
1920
|
+
|
1921
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#100
|
1922
|
+
CodeRay::Scanners::Clojure::DIGIT16 = T.let(T.unsafe(nil), Regexp)
|
1923
|
+
|
1924
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#102
|
1925
|
+
CodeRay::Scanners::Clojure::DIGIT2 = T.let(T.unsafe(nil), Regexp)
|
1926
|
+
|
1927
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#101
|
1928
|
+
CodeRay::Scanners::Clojure::DIGIT8 = T.let(T.unsafe(nil), Regexp)
|
1929
|
+
|
1930
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#107
|
1931
|
+
CodeRay::Scanners::Clojure::EXACTNESS = T.let(T.unsafe(nil), Regexp)
|
1932
|
+
|
1933
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#110
|
1934
|
+
CodeRay::Scanners::Clojure::EXP = T.let(T.unsafe(nil), Regexp)
|
1935
|
+
|
1936
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#109
|
1937
|
+
CodeRay::Scanners::Clojure::EXP_MARK = T.let(T.unsafe(nil), Regexp)
|
1938
|
+
|
1939
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#96
|
1940
|
+
CodeRay::Scanners::Clojure::IDENTIFIER = T.let(T.unsafe(nil), Regexp)
|
1941
|
+
|
1942
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#85
|
1943
|
+
CodeRay::Scanners::Clojure::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList)
|
1944
|
+
|
1945
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#129
|
1946
|
+
CodeRay::Scanners::Clojure::IMAG10 = T.let(T.unsafe(nil), Regexp)
|
1947
|
+
|
1948
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#130
|
1949
|
+
CodeRay::Scanners::Clojure::IMAG16 = T.let(T.unsafe(nil), Regexp)
|
1950
|
+
|
1951
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#132
|
1952
|
+
CodeRay::Scanners::Clojure::IMAG2 = T.let(T.unsafe(nil), Regexp)
|
1953
|
+
|
1954
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#131
|
1955
|
+
CodeRay::Scanners::Clojure::IMAG8 = T.let(T.unsafe(nil), Regexp)
|
1956
|
+
|
1957
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#90
|
1958
|
+
CodeRay::Scanners::Clojure::KEYWORD_NEXT_TOKEN_KIND = T.let(T.unsafe(nil), CodeRay::WordList)
|
1959
|
+
|
1960
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#141
|
1961
|
+
CodeRay::Scanners::Clojure::NUM = T.let(T.unsafe(nil), Regexp)
|
1962
|
+
|
1963
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#137
|
1964
|
+
CodeRay::Scanners::Clojure::NUM10 = T.let(T.unsafe(nil), Regexp)
|
1965
|
+
|
1966
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#138
|
1967
|
+
CodeRay::Scanners::Clojure::NUM16 = T.let(T.unsafe(nil), Regexp)
|
1968
|
+
|
1969
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#140
|
1970
|
+
CodeRay::Scanners::Clojure::NUM2 = T.let(T.unsafe(nil), Regexp)
|
1971
|
+
|
1972
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#139
|
1973
|
+
CodeRay::Scanners::Clojure::NUM8 = T.let(T.unsafe(nil), Regexp)
|
1974
|
+
|
1975
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#78
|
1976
|
+
CodeRay::Scanners::Clojure::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array)
|
1977
|
+
|
1978
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#112
|
1979
|
+
CodeRay::Scanners::Clojure::PREFIX10 = T.let(T.unsafe(nil), Regexp)
|
1980
|
+
|
1981
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#113
|
1982
|
+
CodeRay::Scanners::Clojure::PREFIX16 = T.let(T.unsafe(nil), Regexp)
|
1983
|
+
|
1984
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#115
|
1985
|
+
CodeRay::Scanners::Clojure::PREFIX2 = T.let(T.unsafe(nil), Regexp)
|
1986
|
+
|
1987
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#114
|
1988
|
+
CodeRay::Scanners::Clojure::PREFIX8 = T.let(T.unsafe(nil), Regexp)
|
1989
|
+
|
1990
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#106
|
1991
|
+
CodeRay::Scanners::Clojure::RADIX10 = T.let(T.unsafe(nil), Regexp)
|
1992
|
+
|
1993
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#103
|
1994
|
+
CodeRay::Scanners::Clojure::RADIX16 = T.let(T.unsafe(nil), Regexp)
|
1995
|
+
|
1996
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#105
|
1997
|
+
CodeRay::Scanners::Clojure::RADIX2 = T.let(T.unsafe(nil), Regexp)
|
1998
|
+
|
1999
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#104
|
2000
|
+
CodeRay::Scanners::Clojure::RADIX8 = T.let(T.unsafe(nil), Regexp)
|
2001
|
+
|
2002
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#125
|
2003
|
+
CodeRay::Scanners::Clojure::REAL10 = T.let(T.unsafe(nil), Regexp)
|
2004
|
+
|
2005
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#126
|
2006
|
+
CodeRay::Scanners::Clojure::REAL16 = T.let(T.unsafe(nil), Regexp)
|
2007
|
+
|
2008
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#128
|
2009
|
+
CodeRay::Scanners::Clojure::REAL2 = T.let(T.unsafe(nil), Regexp)
|
2010
|
+
|
2011
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#127
|
2012
|
+
CodeRay::Scanners::Clojure::REAL8 = T.let(T.unsafe(nil), Regexp)
|
2013
|
+
|
2014
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#108
|
2015
|
+
CodeRay::Scanners::Clojure::SIGN = T.let(T.unsafe(nil), Regexp)
|
2016
|
+
|
2017
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#11
|
2018
|
+
CodeRay::Scanners::Clojure::SPECIAL_FORMS = T.let(T.unsafe(nil), Array)
|
2019
|
+
|
2020
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#111
|
2021
|
+
CodeRay::Scanners::Clojure::SUFFIX = T.let(T.unsafe(nil), Regexp)
|
2022
|
+
|
2023
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#97
|
2024
|
+
CodeRay::Scanners::Clojure::SYMBOL = T.let(T.unsafe(nil), Regexp)
|
2025
|
+
|
2026
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#116
|
2027
|
+
CodeRay::Scanners::Clojure::UINT10 = T.let(T.unsafe(nil), Regexp)
|
2028
|
+
|
2029
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#117
|
2030
|
+
CodeRay::Scanners::Clojure::UINT16 = T.let(T.unsafe(nil), Regexp)
|
2031
|
+
|
2032
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#119
|
2033
|
+
CodeRay::Scanners::Clojure::UINT2 = T.let(T.unsafe(nil), Regexp)
|
2034
|
+
|
2035
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#118
|
2036
|
+
CodeRay::Scanners::Clojure::UINT8 = T.let(T.unsafe(nil), Regexp)
|
2037
|
+
|
2038
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#121
|
2039
|
+
CodeRay::Scanners::Clojure::UREAL10 = T.let(T.unsafe(nil), Regexp)
|
2040
|
+
|
2041
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#122
|
2042
|
+
CodeRay::Scanners::Clojure::UREAL16 = T.let(T.unsafe(nil), Regexp)
|
2043
|
+
|
2044
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#124
|
2045
|
+
CodeRay::Scanners::Clojure::UREAL2 = T.let(T.unsafe(nil), Regexp)
|
2046
|
+
|
2047
|
+
# source://coderay//lib/coderay/scanners/clojure.rb#123
|
2048
|
+
CodeRay::Scanners::Clojure::UREAL8 = T.let(T.unsafe(nil), Regexp)
|
2049
|
+
|
2050
|
+
# = Debug Scanner
|
2051
|
+
#
|
2052
|
+
# Interprets the output of the Encoders::Debug encoder (basically the inverse function).
|
2053
|
+
#
|
2054
|
+
# source://coderay//lib/coderay/scanners/debug.rb#9
|
2055
|
+
class CodeRay::Scanners::Debug < ::CodeRay::Scanners::Scanner
|
2056
|
+
protected
|
2057
|
+
|
2058
|
+
# source://coderay//lib/coderay/scanners/debug.rb#21
|
2059
|
+
def scan_tokens(encoder, options); end
|
2060
|
+
|
2061
|
+
# source://coderay//lib/coderay/scanners/debug.rb#16
|
2062
|
+
def setup; end
|
2063
|
+
end
|
2064
|
+
|
2065
|
+
# Scanner for the Delphi language (Object Pascal).
|
2066
|
+
#
|
2067
|
+
# Alias: +pascal+
|
2068
|
+
#
|
2069
|
+
# source://coderay//lib/coderay/scanners/delphi.rb#7
|
2070
|
+
class CodeRay::Scanners::Delphi < ::CodeRay::Scanners::Scanner
|
2071
|
+
protected
|
2072
|
+
|
2073
|
+
# source://coderay//lib/coderay/scanners/delphi.rb#45
|
2074
|
+
def scan_tokens(encoder, options); end
|
2075
|
+
end
|
2076
|
+
|
2077
|
+
# source://coderay//lib/coderay/scanners/delphi.rb#25
|
2078
|
+
CodeRay::Scanners::Delphi::DIRECTIVES = T.let(T.unsafe(nil), Array)
|
2079
|
+
|
2080
|
+
# source://coderay//lib/coderay/scanners/delphi.rb#36
|
2081
|
+
CodeRay::Scanners::Delphi::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList::CaseIgnoring)
|
2082
|
+
|
2083
|
+
# source://coderay//lib/coderay/scanners/delphi.rb#12
|
2084
|
+
CodeRay::Scanners::Delphi::KEYWORDS = T.let(T.unsafe(nil), Array)
|
2085
|
+
|
2086
|
+
# source://coderay//lib/coderay/scanners/delphi.rb#40
|
2087
|
+
CodeRay::Scanners::Delphi::NAME_FOLLOWS = T.let(T.unsafe(nil), CodeRay::WordList::CaseIgnoring)
|
2088
|
+
|
2089
|
+
# Scanner for output of the diff command.
|
2090
|
+
#
|
2091
|
+
# Alias: +patch+
|
2092
|
+
#
|
2093
|
+
# source://coderay//lib/coderay/scanners/diff.rb#7
|
2094
|
+
class CodeRay::Scanners::Diff < ::CodeRay::Scanners::Scanner
|
2095
|
+
protected
|
2096
|
+
|
2097
|
+
# source://coderay//lib/coderay/scanners/diff.rb#19
|
2098
|
+
def scan_tokens(encoder, options); end
|
2099
|
+
|
2100
|
+
private
|
2101
|
+
|
2102
|
+
# source://coderay//lib/coderay/scanners/diff.rb#204
|
2103
|
+
def diff(a, b); end
|
2104
|
+
end
|
2105
|
+
|
2106
|
+
# source://coderay//lib/coderay/scanners/diff.rb#12
|
2107
|
+
CodeRay::Scanners::Diff::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
|
2108
|
+
|
2109
|
+
# Scanner for HTML ERB templates.
|
2110
|
+
#
|
2111
|
+
# source://coderay//lib/coderay/scanners/erb.rb#8
|
2112
|
+
class CodeRay::Scanners::ERB < ::CodeRay::Scanners::Scanner
|
2113
|
+
protected
|
2114
|
+
|
2115
|
+
# source://coderay//lib/coderay/scanners/erb.rb#38
|
2116
|
+
def reset_instance; end
|
2117
|
+
|
2118
|
+
# source://coderay//lib/coderay/scanners/erb.rb#43
|
2119
|
+
def scan_tokens(encoder, options); end
|
2120
|
+
|
2121
|
+
# source://coderay//lib/coderay/scanners/erb.rb#33
|
2122
|
+
def setup; end
|
2123
|
+
end
|
2124
|
+
|
2125
|
+
# source://coderay//lib/coderay/scanners/erb.rb#15
|
2126
|
+
CodeRay::Scanners::ERB::ERB_RUBY_BLOCK = T.let(T.unsafe(nil), Regexp)
|
2127
|
+
|
2128
|
+
# source://coderay//lib/coderay/scanners/erb.rb#13
|
2129
|
+
CodeRay::Scanners::ERB::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array)
|
2130
|
+
|
2131
|
+
# source://coderay//lib/coderay/scanners/erb.rb#27
|
2132
|
+
CodeRay::Scanners::ERB::START_OF_ERB = T.let(T.unsafe(nil), Regexp)
|
2133
|
+
|
2134
|
+
# source://coderay//lib/coderay/scanners/go.rb#4
|
2135
|
+
class CodeRay::Scanners::Go < ::CodeRay::Scanners::Scanner
|
2136
|
+
protected
|
2137
|
+
|
2138
|
+
# source://coderay//lib/coderay/scanners/go.rb#50
|
2139
|
+
def scan_tokens(encoder, options); end
|
2140
|
+
end
|
2141
|
+
|
2142
|
+
# source://coderay//lib/coderay/scanners/go.rb#45
|
2143
|
+
CodeRay::Scanners::Go::ESCAPE = T.let(T.unsafe(nil), Regexp)
|
2144
|
+
|
2145
|
+
# source://coderay//lib/coderay/scanners/go.rb#39
|
2146
|
+
CodeRay::Scanners::Go::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList)
|
2147
|
+
|
2148
|
+
# http://golang.org/ref/spec#Keywords
|
2149
|
+
#
|
2150
|
+
# source://coderay//lib/coderay/scanners/go.rb#10
|
2151
|
+
CodeRay::Scanners::Go::KEYWORDS = T.let(T.unsafe(nil), Array)
|
2152
|
+
|
2153
|
+
# source://coderay//lib/coderay/scanners/go.rb#29
|
2154
|
+
CodeRay::Scanners::Go::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array)
|
2155
|
+
|
2156
|
+
# source://coderay//lib/coderay/scanners/go.rb#34
|
2157
|
+
CodeRay::Scanners::Go::PREDEFINED_FUNCTIONS = T.let(T.unsafe(nil), Array)
|
2158
|
+
|
2159
|
+
# http://golang.org/ref/spec#Types
|
2160
|
+
#
|
2161
|
+
# source://coderay//lib/coderay/scanners/go.rb#19
|
2162
|
+
CodeRay::Scanners::Go::PREDEFINED_TYPES = T.let(T.unsafe(nil), Array)
|
2163
|
+
|
2164
|
+
# source://coderay//lib/coderay/scanners/go.rb#46
|
2165
|
+
CodeRay::Scanners::Go::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp)
|
2166
|
+
|
2167
|
+
# Scanner for Groovy.
|
2168
|
+
#
|
2169
|
+
# source://coderay//lib/coderay/scanners/groovy.rb#7
|
2170
|
+
class CodeRay::Scanners::Groovy < ::CodeRay::Scanners::Java
|
2171
|
+
protected
|
2172
|
+
|
2173
|
+
# source://coderay//lib/coderay/scanners/groovy.rb#43
|
2174
|
+
def scan_tokens(encoder, options); end
|
2175
|
+
|
2176
|
+
# source://coderay//lib/coderay/scanners/groovy.rb#39
|
2177
|
+
def setup; end
|
2178
|
+
end
|
2179
|
+
|
2180
|
+
# source://coderay//lib/coderay/scanners/groovy.rb#24
|
2181
|
+
CodeRay::Scanners::Groovy::ESCAPE = T.let(T.unsafe(nil), Regexp)
|
2182
|
+
|
2183
|
+
# TODO: check list of keywords
|
2184
|
+
#
|
2185
|
+
# source://coderay//lib/coderay/scanners/groovy.rb#12
|
2186
|
+
CodeRay::Scanners::Groovy::GROOVY_KEYWORDS = T.let(T.unsafe(nil), Array)
|
2187
|
+
|
2188
|
+
# source://coderay//lib/coderay/scanners/groovy.rb#18
|
2189
|
+
CodeRay::Scanners::Groovy::GROOVY_MAGIC_VARIABLES = T.let(T.unsafe(nil), Array)
|
2190
|
+
|
2191
|
+
# source://coderay//lib/coderay/scanners/groovy.rb#20
|
2192
|
+
CodeRay::Scanners::Groovy::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList)
|
2193
|
+
|
2194
|
+
# source://coderay//lib/coderay/scanners/groovy.rb#15
|
2195
|
+
CodeRay::Scanners::Groovy::KEYWORDS_EXPECTING_VALUE = T.let(T.unsafe(nil), CodeRay::WordList)
|
2196
|
+
|
2197
|
+
# source://coderay//lib/coderay/scanners/groovy.rb#26
|
2198
|
+
CodeRay::Scanners::Groovy::REGEXP_ESCAPE = T.let(T.unsafe(nil), Regexp)
|
2199
|
+
|
2200
|
+
# TODO: interpretation inside ', ", /
|
2201
|
+
#
|
2202
|
+
# source://coderay//lib/coderay/scanners/groovy.rb#29
|
2203
|
+
CodeRay::Scanners::Groovy::STRING_CONTENT_PATTERN = T.let(T.unsafe(nil), Hash)
|
2204
|
+
|
2205
|
+
# source://coderay//lib/coderay/scanners/groovy.rb#25
|
2206
|
+
CodeRay::Scanners::Groovy::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp)
|
2207
|
+
|
2208
|
+
# source://coderay//lib/coderay/scanners/haml.rb#8
|
2209
|
+
class CodeRay::Scanners::HAML < ::CodeRay::Scanners::Scanner
|
2210
|
+
protected
|
2211
|
+
|
2212
|
+
# source://coderay//lib/coderay/scanners/haml.rb#24
|
2213
|
+
def scan_tokens(encoder, options); end
|
2214
|
+
|
2215
|
+
# source://coderay//lib/coderay/scanners/haml.rb#17
|
2216
|
+
def setup; end
|
2217
|
+
end
|
2218
|
+
|
2219
|
+
# source://coderay//lib/coderay/scanners/haml.rb#13
|
2220
|
+
CodeRay::Scanners::HAML::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array)
|
2221
|
+
|
2222
|
+
# HTML Scanner
|
2223
|
+
#
|
2224
|
+
# Alias: +xhtml+
|
2225
|
+
#
|
2226
|
+
# See also: Scanners::XML
|
2227
|
+
#
|
2228
|
+
# source://coderay//lib/coderay/scanners/html.rb#9
|
2229
|
+
class CodeRay::Scanners::HTML < ::CodeRay::Scanners::Scanner
|
2230
|
+
# source://coderay//lib/coderay/scanners/html.rb#62
|
2231
|
+
def reset; end
|
2232
|
+
|
2233
|
+
protected
|
2234
|
+
|
2235
|
+
# source://coderay//lib/coderay/scanners/html.rb#83
|
2236
|
+
def scan_css(encoder, code, state = T.unsafe(nil)); end
|
2237
|
+
|
2238
|
+
# source://coderay//lib/coderay/scanners/html.rb#76
|
2239
|
+
def scan_java_script(encoder, code); end
|
2240
|
+
|
2241
|
+
# source://coderay//lib/coderay/scanners/html.rb#90
|
2242
|
+
def scan_tokens(encoder, options); end
|
2243
|
+
|
2244
|
+
# source://coderay//lib/coderay/scanners/html.rb#70
|
2245
|
+
def setup; end
|
2246
|
+
end
|
2247
|
+
|
2248
|
+
# source://coderay//lib/coderay/scanners/html.rb#39
|
2249
|
+
CodeRay::Scanners::HTML::ATTR_NAME = T.let(T.unsafe(nil), Regexp)
|
2250
|
+
|
2251
|
+
# source://coderay//lib/coderay/scanners/html.rb#42
|
2252
|
+
CodeRay::Scanners::HTML::ENTITY = T.let(T.unsafe(nil), Regexp)
|
2253
|
+
|
2254
|
+
# source://coderay//lib/coderay/scanners/html.rb#20
|
2255
|
+
CodeRay::Scanners::HTML::EVENT_ATTRIBUTES = T.let(T.unsafe(nil), Array)
|
2256
|
+
|
2257
|
+
# source://coderay//lib/coderay/scanners/html.rb#41
|
2258
|
+
CodeRay::Scanners::HTML::HEX = T.let(T.unsafe(nil), Regexp)
|
2259
|
+
|
2260
|
+
# source://coderay//lib/coderay/scanners/html.rb#35
|
2261
|
+
CodeRay::Scanners::HTML::IN_ATTRIBUTE = T.let(T.unsafe(nil), CodeRay::WordList::CaseIgnoring)
|
2262
|
+
|
2263
|
+
# source://coderay//lib/coderay/scanners/html.rb#13
|
2264
|
+
CodeRay::Scanners::HTML::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array)
|
2265
|
+
|
2266
|
+
# source://coderay//lib/coderay/scanners/html.rb#57
|
2267
|
+
CodeRay::Scanners::HTML::PLAIN_STRING_CONTENT = T.let(T.unsafe(nil), Hash)
|
2268
|
+
|
2269
|
+
# source://coderay//lib/coderay/scanners/html.rb#40
|
2270
|
+
CodeRay::Scanners::HTML::TAG_END = T.let(T.unsafe(nil), Regexp)
|
2271
|
+
|
2272
|
+
# Scanner for JSON (JavaScript Object Notation).
|
2273
|
+
#
|
2274
|
+
# source://coderay//lib/coderay/scanners/json.rb#5
|
2275
|
+
class CodeRay::Scanners::JSON < ::CodeRay::Scanners::Scanner
|
2276
|
+
protected
|
2277
|
+
|
2278
|
+
# See http://json.org/ for a definition of the JSON lexic/grammar.
|
2279
|
+
#
|
2280
|
+
# source://coderay//lib/coderay/scanners/json.rb#26
|
2281
|
+
def scan_tokens(encoder, options); end
|
2282
|
+
|
2283
|
+
# source://coderay//lib/coderay/scanners/json.rb#21
|
2284
|
+
def setup; end
|
2285
|
+
end
|
2286
|
+
|
2287
|
+
# source://coderay//lib/coderay/scanners/json.rb#15
|
2288
|
+
CodeRay::Scanners::JSON::ESCAPE = T.let(T.unsafe(nil), Regexp)
|
2289
|
+
|
2290
|
+
# source://coderay//lib/coderay/scanners/json.rb#17
|
2291
|
+
CodeRay::Scanners::JSON::KEY = T.let(T.unsafe(nil), Regexp)
|
2292
|
+
|
2293
|
+
# source://coderay//lib/coderay/scanners/json.rb#10
|
2294
|
+
CodeRay::Scanners::JSON::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array)
|
2295
|
+
|
2296
|
+
# source://coderay//lib/coderay/scanners/json.rb#16
|
2297
|
+
CodeRay::Scanners::JSON::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp)
|
2298
|
+
|
2299
|
+
# Scanner for Java.
|
2300
|
+
#
|
2301
|
+
# source://coderay//lib/coderay/scanners/java.rb#5
|
2302
|
+
class CodeRay::Scanners::Java < ::CodeRay::Scanners::Scanner
|
2303
|
+
protected
|
2304
|
+
|
2305
|
+
# source://coderay//lib/coderay/scanners/java.rb#51
|
2306
|
+
def scan_tokens(encoder, options); end
|
2307
|
+
end
|
2308
|
+
|
2309
|
+
# source://coderay//lib/coderay/scanners/java/builtin_types.rb#4
|
2310
|
+
module CodeRay::Scanners::Java::BuiltinTypes; end
|
2311
|
+
|
2312
|
+
# source://coderay//lib/coderay/scanners/java/builtin_types.rb#7
|
2313
|
+
CodeRay::Scanners::Java::BuiltinTypes::List = T.let(T.unsafe(nil), Array)
|
2314
|
+
|
2315
|
+
# source://coderay//lib/coderay/scanners/java.rb#19
|
2316
|
+
CodeRay::Scanners::Java::CONSTANTS = T.let(T.unsafe(nil), Array)
|
2317
|
+
|
2318
|
+
# source://coderay//lib/coderay/scanners/java.rb#25
|
2319
|
+
CodeRay::Scanners::Java::DIRECTIVES = T.let(T.unsafe(nil), Array)
|
2320
|
+
|
2321
|
+
# source://coderay//lib/coderay/scanners/java.rb#40
|
2322
|
+
CodeRay::Scanners::Java::ESCAPE = T.let(T.unsafe(nil), Regexp)
|
2323
|
+
|
2324
|
+
# source://coderay//lib/coderay/scanners/java.rb#47
|
2325
|
+
CodeRay::Scanners::Java::IDENT = T.let(T.unsafe(nil), Regexp)
|
2326
|
+
|
2327
|
+
# source://coderay//lib/coderay/scanners/java.rb#30
|
2328
|
+
CodeRay::Scanners::Java::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList)
|
2329
|
+
|
2330
|
+
# http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html
|
2331
|
+
#
|
2332
|
+
# source://coderay//lib/coderay/scanners/java.rb#12
|
2333
|
+
CodeRay::Scanners::Java::KEYWORDS = T.let(T.unsafe(nil), Array)
|
2334
|
+
|
2335
|
+
# source://coderay//lib/coderay/scanners/java.rb#20
|
2336
|
+
CodeRay::Scanners::Java::MAGIC_VARIABLES = T.let(T.unsafe(nil), Array)
|
2337
|
+
|
2338
|
+
# source://coderay//lib/coderay/scanners/java.rb#18
|
2339
|
+
CodeRay::Scanners::Java::RESERVED = T.let(T.unsafe(nil), Array)
|
2340
|
+
|
2341
|
+
# source://coderay//lib/coderay/scanners/java.rb#42
|
2342
|
+
CodeRay::Scanners::Java::STRING_CONTENT_PATTERN = T.let(T.unsafe(nil), Hash)
|
2343
|
+
|
2344
|
+
# source://coderay//lib/coderay/scanners/java.rb#21
|
2345
|
+
CodeRay::Scanners::Java::TYPES = T.let(T.unsafe(nil), Array)
|
2346
|
+
|
2347
|
+
# source://coderay//lib/coderay/scanners/java.rb#41
|
2348
|
+
CodeRay::Scanners::Java::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp)
|
2349
|
+
|
2350
|
+
# Scanner for JavaScript.
|
2351
|
+
#
|
2352
|
+
# Aliases: +ecmascript+, +ecma_script+, +javascript+
|
2353
|
+
#
|
2354
|
+
# source://coderay//lib/coderay/scanners/java_script.rb#7
|
2355
|
+
class CodeRay::Scanners::JavaScript < ::CodeRay::Scanners::Scanner
|
2356
|
+
protected
|
2357
|
+
|
2358
|
+
# source://coderay//lib/coderay/scanners/java_script.rb#224
|
2359
|
+
def reset_instance; end
|
2360
|
+
|
2361
|
+
# source://coderay//lib/coderay/scanners/java_script.rb#61
|
2362
|
+
def scan_tokens(encoder, options); end
|
2363
|
+
|
2364
|
+
# source://coderay//lib/coderay/scanners/java_script.rb#57
|
2365
|
+
def setup; end
|
2366
|
+
|
2367
|
+
# source://coderay//lib/coderay/scanners/java_script.rb#229
|
2368
|
+
def xml_scanner; end
|
2369
|
+
end
|
2370
|
+
|
2371
|
+
# source://coderay//lib/coderay/scanners/java_script.rb#42
|
2372
|
+
CodeRay::Scanners::JavaScript::ESCAPE = T.let(T.unsafe(nil), Regexp)
|
2373
|
+
|
2374
|
+
# source://coderay//lib/coderay/scanners/java_script.rb#36
|
2375
|
+
CodeRay::Scanners::JavaScript::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList)
|
2376
|
+
|
2377
|
+
# The actual JavaScript keywords.
|
2378
|
+
#
|
2379
|
+
# source://coderay//lib/coderay/scanners/java_script.rb#13
|
2380
|
+
CodeRay::Scanners::JavaScript::KEYWORDS = T.let(T.unsafe(nil), Array)
|
2381
|
+
|
2382
|
+
# source://coderay//lib/coderay/scanners/java_script.rb#24
|
2383
|
+
CodeRay::Scanners::JavaScript::KEYWORDS_EXPECTING_VALUE = T.let(T.unsafe(nil), CodeRay::WordList)
|
2384
|
+
|
2385
|
+
# source://coderay//lib/coderay/scanners/java_script.rb#50
|
2386
|
+
CodeRay::Scanners::JavaScript::KEY_CHECK_PATTERN = T.let(T.unsafe(nil), Hash)
|
2387
|
+
|
2388
|
+
# source://coderay//lib/coderay/scanners/java_script.rb#22
|
2389
|
+
CodeRay::Scanners::JavaScript::MAGIC_VARIABLES = T.let(T.unsafe(nil), Array)
|
2390
|
+
|
2391
|
+
# source://coderay//lib/coderay/scanners/java_script.rb#18
|
2392
|
+
CodeRay::Scanners::JavaScript::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array)
|
2393
|
+
|
2394
|
+
# source://coderay//lib/coderay/scanners/java_script.rb#44
|
2395
|
+
CodeRay::Scanners::JavaScript::REGEXP_ESCAPE = T.let(T.unsafe(nil), Regexp)
|
2396
|
+
|
2397
|
+
# Reserved for future use.
|
2398
|
+
#
|
2399
|
+
# source://coderay//lib/coderay/scanners/java_script.rb#29
|
2400
|
+
CodeRay::Scanners::JavaScript::RESERVED_WORDS = T.let(T.unsafe(nil), Array)
|
2401
|
+
|
2402
|
+
# source://coderay//lib/coderay/scanners/java_script.rb#45
|
2403
|
+
CodeRay::Scanners::JavaScript::STRING_CONTENT_PATTERN = T.let(T.unsafe(nil), Hash)
|
2404
|
+
|
2405
|
+
# source://coderay//lib/coderay/scanners/java_script.rb#43
|
2406
|
+
CodeRay::Scanners::JavaScript::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp)
|
2407
|
+
|
2408
|
+
# Scanner for the Lua[http://lua.org] programming lanuage.
|
2409
|
+
#
|
2410
|
+
# The language’s complete syntax is defined in
|
2411
|
+
# {the Lua manual}[http://www.lua.org/manual/5.2/manual.html],
|
2412
|
+
# which is what this scanner tries to conform to.
|
2413
|
+
#
|
2414
|
+
# source://coderay//lib/coderay/scanners/lua.rb#11
|
2415
|
+
class CodeRay::Scanners::Lua < ::CodeRay::Scanners::Scanner
|
2416
|
+
protected
|
2417
|
+
|
2418
|
+
# CodeRay entry hook. Starts parsing.
|
2419
|
+
#
|
2420
|
+
# source://coderay//lib/coderay/scanners/lua.rb#60
|
2421
|
+
def scan_tokens(encoder, options); end
|
2422
|
+
|
2423
|
+
# Scanner initialization.
|
2424
|
+
#
|
2425
|
+
# source://coderay//lib/coderay/scanners/lua.rb#54
|
2426
|
+
def setup; end
|
2427
|
+
end
|
2428
|
+
|
2429
|
+
# Automatic token kind selection for normal words.
|
2430
|
+
#
|
2431
|
+
# source://coderay//lib/coderay/scanners/lua.rb#46
|
2432
|
+
CodeRay::Scanners::Lua::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList)
|
2433
|
+
|
2434
|
+
# Keywords used in Lua.
|
2435
|
+
#
|
2436
|
+
# source://coderay//lib/coderay/scanners/lua.rb#18
|
2437
|
+
CodeRay::Scanners::Lua::KEYWORDS = T.let(T.unsafe(nil), Array)
|
2438
|
+
|
2439
|
+
# Constants set by the Lua core.
|
2440
|
+
#
|
2441
|
+
# source://coderay//lib/coderay/scanners/lua.rb#25
|
2442
|
+
CodeRay::Scanners::Lua::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array)
|
2443
|
+
|
2444
|
+
# The expressions contained in this array are parts of Lua’s `basic'
|
2445
|
+
# library. Although it’s not entirely necessary to load that library,
|
2446
|
+
# it is highly recommended and one would have to provide own implementations
|
2447
|
+
# of some of these expressions if one does not do so. They however aren’t
|
2448
|
+
# keywords, neither are they constants, but nearly predefined, so they
|
2449
|
+
# get tagged as `predefined' rather than anything else.
|
2450
|
+
#
|
2451
|
+
# This list excludes values of form `_UPPERCASE' because the Lua manual
|
2452
|
+
# requires such identifiers to be reserved by Lua anyway and they are
|
2453
|
+
# highlighted directly accordingly, without the need for specific
|
2454
|
+
# identifiers to be listed here.
|
2455
|
+
#
|
2456
|
+
# source://coderay//lib/coderay/scanners/lua.rb#38
|
2457
|
+
CodeRay::Scanners::Lua::PREDEFINED_EXPRESSIONS = T.let(T.unsafe(nil), Array)
|
2458
|
+
|
2459
|
+
# Scanner for PHP.
|
2460
|
+
#
|
2461
|
+
# Original by Stefan Walk.
|
2462
|
+
#
|
2463
|
+
# source://coderay//lib/coderay/scanners/php.rb#10
|
2464
|
+
class CodeRay::Scanners::PHP < ::CodeRay::Scanners::Scanner
|
2465
|
+
protected
|
2466
|
+
|
2467
|
+
# source://coderay//lib/coderay/scanners/php.rb#23
|
2468
|
+
def reset_instance; end
|
2469
|
+
|
2470
|
+
# source://coderay//lib/coderay/scanners/php.rb#234
|
2471
|
+
def scan_tokens(encoder, options); end
|
2472
|
+
|
2473
|
+
# source://coderay//lib/coderay/scanners/php.rb#19
|
2474
|
+
def setup; end
|
2475
|
+
end
|
2476
|
+
|
2477
|
+
# source://coderay//lib/coderay/scanners/php.rb#15
|
2478
|
+
CodeRay::Scanners::PHP::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array)
|
2479
|
+
|
2480
|
+
# source://coderay//lib/coderay/scanners/php.rb#197
|
2481
|
+
module CodeRay::Scanners::PHP::RE; end
|
2482
|
+
|
2483
|
+
# source://coderay//lib/coderay/scanners/php.rb#211
|
2484
|
+
CodeRay::Scanners::PHP::RE::HTML_INDICATOR = T.let(T.unsafe(nil), Regexp)
|
2485
|
+
|
2486
|
+
# source://coderay//lib/coderay/scanners/php.rb#213
|
2487
|
+
CodeRay::Scanners::PHP::RE::IDENTIFIER = T.let(T.unsafe(nil), Regexp)
|
2488
|
+
|
2489
|
+
# source://coderay//lib/coderay/scanners/php.rb#216
|
2490
|
+
CodeRay::Scanners::PHP::RE::OPERATOR = T.let(T.unsafe(nil), Regexp)
|
2491
|
+
|
2492
|
+
# source://coderay//lib/coderay/scanners/php.rb#206
|
2493
|
+
CodeRay::Scanners::PHP::RE::PHP_END = T.let(T.unsafe(nil), Regexp)
|
2494
|
+
|
2495
|
+
# source://coderay//lib/coderay/scanners/php.rb#199
|
2496
|
+
CodeRay::Scanners::PHP::RE::PHP_START = T.let(T.unsafe(nil), Regexp)
|
2497
|
+
|
2498
|
+
# source://coderay//lib/coderay/scanners/php.rb#214
|
2499
|
+
CodeRay::Scanners::PHP::RE::VARIABLE = T.let(T.unsafe(nil), Regexp)
|
2500
|
+
|
2501
|
+
# source://coderay//lib/coderay/scanners/php.rb#28
|
2502
|
+
module CodeRay::Scanners::PHP::Words; end
|
2503
|
+
|
2504
|
+
# according to http://php.net/quickref.php on 2009-04-21;
|
2505
|
+
# all functions with _ excluded (module functions) and selected additional functions
|
2506
|
+
#
|
2507
|
+
# source://coderay//lib/coderay/scanners/php.rb#50
|
2508
|
+
CodeRay::Scanners::PHP::Words::BUILTIN_FUNCTIONS = T.let(T.unsafe(nil), Array)
|
2509
|
+
|
2510
|
+
# source://coderay//lib/coderay/scanners/php.rb#46
|
2511
|
+
CodeRay::Scanners::PHP::Words::CLASSES = T.let(T.unsafe(nil), Array)
|
2512
|
+
|
2513
|
+
# source://coderay//lib/coderay/scanners/php.rb#145
|
2514
|
+
CodeRay::Scanners::PHP::Words::CONSTANTS = T.let(T.unsafe(nil), Array)
|
2515
|
+
|
2516
|
+
# TODO: more built-in PHP functions?
|
2517
|
+
#
|
2518
|
+
# source://coderay//lib/coderay/scanners/php.rb#140
|
2519
|
+
CodeRay::Scanners::PHP::Words::EXCEPTIONS = T.let(T.unsafe(nil), Array)
|
2520
|
+
|
2521
|
+
# source://coderay//lib/coderay/scanners/php.rb#184
|
2522
|
+
CodeRay::Scanners::PHP::Words::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList::CaseIgnoring)
|
2523
|
+
|
2524
|
+
# according to http://www.php.net/manual/en/reserved.keywords.php
|
2525
|
+
#
|
2526
|
+
# source://coderay//lib/coderay/scanners/php.rb#31
|
2527
|
+
CodeRay::Scanners::PHP::Words::KEYWORDS = T.let(T.unsafe(nil), Array)
|
2528
|
+
|
2529
|
+
# source://coderay//lib/coderay/scanners/php.rb#41
|
2530
|
+
CodeRay::Scanners::PHP::Words::LANGUAGE_CONSTRUCTS = T.let(T.unsafe(nil), Array)
|
2531
|
+
|
2532
|
+
# source://coderay//lib/coderay/scanners/php.rb#178
|
2533
|
+
CodeRay::Scanners::PHP::Words::PREDEFINED = T.let(T.unsafe(nil), Array)
|
2534
|
+
|
2535
|
+
# source://coderay//lib/coderay/scanners/php.rb#39
|
2536
|
+
CodeRay::Scanners::PHP::Words::TYPES = T.let(T.unsafe(nil), Array)
|
2537
|
+
|
2538
|
+
# source://coderay//lib/coderay/scanners/php.rb#193
|
2539
|
+
CodeRay::Scanners::PHP::Words::VARIABLE_KIND = T.let(T.unsafe(nil), CodeRay::WordList)
|
2540
|
+
|
2541
|
+
# Scanner for Python. Supports Python 3.
|
2542
|
+
#
|
2543
|
+
# Based on pygments' PythonLexer, see
|
2544
|
+
# http://dev.pocoo.org/projects/pygments/browser/pygments/lexers/agile.py.
|
2545
|
+
#
|
2546
|
+
# source://coderay//lib/coderay/scanners/python.rb#8
|
2547
|
+
class CodeRay::Scanners::Python < ::CodeRay::Scanners::Scanner
|
2548
|
+
protected
|
2549
|
+
|
2550
|
+
# source://coderay//lib/coderay/scanners/python.rb#103
|
2551
|
+
def scan_tokens(encoder, options); end
|
2552
|
+
end
|
2553
|
+
|
2554
|
+
# source://coderay//lib/coderay/scanners/python.rb#86
|
2555
|
+
CodeRay::Scanners::Python::DEF_NEW_STATE = T.let(T.unsafe(nil), CodeRay::WordList)
|
2556
|
+
|
2557
|
+
# source://coderay//lib/coderay/scanners/python.rb#91
|
2558
|
+
CodeRay::Scanners::Python::DESCRIPTOR = T.let(T.unsafe(nil), Regexp)
|
2559
|
+
|
2560
|
+
# source://coderay//lib/coderay/scanners/python.rb#97
|
2561
|
+
CodeRay::Scanners::Python::DOCSTRING_COMING = T.let(T.unsafe(nil), Regexp)
|
2562
|
+
|
2563
|
+
# source://coderay//lib/coderay/scanners/python.rb#65
|
2564
|
+
CodeRay::Scanners::Python::ESCAPE = T.let(T.unsafe(nil), Regexp)
|
2565
|
+
|
2566
|
+
# source://coderay//lib/coderay/scanners/python.rb#57
|
2567
|
+
CodeRay::Scanners::Python::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList)
|
2568
|
+
|
2569
|
+
# source://coderay//lib/coderay/scanners/python.rb#13
|
2570
|
+
CodeRay::Scanners::Python::KEYWORDS = T.let(T.unsafe(nil), Array)
|
2571
|
+
|
2572
|
+
# source://coderay//lib/coderay/scanners/python.rb#64
|
2573
|
+
CodeRay::Scanners::Python::NAME = T.let(T.unsafe(nil), Regexp)
|
2574
|
+
|
2575
|
+
# source://coderay//lib/coderay/scanners/python.rb#21
|
2576
|
+
CodeRay::Scanners::Python::OLD_KEYWORDS = T.let(T.unsafe(nil), Array)
|
2577
|
+
|
2578
|
+
# source://coderay//lib/coderay/scanners/python.rb#68
|
2579
|
+
CodeRay::Scanners::Python::OPERATOR = T.let(T.unsafe(nil), Regexp)
|
2580
|
+
|
2581
|
+
# source://coderay//lib/coderay/scanners/python.rb#37
|
2582
|
+
CodeRay::Scanners::Python::PREDEFINED_EXCEPTIONS = T.let(T.unsafe(nil), Array)
|
2583
|
+
|
2584
|
+
# source://coderay//lib/coderay/scanners/python.rb#25
|
2585
|
+
CodeRay::Scanners::Python::PREDEFINED_METHODS_AND_TYPES = T.let(T.unsafe(nil), Array)
|
2586
|
+
|
2587
|
+
# source://coderay//lib/coderay/scanners/python.rb#52
|
2588
|
+
CodeRay::Scanners::Python::PREDEFINED_VARIABLES_AND_CONSTANTS = T.let(T.unsafe(nil), Array)
|
2589
|
+
|
2590
|
+
# source://coderay//lib/coderay/scanners/python.rb#82
|
2591
|
+
CodeRay::Scanners::Python::STRING_CONTENT_REGEXP = T.let(T.unsafe(nil), Hash)
|
2592
|
+
|
2593
|
+
# source://coderay//lib/coderay/scanners/python.rb#78
|
2594
|
+
CodeRay::Scanners::Python::STRING_DELIMITER_REGEXP = T.let(T.unsafe(nil), Hash)
|
2595
|
+
|
2596
|
+
# source://coderay//lib/coderay/scanners/python.rb#66
|
2597
|
+
CodeRay::Scanners::Python::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp)
|
2598
|
+
|
2599
|
+
# = Raydebug Scanner
|
2600
|
+
#
|
2601
|
+
# Highlights the output of the Encoders::Debug encoder.
|
2602
|
+
#
|
2603
|
+
# source://coderay//lib/coderay/scanners/raydebug.rb#9
|
2604
|
+
class CodeRay::Scanners::Raydebug < ::CodeRay::Scanners::Scanner
|
2605
|
+
protected
|
2606
|
+
|
2607
|
+
# source://coderay//lib/coderay/scanners/raydebug.rb#22
|
2608
|
+
def scan_tokens(encoder, options); end
|
2609
|
+
|
2610
|
+
# source://coderay//lib/coderay/scanners/raydebug.rb#17
|
2611
|
+
def setup; end
|
2612
|
+
end
|
2613
|
+
|
2614
|
+
# This scanner is really complex, since Ruby _is_ a complex language!
|
2615
|
+
#
|
2616
|
+
# It tries to highlight 100% of all common code,
|
2617
|
+
# and 90% of strange codes.
|
2618
|
+
#
|
2619
|
+
# It is optimized for HTML highlighting, and is not very useful for
|
2620
|
+
# parsing or pretty printing.
|
2621
|
+
#
|
2622
|
+
# source://coderay//lib/coderay/scanners/ruby.rb#11
|
2623
|
+
class CodeRay::Scanners::Ruby < ::CodeRay::Scanners::Scanner
|
2624
|
+
# source://coderay//lib/coderay/scanners/ruby.rb#19
|
2625
|
+
def interpreted_string_state; end
|
2626
|
+
|
2627
|
+
protected
|
2628
|
+
|
2629
|
+
# source://coderay//lib/coderay/scanners/ruby.rb#29
|
2630
|
+
def scan_tokens(encoder, options); end
|
2631
|
+
|
2632
|
+
# source://coderay//lib/coderay/scanners/ruby.rb#25
|
2633
|
+
def setup; end
|
2634
|
+
end
|
2635
|
+
|
2636
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#5
|
2637
|
+
module CodeRay::Scanners::Ruby::Patterns; end
|
2638
|
+
|
2639
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#72
|
2640
|
+
CodeRay::Scanners::Ruby::Patterns::BINARY = T.let(T.unsafe(nil), Regexp)
|
2641
|
+
|
2642
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#106
|
2643
|
+
CodeRay::Scanners::Ruby::Patterns::CHARACTER = T.let(T.unsafe(nil), Regexp)
|
2644
|
+
|
2645
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#55
|
2646
|
+
CodeRay::Scanners::Ruby::Patterns::CLASS_VARIABLE = T.let(T.unsafe(nil), Regexp)
|
2647
|
+
|
2648
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#96
|
2649
|
+
CodeRay::Scanners::Ruby::Patterns::CONTROL_META_ESCAPE = T.let(T.unsafe(nil), Regexp)
|
2650
|
+
|
2651
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#132
|
2652
|
+
CodeRay::Scanners::Ruby::Patterns::DATA = T.let(T.unsafe(nil), Regexp)
|
2653
|
+
|
2654
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#69
|
2655
|
+
CodeRay::Scanners::Ruby::Patterns::DECIMAL = T.let(T.unsafe(nil), Regexp)
|
2656
|
+
|
2657
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#102
|
2658
|
+
CodeRay::Scanners::Ruby::Patterns::ESCAPE = T.let(T.unsafe(nil), Regexp)
|
2659
|
+
|
2660
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#74
|
2661
|
+
CodeRay::Scanners::Ruby::Patterns::EXPONENT = T.let(T.unsafe(nil), Regexp)
|
2662
|
+
|
2663
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#168
|
2664
|
+
CodeRay::Scanners::Ruby::Patterns::FANCY_STRING_INTERPRETED = T.let(T.unsafe(nil), Hash)
|
2665
|
+
|
2666
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#161
|
2667
|
+
CodeRay::Scanners::Ruby::Patterns::FANCY_STRING_KIND = T.let(T.unsafe(nil), Hash)
|
2668
|
+
|
2669
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#160
|
2670
|
+
CodeRay::Scanners::Ruby::Patterns::FANCY_STRING_START = T.let(T.unsafe(nil), Regexp)
|
2671
|
+
|
2672
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#76
|
2673
|
+
CodeRay::Scanners::Ruby::Patterns::FLOAT_OR_INT = T.let(T.unsafe(nil), Regexp)
|
2674
|
+
|
2675
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#75
|
2676
|
+
CodeRay::Scanners::Ruby::Patterns::FLOAT_SUFFIX = T.let(T.unsafe(nil), Regexp)
|
2677
|
+
|
2678
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#57
|
2679
|
+
CodeRay::Scanners::Ruby::Patterns::GLOBAL_VARIABLE = T.let(T.unsafe(nil), Regexp)
|
2680
|
+
|
2681
|
+
# NOTE: This is not completely correct, but
|
2682
|
+
# nobody needs heredoc delimiters ending with \n.
|
2683
|
+
#
|
2684
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#116
|
2685
|
+
CodeRay::Scanners::Ruby::Patterns::HEREDOC_OPEN = T.let(T.unsafe(nil), Regexp)
|
2686
|
+
|
2687
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#71
|
2688
|
+
CodeRay::Scanners::Ruby::Patterns::HEXADECIMAL = T.let(T.unsafe(nil), Regexp)
|
2689
|
+
|
2690
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#38
|
2691
|
+
CodeRay::Scanners::Ruby::Patterns::IDENT = T.let(T.unsafe(nil), Regexp)
|
2692
|
+
|
2693
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#28
|
2694
|
+
CodeRay::Scanners::Ruby::Patterns::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList)
|
2695
|
+
|
2696
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#54
|
2697
|
+
CodeRay::Scanners::Ruby::Patterns::INSTANCE_VARIABLE = T.let(T.unsafe(nil), Regexp)
|
2698
|
+
|
2699
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#7
|
2700
|
+
CodeRay::Scanners::Ruby::Patterns::KEYWORDS = T.let(T.unsafe(nil), Array)
|
2701
|
+
|
2702
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#151
|
2703
|
+
CodeRay::Scanners::Ruby::Patterns::KEYWORDS_EXPECTING_VALUE = T.let(T.unsafe(nil), CodeRay::WordList)
|
2704
|
+
|
2705
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#32
|
2706
|
+
CodeRay::Scanners::Ruby::Patterns::KEYWORD_NEW_STATE = T.let(T.unsafe(nil), CodeRay::WordList)
|
2707
|
+
|
2708
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#53
|
2709
|
+
CodeRay::Scanners::Ruby::Patterns::METHOD_AFTER_DOT = T.let(T.unsafe(nil), Regexp)
|
2710
|
+
|
2711
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#40
|
2712
|
+
CodeRay::Scanners::Ruby::Patterns::METHOD_NAME = T.let(T.unsafe(nil), Regexp)
|
2713
|
+
|
2714
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#52
|
2715
|
+
CodeRay::Scanners::Ruby::Patterns::METHOD_NAME_EX = T.let(T.unsafe(nil), Regexp)
|
2716
|
+
|
2717
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#41
|
2718
|
+
CodeRay::Scanners::Ruby::Patterns::METHOD_NAME_OPERATOR = T.let(T.unsafe(nil), Regexp)
|
2719
|
+
|
2720
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#87
|
2721
|
+
CodeRay::Scanners::Ruby::Patterns::METHOD_NAME_OR_SYMBOL = T.let(T.unsafe(nil), Regexp)
|
2722
|
+
|
2723
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#51
|
2724
|
+
CodeRay::Scanners::Ruby::Patterns::METHOD_SUFFIX = T.let(T.unsafe(nil), Regexp)
|
2725
|
+
|
2726
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#77
|
2727
|
+
CodeRay::Scanners::Ruby::Patterns::NUMERIC = T.let(T.unsafe(nil), Regexp)
|
2728
|
+
|
2729
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#56
|
2730
|
+
CodeRay::Scanners::Ruby::Patterns::OBJECT_VARIABLE = T.let(T.unsafe(nil), Regexp)
|
2731
|
+
|
2732
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#70
|
2733
|
+
CodeRay::Scanners::Ruby::Patterns::OCTAL = T.let(T.unsafe(nil), Regexp)
|
2734
|
+
|
2735
|
+
# See http://murfy.de/ruby-constants.
|
2736
|
+
#
|
2737
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#17
|
2738
|
+
CodeRay::Scanners::Ruby::Patterns::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array)
|
2739
|
+
|
2740
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#58
|
2741
|
+
CodeRay::Scanners::Ruby::Patterns::PREFIX_VARIABLE = T.let(T.unsafe(nil), Regexp)
|
2742
|
+
|
2743
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#61
|
2744
|
+
CodeRay::Scanners::Ruby::Patterns::QUOTE_TO_TYPE = T.let(T.unsafe(nil), Hash)
|
2745
|
+
|
2746
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#67
|
2747
|
+
CodeRay::Scanners::Ruby::Patterns::REGEXP_MODIFIERS = T.let(T.unsafe(nil), Regexp)
|
2748
|
+
|
2749
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#126
|
2750
|
+
CodeRay::Scanners::Ruby::Patterns::RUBYDOC = T.let(T.unsafe(nil), Regexp)
|
2751
|
+
|
2752
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#138
|
2753
|
+
CodeRay::Scanners::Ruby::Patterns::RUBYDOC_OR_DATA = T.let(T.unsafe(nil), Regexp)
|
2754
|
+
|
2755
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#89
|
2756
|
+
CodeRay::Scanners::Ruby::Patterns::SIMPLE_ESCAPE = T.let(T.unsafe(nil), Regexp)
|
2757
|
+
|
2758
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#79
|
2759
|
+
CodeRay::Scanners::Ruby::Patterns::SYMBOL = T.let(T.unsafe(nil), Regexp)
|
2760
|
+
|
2761
|
+
# Checks for a valid value to follow. This enables
|
2762
|
+
# value_expected in method calls without parentheses.
|
2763
|
+
#
|
2764
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#142
|
2765
|
+
CodeRay::Scanners::Ruby::Patterns::VALUE_FOLLOWS = T.let(T.unsafe(nil), Regexp)
|
2766
|
+
|
2767
|
+
# source://coderay//lib/coderay/scanners/ruby/patterns.rb#59
|
2768
|
+
CodeRay::Scanners::Ruby::Patterns::VARIABLE = T.let(T.unsafe(nil), Regexp)
|
2769
|
+
|
2770
|
+
# source://coderay//lib/coderay/scanners/ruby/string_state.rb#8
|
2771
|
+
class CodeRay::Scanners::Ruby::StringState < ::Struct
|
2772
|
+
# @return [StringState] a new instance of StringState
|
2773
|
+
#
|
2774
|
+
# source://coderay//lib/coderay/scanners/ruby/string_state.rb#48
|
2775
|
+
def initialize(kind, interpreted, delim, heredoc = T.unsafe(nil)); end
|
2776
|
+
|
2777
|
+
# source://coderay//lib/coderay/scanners/ruby/string_state.rb#63
|
2778
|
+
def heredoc_pattern(delim, interpreted, indented); end
|
2779
|
+
|
2780
|
+
class << self
|
2781
|
+
# source://coderay//lib/coderay/scanners/ruby/string_state.rb#40
|
2782
|
+
def simple_key_pattern(delim); end
|
2783
|
+
end
|
2784
|
+
end
|
2785
|
+
|
2786
|
+
# source://coderay//lib/coderay/scanners/ruby/string_state.rb#10
|
2787
|
+
CodeRay::Scanners::Ruby::StringState::CLOSING_PAREN = T.let(T.unsafe(nil), Hash)
|
2788
|
+
|
2789
|
+
# source://coderay//lib/coderay/scanners/ruby/string_state.rb#17
|
2790
|
+
CodeRay::Scanners::Ruby::StringState::STRING_PATTERN = T.let(T.unsafe(nil), Hash)
|
2791
|
+
|
2792
|
+
# by Josh Goebel
|
2793
|
+
#
|
2794
|
+
# source://coderay//lib/coderay/scanners/sql.rb#5
|
2795
|
+
class CodeRay::Scanners::SQL < ::CodeRay::Scanners::Scanner
|
2796
|
+
# source://coderay//lib/coderay/scanners/sql.rb#66
|
2797
|
+
def scan_tokens(encoder, options); end
|
2798
|
+
end
|
2799
|
+
|
2800
|
+
# source://coderay//lib/coderay/scanners/sql.rb#23
|
2801
|
+
CodeRay::Scanners::SQL::COMMANDS = T.let(T.unsafe(nil), Array)
|
2802
|
+
|
2803
|
+
# source://coderay//lib/coderay/scanners/sql.rb#38
|
2804
|
+
CodeRay::Scanners::SQL::DIRECTIVES = T.let(T.unsafe(nil), Array)
|
2805
|
+
|
2806
|
+
# source://coderay//lib/coderay/scanners/sql.rb#55
|
2807
|
+
CodeRay::Scanners::SQL::ESCAPE = T.let(T.unsafe(nil), Regexp)
|
2808
|
+
|
2809
|
+
# source://coderay//lib/coderay/scanners/sql.rb#46
|
2810
|
+
CodeRay::Scanners::SQL::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList::CaseIgnoring)
|
2811
|
+
|
2812
|
+
# source://coderay//lib/coderay/scanners/sql.rb#9
|
2813
|
+
CodeRay::Scanners::SQL::KEYWORDS = T.let(T.unsafe(nil), Array)
|
2814
|
+
|
2815
|
+
# source://coderay//lib/coderay/scanners/sql.rb#18
|
2816
|
+
CodeRay::Scanners::SQL::OBJECTS = T.let(T.unsafe(nil), Array)
|
2817
|
+
|
2818
|
+
# source://coderay//lib/coderay/scanners/sql.rb#44
|
2819
|
+
CodeRay::Scanners::SQL::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array)
|
2820
|
+
|
2821
|
+
# source://coderay//lib/coderay/scanners/sql.rb#36
|
2822
|
+
CodeRay::Scanners::SQL::PREDEFINED_FUNCTIONS = T.let(T.unsafe(nil), Array)
|
2823
|
+
|
2824
|
+
# source://coderay//lib/coderay/scanners/sql.rb#28
|
2825
|
+
CodeRay::Scanners::SQL::PREDEFINED_TYPES = T.let(T.unsafe(nil), Array)
|
2826
|
+
|
2827
|
+
# source://coderay//lib/coderay/scanners/sql.rb#60
|
2828
|
+
CodeRay::Scanners::SQL::STRING_CONTENT_PATTERN = T.let(T.unsafe(nil), Hash)
|
2829
|
+
|
2830
|
+
# source://coderay//lib/coderay/scanners/sql.rb#58
|
2831
|
+
CodeRay::Scanners::SQL::STRING_PREFIXES = T.let(T.unsafe(nil), Regexp)
|
2832
|
+
|
2833
|
+
# source://coderay//lib/coderay/scanners/sql.rb#56
|
2834
|
+
CodeRay::Scanners::SQL::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp)
|
2835
|
+
|
2836
|
+
# A scanner for Sass.
|
2837
|
+
#
|
2838
|
+
# source://coderay//lib/coderay/scanners/sass.rb#5
|
2839
|
+
class CodeRay::Scanners::Sass < ::CodeRay::Scanners::CSS
|
2840
|
+
protected
|
2841
|
+
|
2842
|
+
# source://coderay//lib/coderay/scanners/sass.rb#16
|
2843
|
+
def scan_tokens(encoder, options); end
|
2844
|
+
|
2845
|
+
# source://coderay//lib/coderay/scanners/sass.rb#12
|
2846
|
+
def setup; end
|
2847
|
+
end
|
2848
|
+
|
2849
|
+
# = Scanner
|
2850
|
+
#
|
2851
|
+
# The base class for all Scanners.
|
2852
|
+
#
|
2853
|
+
# It is a subclass of Ruby's great +StringScanner+, which
|
2854
|
+
# makes it easy to access the scanning methods inside.
|
2855
|
+
#
|
2856
|
+
# It is also +Enumerable+, so you can use it like an Array of
|
2857
|
+
# Tokens:
|
2858
|
+
#
|
2859
|
+
# require 'coderay'
|
2860
|
+
#
|
2861
|
+
# c_scanner = CodeRay::Scanners[:c].new "if (*p == '{') nest++;"
|
2862
|
+
#
|
2863
|
+
# for text, kind in c_scanner
|
2864
|
+
# puts text if kind == :operator
|
2865
|
+
# end
|
2866
|
+
#
|
2867
|
+
# # prints: (*==)++;
|
2868
|
+
#
|
2869
|
+
# OK, this is a very simple example :)
|
2870
|
+
# You can also use +map+, +any?+, +find+ and even +sort_by+,
|
2871
|
+
# if you want.
|
2872
|
+
#
|
2873
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#29
|
2874
|
+
class CodeRay::Scanners::Scanner < ::StringScanner
|
2875
|
+
include ::Enumerable
|
2876
|
+
extend ::CodeRay::Plugin
|
2877
|
+
|
2878
|
+
# Create a new Scanner.
|
2879
|
+
#
|
2880
|
+
# * +code+ is the input String and is handled by the superclass
|
2881
|
+
# StringScanner.
|
2882
|
+
# * +options+ is a Hash with Symbols as keys.
|
2883
|
+
# It is merged with the default options of the class (you can
|
2884
|
+
# overwrite default options here.)
|
2885
|
+
#
|
2886
|
+
# Else, a Tokens object is used.
|
2887
|
+
#
|
2888
|
+
# @return [Scanner] a new instance of Scanner
|
2889
|
+
#
|
2890
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#125
|
2891
|
+
def initialize(code = T.unsafe(nil), options = T.unsafe(nil)); end
|
2892
|
+
|
2893
|
+
# The string in binary encoding.
|
2894
|
+
#
|
2895
|
+
# To be used with #pos, which is the index of the byte the scanner
|
2896
|
+
# will scan next.
|
2897
|
+
#
|
2898
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#218
|
2899
|
+
def binary_string; end
|
2900
|
+
|
2901
|
+
# The current column position of the scanner, starting with 1.
|
2902
|
+
# See also: #line.
|
2903
|
+
#
|
2904
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#209
|
2905
|
+
def column(pos = T.unsafe(nil)); end
|
2906
|
+
|
2907
|
+
# Traverse the tokens.
|
2908
|
+
#
|
2909
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#192
|
2910
|
+
def each(&block); end
|
2911
|
+
|
2912
|
+
# the default file extension for this scanner
|
2913
|
+
#
|
2914
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#160
|
2915
|
+
def file_extension; end
|
2916
|
+
|
2917
|
+
# the Plugin ID for this scanner
|
2918
|
+
#
|
2919
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#155
|
2920
|
+
def lang; end
|
2921
|
+
|
2922
|
+
# The current line position of the scanner, starting with 1.
|
2923
|
+
# See also: #column.
|
2924
|
+
#
|
2925
|
+
# Beware, this is implemented inefficiently. It should be used
|
2926
|
+
# for debugging only.
|
2927
|
+
#
|
2928
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#202
|
2929
|
+
def line(pos = T.unsafe(nil)); end
|
2930
|
+
|
2931
|
+
# Sets back the scanner. Subclasses should redefine the reset_instance
|
2932
|
+
# method instead of this one.
|
2933
|
+
#
|
2934
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#142
|
2935
|
+
def reset; end
|
2936
|
+
|
2937
|
+
# Returns the value of attribute state.
|
2938
|
+
#
|
2939
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#44
|
2940
|
+
def state; end
|
2941
|
+
|
2942
|
+
# Sets the attribute state
|
2943
|
+
#
|
2944
|
+
# @param value the value to set the attribute state to.
|
2945
|
+
#
|
2946
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#44
|
2947
|
+
def state=(_arg0); end
|
2948
|
+
|
2949
|
+
# Set a new string to be scanned.
|
2950
|
+
#
|
2951
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#148
|
2952
|
+
def string=(code); end
|
2953
|
+
|
2954
|
+
# Scan the code and returns all tokens in a Tokens object.
|
2955
|
+
#
|
2956
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#165
|
2957
|
+
def tokenize(source = T.unsafe(nil), options = T.unsafe(nil)); end
|
2958
|
+
|
2959
|
+
# Cache the result of tokenize.
|
2960
|
+
#
|
2961
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#187
|
2962
|
+
def tokens; end
|
2963
|
+
|
2964
|
+
protected
|
2965
|
+
|
2966
|
+
# Scanner error with additional status information
|
2967
|
+
#
|
2968
|
+
# @raise [ScanError]
|
2969
|
+
#
|
2970
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#314
|
2971
|
+
def raise_inspect(message, tokens, state = T.unsafe(nil), ambit = T.unsafe(nil), backtrace = T.unsafe(nil)); end
|
2972
|
+
|
2973
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#289
|
2974
|
+
def raise_inspect_arguments(message, tokens, state, ambit); end
|
2975
|
+
|
2976
|
+
# Resets the scanner.
|
2977
|
+
#
|
2978
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#265
|
2979
|
+
def reset_instance; end
|
2980
|
+
|
2981
|
+
# Shorthand for scan_until(/\z/).
|
2982
|
+
# This method also avoids a JRuby 1.9 mode bug.
|
2983
|
+
#
|
2984
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#328
|
2985
|
+
def scan_rest; end
|
2986
|
+
|
2987
|
+
# This is the central method, and commonly the only one a
|
2988
|
+
# subclass implements.
|
2989
|
+
#
|
2990
|
+
# Subclasses must implement this method; it must return +tokens+
|
2991
|
+
# and must only use Tokens#<< for storing scanned tokens!
|
2992
|
+
#
|
2993
|
+
# @raise [NotImplementedError]
|
2994
|
+
#
|
2995
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#260
|
2996
|
+
def scan_tokens(tokens, options); end
|
2997
|
+
|
2998
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#305
|
2999
|
+
def scanner_state_info(state); end
|
3000
|
+
|
3001
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#239
|
3002
|
+
def set_string_from_source(source); end
|
3003
|
+
|
3004
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#250
|
3005
|
+
def set_tokens_from_options(options); end
|
3006
|
+
|
3007
|
+
# Can be implemented by subclasses to do some initialization
|
3008
|
+
# that has to be done once per instance.
|
3009
|
+
#
|
3010
|
+
# Use reset for initialization that has to be done once per
|
3011
|
+
# scan.
|
3012
|
+
#
|
3013
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#236
|
3014
|
+
def setup; end
|
3015
|
+
|
3016
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#322
|
3017
|
+
def tokens_last(tokens, n); end
|
3018
|
+
|
3019
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#318
|
3020
|
+
def tokens_size(tokens); end
|
3021
|
+
|
3022
|
+
class << self
|
3023
|
+
# The encoding used internally by this scanner.
|
3024
|
+
#
|
3025
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#71
|
3026
|
+
def encoding(name = T.unsafe(nil)); end
|
3027
|
+
|
3028
|
+
# The typical filename suffix for this scanner's language.
|
3029
|
+
#
|
3030
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#66
|
3031
|
+
def file_extension(extension = T.unsafe(nil)); end
|
3032
|
+
|
3033
|
+
# The lang of this Scanner class, which is equal to its Plugin ID.
|
3034
|
+
#
|
3035
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#76
|
3036
|
+
def lang; end
|
3037
|
+
|
3038
|
+
# Normalizes the given code into a string with UNIX newlines, in the
|
3039
|
+
# scanner's internal encoding, with invalid and undefined charachters
|
3040
|
+
# replaced by placeholders. Always returns a new object.
|
3041
|
+
#
|
3042
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#51
|
3043
|
+
def normalize(code); end
|
3044
|
+
|
3045
|
+
protected
|
3046
|
+
|
3047
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#82
|
3048
|
+
def encode_with_encoding(code, target_encoding); end
|
3049
|
+
|
3050
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#100
|
3051
|
+
def guess_encoding(s); end
|
3052
|
+
|
3053
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#96
|
3054
|
+
def to_unix(code); end
|
3055
|
+
end
|
3056
|
+
end
|
3057
|
+
|
3058
|
+
# The default options for all scanner classes.
|
3059
|
+
#
|
3060
|
+
# Define @default_options for subclasses.
|
3061
|
+
#
|
3062
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#40
|
3063
|
+
CodeRay::Scanners::Scanner::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
|
3064
|
+
|
3065
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#42
|
3066
|
+
CodeRay::Scanners::Scanner::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array)
|
3067
|
+
|
3068
|
+
# source://coderay//lib/coderay/helpers/plugin.rb#41
|
3069
|
+
CodeRay::Scanners::Scanner::PLUGIN_HOST = CodeRay::Scanners
|
3070
|
+
|
3071
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#299
|
3072
|
+
CodeRay::Scanners::Scanner::SCANNER_STATE_INFO = T.let(T.unsafe(nil), String)
|
3073
|
+
|
3074
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#271
|
3075
|
+
CodeRay::Scanners::Scanner::SCAN_ERROR_MESSAGE = T.let(T.unsafe(nil), String)
|
3076
|
+
|
3077
|
+
# Raised if a Scanner fails while scanning
|
3078
|
+
#
|
3079
|
+
# source://coderay//lib/coderay/scanners/scanner.rb#35
|
3080
|
+
class CodeRay::Scanners::Scanner::ScanError < ::StandardError; end
|
3081
|
+
|
3082
|
+
# source://coderay//lib/coderay/scanners/taskpaper.rb#4
|
3083
|
+
class CodeRay::Scanners::Taskpaper < ::CodeRay::Scanners::Scanner
|
3084
|
+
protected
|
3085
|
+
|
3086
|
+
# source://coderay//lib/coderay/scanners/taskpaper.rb#11
|
3087
|
+
def scan_tokens(encoder, options); end
|
3088
|
+
end
|
3089
|
+
|
3090
|
+
# Scanner for plain text.
|
3091
|
+
#
|
3092
|
+
# Yields just one token of the kind :plain.
|
3093
|
+
#
|
3094
|
+
# Alias: +plaintext+, +plain+
|
3095
|
+
#
|
3096
|
+
# source://coderay//lib/coderay/scanners/text.rb#9
|
3097
|
+
class CodeRay::Scanners::Text < ::CodeRay::Scanners::Scanner
|
3098
|
+
protected
|
3099
|
+
|
3100
|
+
# source://coderay//lib/coderay/scanners/text.rb#18
|
3101
|
+
def scan_tokens(encoder, options); end
|
3102
|
+
end
|
3103
|
+
|
3104
|
+
# source://coderay//lib/coderay/scanners/text.rb#14
|
3105
|
+
CodeRay::Scanners::Text::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array)
|
3106
|
+
|
3107
|
+
# Scanner for XML.
|
3108
|
+
#
|
3109
|
+
# Currently this is the same scanner as Scanners::HTML.
|
3110
|
+
#
|
3111
|
+
# source://coderay//lib/coderay/scanners/xml.rb#9
|
3112
|
+
class CodeRay::Scanners::XML < ::CodeRay::Scanners::HTML; end
|
3113
|
+
|
3114
|
+
# Scanner for YAML.
|
3115
|
+
#
|
3116
|
+
# Based on the YAML scanner from Syntax by Jamis Buck.
|
3117
|
+
#
|
3118
|
+
# source://coderay//lib/coderay/scanners/yaml.rb#7
|
3119
|
+
class CodeRay::Scanners::YAML < ::CodeRay::Scanners::Scanner
|
3120
|
+
protected
|
3121
|
+
|
3122
|
+
# source://coderay//lib/coderay/scanners/yaml.rb#16
|
3123
|
+
def scan_tokens(encoder, options); end
|
3124
|
+
end
|
3125
|
+
|
3126
|
+
# source://coderay//lib/coderay/scanners/yaml.rb#12
|
3127
|
+
CodeRay::Scanners::YAML::KINDS_NOT_LOC = T.let(T.unsafe(nil), Symbol)
|
3128
|
+
|
3129
|
+
# This module holds the Style class and its subclasses.
|
3130
|
+
#
|
3131
|
+
# See Plugin.
|
3132
|
+
#
|
3133
|
+
# source://coderay//lib/coderay/styles.rb#6
|
3134
|
+
module CodeRay::Styles
|
3135
|
+
extend ::CodeRay::PluginHost
|
3136
|
+
end
|
3137
|
+
|
3138
|
+
# A colorful theme using CSS 3 colors (with alpha channel).
|
3139
|
+
#
|
3140
|
+
# source://coderay//lib/coderay/styles/alpha.rb#5
|
3141
|
+
class CodeRay::Styles::Alpha < ::CodeRay::Styles::Style; end
|
3142
|
+
|
3143
|
+
# source://coderay//lib/coderay/styles/alpha.rb#14
|
3144
|
+
CodeRay::Styles::Alpha::CSS_MAIN_STYLES = T.let(T.unsafe(nil), String)
|
3145
|
+
|
3146
|
+
# source://coderay//lib/coderay/styles/alpha.rb#53
|
3147
|
+
CodeRay::Styles::Alpha::TOKEN_COLORS = T.let(T.unsafe(nil), String)
|
3148
|
+
|
3149
|
+
# Base class for styles.
|
3150
|
+
#
|
3151
|
+
# Styles are used by Encoders::HTML to colorize tokens.
|
3152
|
+
#
|
3153
|
+
# source://coderay//lib/coderay/styles/style.rb#8
|
3154
|
+
class CodeRay::Styles::Style
|
3155
|
+
extend ::CodeRay::Plugin
|
3156
|
+
end
|
3157
|
+
|
3158
|
+
# source://coderay//lib/coderay/styles/style.rb#12
|
3159
|
+
CodeRay::Styles::Style::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
|
3160
|
+
|
3161
|
+
# source://coderay//lib/coderay/helpers/plugin.rb#41
|
3162
|
+
CodeRay::Styles::Style::PLUGIN_HOST = CodeRay::Styles
|
3163
|
+
|
3164
|
+
# A Hash of all known token kinds and their associated CSS classes.
|
3165
|
+
#
|
3166
|
+
# source://coderay//lib/coderay/token_kinds.rb#4
|
3167
|
+
CodeRay::TokenKinds = T.let(T.unsafe(nil), Hash)
|
3168
|
+
|
3169
|
+
# The Tokens class represents a list of tokens returned from
|
3170
|
+
# a Scanner. It's actually just an Array with a few helper methods.
|
3171
|
+
#
|
3172
|
+
# A token itself is not a special object, just two elements in an Array:
|
3173
|
+
# * the _token_ _text_ (the original source of the token in a String) or
|
3174
|
+
# a _token_ _action_ (begin_group, end_group, begin_line, end_line)
|
3175
|
+
# * the _token_ _kind_ (a Symbol representing the type of the token)
|
3176
|
+
#
|
3177
|
+
# It looks like this:
|
3178
|
+
#
|
3179
|
+
# ..., '# It looks like this', :comment, ...
|
3180
|
+
# ..., '3.1415926', :float, ...
|
3181
|
+
# ..., '$^', :error, ...
|
3182
|
+
#
|
3183
|
+
# Some scanners also yield sub-tokens, represented by special
|
3184
|
+
# token actions, for example :begin_group and :end_group.
|
3185
|
+
#
|
3186
|
+
# The Ruby scanner, for example, splits "a string" into:
|
3187
|
+
#
|
3188
|
+
# [
|
3189
|
+
# :begin_group, :string,
|
3190
|
+
# '"', :delimiter,
|
3191
|
+
# 'a string', :content,
|
3192
|
+
# '"', :delimiter,
|
3193
|
+
# :end_group, :string
|
3194
|
+
# ]
|
3195
|
+
#
|
3196
|
+
# Tokens can be used to save the output of a Scanners in a simple
|
3197
|
+
# Ruby object that can be send to an Encoder later:
|
3198
|
+
#
|
3199
|
+
# tokens = CodeRay.scan('price = 2.59', :ruby).tokens
|
3200
|
+
# tokens.encode(:html)
|
3201
|
+
# tokens.html
|
3202
|
+
# CodeRay.encoder(:html).encode_tokens(tokens)
|
3203
|
+
#
|
3204
|
+
# Tokens gives you the power to handle pre-scanned code very easily:
|
3205
|
+
# You can serialize it to a JSON string and store it in a database, pass it
|
3206
|
+
# around to encode it more than once, send it to other algorithms...
|
3207
|
+
#
|
3208
|
+
# source://coderay//lib/coderay/tokens.rb#43
|
3209
|
+
class CodeRay::Tokens < ::Array
|
3210
|
+
# source://coderay//lib/coderay/tokens.rb#156
|
3211
|
+
def begin_group(kind); end
|
3212
|
+
|
3213
|
+
# source://coderay//lib/coderay/tokens.rb#158
|
3214
|
+
def begin_line(kind); end
|
3215
|
+
|
3216
|
+
# Return the actual number of tokens.
|
3217
|
+
#
|
3218
|
+
# source://coderay//lib/coderay/tokens.rb#151
|
3219
|
+
def count; end
|
3220
|
+
|
3221
|
+
# Encode the tokens using encoder.
|
3222
|
+
#
|
3223
|
+
# encoder can be
|
3224
|
+
# * a plugin name like :html oder 'statistic'
|
3225
|
+
# * an Encoder object
|
3226
|
+
#
|
3227
|
+
# options are passed to the encoder.
|
3228
|
+
#
|
3229
|
+
# source://coderay//lib/coderay/tokens.rb#56
|
3230
|
+
def encode(encoder, options = T.unsafe(nil)); end
|
3231
|
+
|
3232
|
+
# source://coderay//lib/coderay/tokens.rb#157
|
3233
|
+
def end_group(kind); end
|
3234
|
+
|
3235
|
+
# source://coderay//lib/coderay/tokens.rb#159
|
3236
|
+
def end_line(kind); end
|
3237
|
+
|
3238
|
+
# Redirects unknown methods to encoder calls.
|
3239
|
+
#
|
3240
|
+
# For example, if you call +tokens.html+, the HTML encoder
|
3241
|
+
# is used to highlight the tokens.
|
3242
|
+
#
|
3243
|
+
# source://coderay//lib/coderay/tokens.rb#70
|
3244
|
+
def method_missing(meth, options = T.unsafe(nil)); end
|
3245
|
+
|
3246
|
+
# The Scanner instance that created the tokens.
|
3247
|
+
#
|
3248
|
+
# source://coderay//lib/coderay/tokens.rb#47
|
3249
|
+
def scanner; end
|
3250
|
+
|
3251
|
+
# The Scanner instance that created the tokens.
|
3252
|
+
#
|
3253
|
+
# source://coderay//lib/coderay/tokens.rb#47
|
3254
|
+
def scanner=(_arg0); end
|
3255
|
+
|
3256
|
+
# Split the tokens into parts of the given +sizes+.
|
3257
|
+
#
|
3258
|
+
# The result will be an Array of Tokens objects. The parts have
|
3259
|
+
# the text size specified by the parameter. In addition, each
|
3260
|
+
# part closes all opened tokens. This is useful to insert tokens
|
3261
|
+
# betweem them.
|
3262
|
+
#
|
3263
|
+
# This method is used by @Scanner#tokenize@ when called with an Array
|
3264
|
+
# of source strings. The Diff encoder uses it for inline highlighting.
|
3265
|
+
#
|
3266
|
+
# source://coderay//lib/coderay/tokens.rb#85
|
3267
|
+
def split_into_parts(*sizes); end
|
3268
|
+
|
3269
|
+
def text_token(*_arg0); end
|
3270
|
+
|
3271
|
+
# Turn tokens into a string by concatenating them.
|
3272
|
+
#
|
3273
|
+
# source://coderay//lib/coderay/tokens.rb#62
|
3274
|
+
def to_s; end
|
3275
|
+
|
3276
|
+
def tokens(*_arg0); end
|
3277
|
+
end
|
3278
|
+
|
3279
|
+
# The result of a scan operation is a TokensProxy, but should act like Tokens.
|
3280
|
+
#
|
3281
|
+
# This proxy makes it possible to use the classic CodeRay.scan.encode API
|
3282
|
+
# while still providing the benefits of direct streaming.
|
3283
|
+
#
|
3284
|
+
# source://coderay//lib/coderay/tokens_proxy.rb#7
|
3285
|
+
class CodeRay::TokensProxy
|
3286
|
+
# Create a new TokensProxy with the arguments of CodeRay.scan.
|
3287
|
+
#
|
3288
|
+
# @return [TokensProxy] a new instance of TokensProxy
|
3289
|
+
#
|
3290
|
+
# source://coderay//lib/coderay/tokens_proxy.rb#12
|
3291
|
+
def initialize(input, lang, options = T.unsafe(nil), block = T.unsafe(nil)); end
|
3292
|
+
|
3293
|
+
# Returns the value of attribute block.
|
3294
|
+
#
|
3295
|
+
# source://coderay//lib/coderay/tokens_proxy.rb#9
|
3296
|
+
def block; end
|
3297
|
+
|
3298
|
+
# Sets the attribute block
|
3299
|
+
#
|
3300
|
+
# @param value the value to set the attribute block to.
|
3301
|
+
#
|
3302
|
+
# source://coderay//lib/coderay/tokens_proxy.rb#9
|
3303
|
+
def block=(_arg0); end
|
3304
|
+
|
3305
|
+
# Overwrite Struct#each.
|
3306
|
+
#
|
3307
|
+
# source://coderay//lib/coderay/tokens_proxy.rb#48
|
3308
|
+
def each(*args, &blk); end
|
3309
|
+
|
3310
|
+
# Call CodeRay.encode if +encoder+ is a Symbol;
|
3311
|
+
# otherwise, convert the receiver to tokens and call encoder.encode_tokens.
|
3312
|
+
#
|
3313
|
+
# source://coderay//lib/coderay/tokens_proxy.rb#21
|
3314
|
+
def encode(encoder, options = T.unsafe(nil)); end
|
3315
|
+
|
3316
|
+
# Returns the value of attribute input.
|
3317
|
+
#
|
3318
|
+
# source://coderay//lib/coderay/tokens_proxy.rb#9
|
3319
|
+
def input; end
|
3320
|
+
|
3321
|
+
# Sets the attribute input
|
3322
|
+
#
|
3323
|
+
# @param value the value to set the attribute input to.
|
3324
|
+
#
|
3325
|
+
# source://coderay//lib/coderay/tokens_proxy.rb#9
|
3326
|
+
def input=(_arg0); end
|
3327
|
+
|
3328
|
+
# Returns the value of attribute lang.
|
3329
|
+
#
|
3330
|
+
# source://coderay//lib/coderay/tokens_proxy.rb#9
|
3331
|
+
def lang; end
|
3332
|
+
|
3333
|
+
# Sets the attribute lang
|
3334
|
+
#
|
3335
|
+
# @param value the value to set the attribute lang to.
|
3336
|
+
#
|
3337
|
+
# source://coderay//lib/coderay/tokens_proxy.rb#9
|
3338
|
+
def lang=(_arg0); end
|
3339
|
+
|
3340
|
+
# Tries to call encode;
|
3341
|
+
# delegates to tokens otherwise.
|
3342
|
+
#
|
3343
|
+
# source://coderay//lib/coderay/tokens_proxy.rb#31
|
3344
|
+
def method_missing(method, *args, &blk); end
|
3345
|
+
|
3346
|
+
# Returns the value of attribute options.
|
3347
|
+
#
|
3348
|
+
# source://coderay//lib/coderay/tokens_proxy.rb#9
|
3349
|
+
def options; end
|
3350
|
+
|
3351
|
+
# Sets the attribute options
|
3352
|
+
#
|
3353
|
+
# @param value the value to set the attribute options to.
|
3354
|
+
#
|
3355
|
+
# source://coderay//lib/coderay/tokens_proxy.rb#9
|
3356
|
+
def options=(_arg0); end
|
3357
|
+
|
3358
|
+
# A (cached) scanner instance to use for the scan task.
|
3359
|
+
#
|
3360
|
+
# source://coderay//lib/coderay/tokens_proxy.rb#43
|
3361
|
+
def scanner; end
|
3362
|
+
|
3363
|
+
# The (cached) result of the tokenized input; a Tokens instance.
|
3364
|
+
#
|
3365
|
+
# source://coderay//lib/coderay/tokens_proxy.rb#38
|
3366
|
+
def tokens; end
|
3367
|
+
end
|
3368
|
+
|
3369
|
+
# source://coderay//lib/coderay/version.rb#2
|
3370
|
+
CodeRay::VERSION = T.let(T.unsafe(nil), String)
|
3371
|
+
|
3372
|
+
# = WordList
|
3373
|
+
#
|
3374
|
+
# <b>A Hash subclass designed for mapping word lists to token types.</b>
|
3375
|
+
#
|
3376
|
+
# A WordList is a Hash with some additional features.
|
3377
|
+
# It is intended to be used for keyword recognition.
|
3378
|
+
#
|
3379
|
+
# WordList is optimized to be used in Scanners,
|
3380
|
+
# typically to decide whether a given ident is a special token.
|
3381
|
+
#
|
3382
|
+
# For case insensitive words use WordList::CaseIgnoring.
|
3383
|
+
#
|
3384
|
+
# Example:
|
3385
|
+
#
|
3386
|
+
# # define word arrays
|
3387
|
+
# RESERVED_WORDS = %w[
|
3388
|
+
# asm break case continue default do else
|
3389
|
+
# ]
|
3390
|
+
#
|
3391
|
+
# PREDEFINED_TYPES = %w[
|
3392
|
+
# int long short char void
|
3393
|
+
# ]
|
3394
|
+
#
|
3395
|
+
# # make a WordList
|
3396
|
+
# IDENT_KIND = WordList.new(:ident).
|
3397
|
+
# add(RESERVED_WORDS, :reserved).
|
3398
|
+
# add(PREDEFINED_TYPES, :predefined_type)
|
3399
|
+
#
|
3400
|
+
# ...
|
3401
|
+
#
|
3402
|
+
# def scan_tokens tokens, options
|
3403
|
+
# ...
|
3404
|
+
#
|
3405
|
+
# elsif scan(/[A-Za-z_][A-Za-z_0-9]*/)
|
3406
|
+
# # use it
|
3407
|
+
# kind = IDENT_KIND[match]
|
3408
|
+
# ...
|
3409
|
+
#
|
3410
|
+
# source://coderay//lib/coderay/helpers/word_list.rb#40
|
3411
|
+
class CodeRay::WordList < ::Hash
|
3412
|
+
# Create a new WordList with +default+ as default value.
|
3413
|
+
#
|
3414
|
+
# @return [WordList] a new instance of WordList
|
3415
|
+
#
|
3416
|
+
# source://coderay//lib/coderay/helpers/word_list.rb#43
|
3417
|
+
def initialize(default = T.unsafe(nil)); end
|
3418
|
+
|
3419
|
+
# Add words to the list and associate them with +value+.
|
3420
|
+
#
|
3421
|
+
# Returns +self+, so you can concat add calls.
|
3422
|
+
#
|
3423
|
+
# source://coderay//lib/coderay/helpers/word_list.rb#50
|
3424
|
+
def add(words, value = T.unsafe(nil)); end
|
3425
|
+
end
|
3426
|
+
|
3427
|
+
# A CaseIgnoring WordList is like a WordList, only that
|
3428
|
+
# keys are compared case-insensitively (normalizing keys using +downcase+).
|
3429
|
+
#
|
3430
|
+
# source://coderay//lib/coderay/helpers/word_list.rb#60
|
3431
|
+
class CodeRay::WordList::CaseIgnoring < ::CodeRay::WordList
|
3432
|
+
# source://coderay//lib/coderay/helpers/word_list.rb#62
|
3433
|
+
def [](key); end
|
3434
|
+
|
3435
|
+
# source://coderay//lib/coderay/helpers/word_list.rb#66
|
3436
|
+
def []=(key, value); end
|
3437
|
+
end
|