rouge 1.9.1 → 1.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rouge.rb +4 -1
- data/lib/rouge/demos/praat +26 -0
- data/lib/rouge/lexer.rb +5 -2
- data/lib/rouge/lexers/common_lisp.rb +2 -2
- data/lib/rouge/lexers/cpp.rb +1 -1
- data/lib/rouge/lexers/glsl.rb +2 -2
- data/lib/rouge/lexers/matlab.rb +3 -2
- data/lib/rouge/lexers/moonscript.rb +1 -1
- data/lib/rouge/lexers/objective_c.rb +1 -1
- data/lib/rouge/lexers/powershell.rb +1 -1
- data/lib/rouge/lexers/praat.rb +340 -0
- data/lib/rouge/lexers/qml.rb +2 -1
- data/lib/rouge/lexers/rust.rb +1 -2
- data/lib/rouge/lexers/sass.rb +1 -1
- data/lib/rouge/lexers/scss.rb +1 -1
- data/lib/rouge/lexers/swift.rb +6 -21
- data/lib/rouge/lexers/vb.rb +1 -1
- data/lib/rouge/theme.rb +1 -1
- data/lib/rouge/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6626653a9eced6e141de02204ad519974a33681f
|
4
|
+
data.tar.gz: e3bc6c8899c3477de2fb5df663dff3994abadbee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c636bc9ae3a393af8e4a3885d1cbdef9d5fdea28c6d7adcfce158a462bbd0249b338193a8e2b5ad5cd6aa7048b1305127eae33df4e5443da194e6d0e3cfd3d7e
|
7
|
+
data.tar.gz: 75349c93480fc528bc20fa3dc93499a35e9a55956b2efda421c10ba8b991541830f7c7a60808a27d3212492baea3e6f57c32d4e0115277b200681f19413b93e6
|
data/lib/rouge.rb
CHANGED
@@ -40,7 +40,10 @@ load load_dir.join('rouge/lexer.rb')
|
|
40
40
|
load load_dir.join('rouge/regex_lexer.rb')
|
41
41
|
load load_dir.join('rouge/template_lexer.rb')
|
42
42
|
|
43
|
-
|
43
|
+
lexers_dir = load_dir.join('rouge/lexers')
|
44
|
+
Dir.glob(lexers_dir.join('*.rb')).each do |f|
|
45
|
+
Rouge::Lexers.load_lexer(Pathname.new(f).relative_path_from(lexers_dir).to_s)
|
46
|
+
end
|
44
47
|
|
45
48
|
load load_dir.join('rouge/formatter.rb')
|
46
49
|
load load_dir.join('rouge/formatters/html.rb')
|
@@ -0,0 +1,26 @@
|
|
1
|
+
form Copy selected files...
|
2
|
+
word Prefix
|
3
|
+
word Suffix _copy
|
4
|
+
boolean Keep_original 1
|
5
|
+
endform
|
6
|
+
|
7
|
+
total_objects = numberOfSelected()
|
8
|
+
for i to total_objects
|
9
|
+
my_object[i] = selected(i)
|
10
|
+
endfor
|
11
|
+
for i to total_objects
|
12
|
+
selectObject: my_object[i]
|
13
|
+
@copy()
|
14
|
+
new[i] = selected()
|
15
|
+
endfor
|
16
|
+
if total_objects
|
17
|
+
selectObject: new[1]
|
18
|
+
for i from 2 to total_objects
|
19
|
+
plusObject: new[i]
|
20
|
+
endfor
|
21
|
+
endif
|
22
|
+
|
23
|
+
procedure copy ()
|
24
|
+
.name$ = extractWord$(selected$(), " ")
|
25
|
+
Copy: prefix$ + .name$ + suffix$
|
26
|
+
endproc
|
data/lib/rouge/lexer.rb
CHANGED
@@ -433,8 +433,11 @@ module Rouge
|
|
433
433
|
end
|
434
434
|
|
435
435
|
module Lexers
|
436
|
-
|
437
|
-
|
436
|
+
@_loaded_lexers = {}
|
437
|
+
|
438
|
+
def self.load_lexer(relpath)
|
439
|
+
return if @_loaded_lexers.key?(relpath)
|
440
|
+
@_loaded_lexers[relpath] = true
|
438
441
|
|
439
442
|
root = Pathname.new(__FILE__).dirname.join('lexers')
|
440
443
|
load root.join(relpath)
|
@@ -6,7 +6,7 @@ module Rouge
|
|
6
6
|
title "Common Lisp"
|
7
7
|
desc "The Common Lisp variant of Lisp (common-lisp.net)"
|
8
8
|
tag 'common_lisp'
|
9
|
-
aliases 'cl', 'common-lisp'
|
9
|
+
aliases 'cl', 'common-lisp', 'elisp', 'emacs-lisp'
|
10
10
|
|
11
11
|
filenames '*.cl', '*.lisp', '*.el' # used for Elisp too
|
12
12
|
mimetypes 'text/x-common-lisp'
|
@@ -270,7 +270,7 @@ module Rouge
|
|
270
270
|
|
271
271
|
# arrays and structures
|
272
272
|
rule /(#(?:\d+a|s))(\()/i do
|
273
|
-
groups
|
273
|
+
groups Str::Other, Punctuation
|
274
274
|
push :root
|
275
275
|
end
|
276
276
|
|
data/lib/rouge/lexers/cpp.rb
CHANGED
data/lib/rouge/lexers/glsl.rb
CHANGED
data/lib/rouge/lexers/matlab.rb
CHANGED
@@ -53,7 +53,7 @@ module Rouge
|
|
53
53
|
|
54
54
|
rule %r{[(){};:,\/\\\]\[]}, Punctuation
|
55
55
|
|
56
|
-
rule /~=|==|<<|>>|[
|
56
|
+
rule /~=|==|<<|>>|[-~+\/*%=<>&^|.@]/, Operator
|
57
57
|
|
58
58
|
|
59
59
|
rule /(\d+\.\d*|\d*\.\d+)(e[+-]?[0-9]+)?/i, Num::Float
|
@@ -61,7 +61,8 @@ module Rouge
|
|
61
61
|
rule /\d+L/, Num::Integer::Long
|
62
62
|
rule /\d+/, Num::Integer
|
63
63
|
|
64
|
-
rule /'/, Str::Single, :string
|
64
|
+
rule /'(?=(.*'))/, Str::Single, :string
|
65
|
+
rule /'/, Operator
|
65
66
|
end
|
66
67
|
|
67
68
|
state :string do
|
@@ -0,0 +1,340 @@
|
|
1
|
+
# -*- coding: utf-8 -*- #
|
2
|
+
|
3
|
+
module Rouge
|
4
|
+
module Lexers
|
5
|
+
class Praat < RegexLexer
|
6
|
+
title "Praat"
|
7
|
+
desc "The Praat scripting language (praat.org)"
|
8
|
+
|
9
|
+
tag 'praat'
|
10
|
+
|
11
|
+
filenames '*.praat', '*.proc', '*.psc'
|
12
|
+
|
13
|
+
def self.analyze_text(text)
|
14
|
+
return 1 if text.shebang? 'praat'
|
15
|
+
end
|
16
|
+
|
17
|
+
keywords = %w(
|
18
|
+
if then else elsif elif endif fi for from to endfor endproc while
|
19
|
+
endwhile repeat until select plus minus demo assert stopwatch
|
20
|
+
nocheck nowarn noprogress editor endeditor clearinfo
|
21
|
+
)
|
22
|
+
|
23
|
+
functions_string = %w(
|
24
|
+
backslashTrigraphsToUnicode chooseDirectory chooseReadFile
|
25
|
+
chooseWriteFile date demoKey do environment extractLine extractWord
|
26
|
+
fixed info left mid percent readFile replace replace_regex right
|
27
|
+
selected string unicodeToBackslashTrigraphs
|
28
|
+
)
|
29
|
+
|
30
|
+
functions_numeric = %w(
|
31
|
+
abs appendFile appendFileLine appendInfo appendInfoLine arccos arccosh
|
32
|
+
arcsin arcsinh arctan arctan2 arctanh barkToHertz beginPause
|
33
|
+
beginSendPraat besselI besselK beta beta2 binomialP binomialQ boolean
|
34
|
+
ceiling chiSquareP chiSquareQ choice comment cos cosh createDirectory
|
35
|
+
deleteFile demoClicked demoClickedIn demoCommandKeyPressed
|
36
|
+
demoExtraControlKeyPressed demoInput demoKeyPressed
|
37
|
+
demoOptionKeyPressed demoShiftKeyPressed demoShow demoWaitForInput
|
38
|
+
demoWindowTitle demoX demoY differenceLimensToPhon do editor endPause
|
39
|
+
endSendPraat endsWith erb erbToHertz erf erfc exitScript exp
|
40
|
+
extractNumber fileReadable fisherP fisherQ floor gaussP gaussQ
|
41
|
+
hertzToBark hertzToErb hertzToMel hertzToSemitones imax imin
|
42
|
+
incompleteBeta incompleteGammaP index index_regex invBinomialP
|
43
|
+
invBinomialQ invChiSquareQ invFisherQ invGaussQ invSigmoid invStudentQ
|
44
|
+
length ln lnBeta lnGamma log10 log2 max melToHertz min minusObject
|
45
|
+
natural number numberOfColumns numberOfRows numberOfSelected
|
46
|
+
objectsAreIdentical option optionMenu pauseScript
|
47
|
+
phonToDifferenceLimens plusObject positive randomBinomial randomGauss
|
48
|
+
randomInteger randomPoisson randomUniform real readFile removeObject
|
49
|
+
rindex rindex_regex round runScript runSystem runSystem_nocheck
|
50
|
+
selectObject selected semitonesToHertz sentencetext sigmoid sin sinc
|
51
|
+
sincpi sinh soundPressureToPhon sqrt startsWith studentP studentQ tan
|
52
|
+
tanh variableExists word writeFile writeFileLine writeInfo
|
53
|
+
writeInfoLine
|
54
|
+
)
|
55
|
+
|
56
|
+
functions_array = %w(
|
57
|
+
linear randomGauss randomInteger randomUniform zero
|
58
|
+
)
|
59
|
+
|
60
|
+
objects = %w(
|
61
|
+
Activation AffineTransform AmplitudeTier Art Artword Autosegment
|
62
|
+
BarkFilter BarkSpectrogram CCA Categories Cepstrogram Cepstrum
|
63
|
+
Cepstrumc ChebyshevSeries ClassificationTable Cochleagram Collection
|
64
|
+
ComplexSpectrogram Configuration Confusion ContingencyTable Corpus
|
65
|
+
Correlation Covariance CrossCorrelationTable CrossCorrelationTables DTW
|
66
|
+
DataModeler Diagonalizer Discriminant Dissimilarity Distance
|
67
|
+
Distributions DurationTier EEG ERP ERPTier EditCostsTable
|
68
|
+
EditDistanceTable Eigen Excitation Excitations ExperimentMFC FFNet
|
69
|
+
FeatureWeights FileInMemory FilesInMemory Formant FormantFilter
|
70
|
+
FormantGrid FormantModeler FormantPoint FormantTier GaussianMixture HMM
|
71
|
+
HMM_Observation HMM_ObservationSequence HMM_State HMM_StateSequence
|
72
|
+
Harmonicity ISpline Index Intensity IntensityTier IntervalTier KNN
|
73
|
+
KlattGrid KlattTable LFCC LPC Label LegendreSeries LinearRegression
|
74
|
+
LogisticRegression LongSound Ltas MFCC MSpline ManPages Manipulation
|
75
|
+
Matrix MelFilter MelSpectrogram MixingMatrix Movie Network OTGrammar
|
76
|
+
OTHistory OTMulti PCA PairDistribution ParamCurve Pattern Permutation
|
77
|
+
Photo Pitch PitchModeler PitchTier PointProcess Polygon Polynomial
|
78
|
+
PowerCepstrogram PowerCepstrum Procrustes RealPoint RealTier ResultsMFC
|
79
|
+
Roots SPINET SSCP SVD Salience ScalarProduct Similarity SimpleString
|
80
|
+
SortedSetOfString Sound Speaker Spectrogram Spectrum SpectrumTier
|
81
|
+
SpeechSynthesizer SpellingChecker Strings StringsIndex Table
|
82
|
+
TableOfReal TextGrid TextInterval TextPoint TextTier Tier Transition
|
83
|
+
VocalTract VocalTractTier Weight WordList
|
84
|
+
)
|
85
|
+
|
86
|
+
variables_numeric = %w(
|
87
|
+
macintosh windows unix praatVersion pi e undefined
|
88
|
+
)
|
89
|
+
|
90
|
+
variables_string = %w(
|
91
|
+
praatVersion tab shellDirectory homeDirectory
|
92
|
+
preferencesDirectory newline temporaryDirectory
|
93
|
+
defaultDirectory
|
94
|
+
)
|
95
|
+
|
96
|
+
state :root do
|
97
|
+
rule /(\s+)(#.*?$)/ do
|
98
|
+
groups Text, Comment::Single
|
99
|
+
end
|
100
|
+
|
101
|
+
rule /^#.*?$/, Comment::Single
|
102
|
+
rule /;[^\n]*/, Comment::Single
|
103
|
+
rule /\s+/, Text
|
104
|
+
rule /\bprocedure\b/, Keyword, :procedure_definition
|
105
|
+
rule /\bcall\b/, Keyword, :procedure_call
|
106
|
+
rule /@/, Name::Function, :procedure_call
|
107
|
+
|
108
|
+
mixin :function_call
|
109
|
+
|
110
|
+
rule /\b(?:#{keywords.join('|')})\b/, Keyword
|
111
|
+
|
112
|
+
rule /(\bform\b)(\s+)([^\n]+)/ do
|
113
|
+
groups Keyword, Text, Literal::String
|
114
|
+
push :old_form
|
115
|
+
end
|
116
|
+
|
117
|
+
rule /(print(?:line|tab)?|echo|exit|asserterror|pause|send(?:praat|socket)|include|execute|system(?:_nocheck)?)(\s+)/ do
|
118
|
+
groups Keyword, Text
|
119
|
+
push :string_unquoted
|
120
|
+
end
|
121
|
+
|
122
|
+
rule /(goto|label)(\s+)(\w+)/ do
|
123
|
+
groups Keyword, Text, Name::Label
|
124
|
+
end
|
125
|
+
|
126
|
+
mixin :variable_name
|
127
|
+
mixin :number
|
128
|
+
|
129
|
+
rule /"/, Literal::String, :string
|
130
|
+
|
131
|
+
rule /\b(?:#{objects.join('|')})(?=\s+\S+\n)/, Name::Class, :string_unquoted
|
132
|
+
|
133
|
+
rule /\b(?=[A-Z])/, Text, :command
|
134
|
+
rule /(\.{3}|[)(,\$])/, Punctuation
|
135
|
+
rule /./, Generic::Error
|
136
|
+
end
|
137
|
+
|
138
|
+
state :command do
|
139
|
+
rule /( ?[\w()-]+ ?)/, Keyword
|
140
|
+
rule /'(?=.*')/, Literal::String::Interpol, :string_interpolated
|
141
|
+
rule /\.{3}/, Keyword, :old_arguments
|
142
|
+
rule /:/, Keyword, :comma_list
|
143
|
+
rule /[\s\n]/, Text, :pop!
|
144
|
+
end
|
145
|
+
|
146
|
+
state :function_call do
|
147
|
+
rule /\b(#{functions_string.join('|')})\$(?=\s*[:(])/, Name::Function, :function
|
148
|
+
rule /\b(#{functions_array.join('|')})#(?=\s*[:(])/, Name::Function, :function
|
149
|
+
rule /\b(#{functions_numeric.join('|')})(?=\s*[:(])/, Name::Function, :function
|
150
|
+
end
|
151
|
+
|
152
|
+
state :old_arguments do
|
153
|
+
rule /\n/ do
|
154
|
+
token Text
|
155
|
+
pop!
|
156
|
+
pop! unless state? :root
|
157
|
+
end
|
158
|
+
|
159
|
+
mixin :function_call
|
160
|
+
mixin :operator
|
161
|
+
mixin :number
|
162
|
+
|
163
|
+
rule /"/, Literal::String, :string
|
164
|
+
rule /[^\n]/, Text
|
165
|
+
end
|
166
|
+
|
167
|
+
state :function do
|
168
|
+
rule /\s+/, Text
|
169
|
+
|
170
|
+
rule /:/ do
|
171
|
+
token Punctuation
|
172
|
+
push :comma_list
|
173
|
+
end
|
174
|
+
|
175
|
+
rule /\s*\(/ do
|
176
|
+
token Punctuation
|
177
|
+
pop!
|
178
|
+
push :comma_list
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
state :procedure_call do
|
183
|
+
rule /\s+/, Text
|
184
|
+
|
185
|
+
rule /([\w.]+)(:|\s*\()/ do
|
186
|
+
groups Name::Function, Punctuation
|
187
|
+
push :comma_list
|
188
|
+
end
|
189
|
+
|
190
|
+
rule /([\w.]+)/, Name::Function, :old_arguments
|
191
|
+
end
|
192
|
+
|
193
|
+
state :procedure_definition do
|
194
|
+
rule /\s/, Text
|
195
|
+
|
196
|
+
rule /([\w.]+)(\s*?[(:])/ do
|
197
|
+
groups Name::Function, Text
|
198
|
+
pop!
|
199
|
+
end
|
200
|
+
|
201
|
+
rule /([\w.]+)([^\n]*)/ do
|
202
|
+
groups Name::Function, Text
|
203
|
+
pop!
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
207
|
+
state :comma_list do
|
208
|
+
rule /(\s*\n\s*)(\.{3})/ do
|
209
|
+
groups Text, Punctuation
|
210
|
+
end
|
211
|
+
|
212
|
+
rule /\s*(\)|\]|\n)/ do
|
213
|
+
token Punctuation
|
214
|
+
pop!
|
215
|
+
pop! unless state? :root
|
216
|
+
end
|
217
|
+
|
218
|
+
rule /\s+/, Text
|
219
|
+
rule /"/, Literal::String, :string
|
220
|
+
rule /\b(if|then|else|fi|endif)\b/, Keyword
|
221
|
+
|
222
|
+
mixin :function_call
|
223
|
+
mixin :variable_name
|
224
|
+
mixin :operator
|
225
|
+
mixin :number
|
226
|
+
|
227
|
+
rule /,/, Punctuation
|
228
|
+
end
|
229
|
+
|
230
|
+
state :number do
|
231
|
+
rule /\n/, Text, :pop!
|
232
|
+
rule /\b\d+(\.\d*)?([eE][-+]?\d+)?%?/, Literal::Number
|
233
|
+
end
|
234
|
+
|
235
|
+
state :variable_name do
|
236
|
+
mixin :operator
|
237
|
+
mixin :number
|
238
|
+
|
239
|
+
rule /\b(?:#{variables_string.join('|')})\$/, Name::Builtin
|
240
|
+
rule /\b(?:#{variables_numeric.join('|')})\b/, Name::Builtin
|
241
|
+
|
242
|
+
rule /\b(Object|#{objects.join('|')})_\w+/, Name::Builtin, :object_attributes
|
243
|
+
|
244
|
+
rule /\b((?:Object|#{objects.join('|')})_)(')/ do
|
245
|
+
groups Name::Builtin, Literal::String::Interpol
|
246
|
+
push :object_attributes
|
247
|
+
push :string_interpolated
|
248
|
+
end
|
249
|
+
|
250
|
+
rule /\.?[a-z][a-zA-Z0-9_.]*(\$|#)?/, Text
|
251
|
+
rule /[\[\]]/, Punctuation
|
252
|
+
rule /'(?=.*')/, Literal::String::Interpol, :string_interpolated
|
253
|
+
end
|
254
|
+
|
255
|
+
state :object_attributes do
|
256
|
+
rule /\.?(n(col|row)|[xy]min|[xy]max|[nd][xy])\b/, Name::Builtin, :pop!
|
257
|
+
rule /(\.?(?:col|row)\$)(\[)/ do
|
258
|
+
groups Name::Builtin, Punctuation
|
259
|
+
push :variable_name
|
260
|
+
end
|
261
|
+
rule /(\$?)(\[)/ do
|
262
|
+
groups Name::Builtin, Punctuation
|
263
|
+
push :comma_list
|
264
|
+
end
|
265
|
+
end
|
266
|
+
|
267
|
+
state :string_interpolated do
|
268
|
+
rule /\.?[_a-z][a-zA-Z0-9_.]*(?:[\$#]?(?:\[[a-zA-Z0-9,]+\])?|:[0-9]+)?/, Literal::String::Interpol
|
269
|
+
rule /'/, Literal::String::Interpol, :pop!
|
270
|
+
end
|
271
|
+
|
272
|
+
state :string_unquoted do
|
273
|
+
rule /\n\s*\.{3}/, Punctuation
|
274
|
+
rule /\n/, Text, :pop!
|
275
|
+
rule /\s/, Text
|
276
|
+
rule /'(?=.*')/, Literal::String::Interpol, :string_interpolated
|
277
|
+
rule /'/, Literal::String
|
278
|
+
rule /[^'\n]+/, Literal::String
|
279
|
+
end
|
280
|
+
|
281
|
+
state :string do
|
282
|
+
rule /\n\s*\.{3}/, Punctuation
|
283
|
+
rule /"/, Literal::String, :pop!
|
284
|
+
rule /'(?=.*')/, Literal::String::Interpol, :string_interpolated
|
285
|
+
rule /'/, Literal::String
|
286
|
+
rule /[^'"\n]+/, Literal::String
|
287
|
+
end
|
288
|
+
|
289
|
+
state :old_form do
|
290
|
+
rule /\s+/, Text
|
291
|
+
|
292
|
+
rule /(optionmenu|choice)([ \t]+\S+:[ \t]+)/ do
|
293
|
+
groups Keyword, Text
|
294
|
+
push :number
|
295
|
+
end
|
296
|
+
|
297
|
+
rule /(option|button)([ \t]+)/ do
|
298
|
+
groups Keyword, Text
|
299
|
+
push :number
|
300
|
+
end
|
301
|
+
|
302
|
+
rule /(option|button)([ \t]+)/ do
|
303
|
+
groups Keyword, Text
|
304
|
+
push :string_unquoted
|
305
|
+
end
|
306
|
+
|
307
|
+
rule /(sentence|text)([ \t]+\S+)/ do
|
308
|
+
groups Keyword, Text
|
309
|
+
push :string_unquoted
|
310
|
+
end
|
311
|
+
|
312
|
+
rule /(word)([ \t]+\S+[ \t]*)(\S+)?([ \t]+.*)?/ do
|
313
|
+
groups Keyword, Text, Literal::String, Generic::Error
|
314
|
+
end
|
315
|
+
|
316
|
+
rule /(boolean)(\s+\S+\s*)(0|1|"?(?:yes|no)"?)/ do
|
317
|
+
groups Keyword, Text, Name::Variable
|
318
|
+
end
|
319
|
+
|
320
|
+
rule /(real|natural|positive|integer)([ \t]+\S+[ \t]*)([+-]?)/ do
|
321
|
+
groups Keyword, Text, Operator
|
322
|
+
push :number
|
323
|
+
end
|
324
|
+
|
325
|
+
rule /(comment)(\s+)/ do
|
326
|
+
groups Keyword, Text
|
327
|
+
push :string_unquoted
|
328
|
+
end
|
329
|
+
|
330
|
+
rule /\bendform\b/, Keyword, :pop!
|
331
|
+
end
|
332
|
+
|
333
|
+
state :operator do
|
334
|
+
# This rule incorrectly matches === or +++++, which are not operators
|
335
|
+
rule /([+\/*<>=!-]=?|[&*|][&*|]?|\^|<>)/, Operator
|
336
|
+
rule /\b(and|or|not|div|mod)\b/, Operator::Word
|
337
|
+
end
|
338
|
+
end
|
339
|
+
end
|
340
|
+
end
|
data/lib/rouge/lexers/qml.rb
CHANGED
data/lib/rouge/lexers/rust.rb
CHANGED
data/lib/rouge/lexers/sass.rb
CHANGED
data/lib/rouge/lexers/scss.rb
CHANGED
data/lib/rouge/lexers/swift.rb
CHANGED
@@ -14,21 +14,17 @@ module Rouge
|
|
14
14
|
id = /#{id_head}#{id_rest}*/
|
15
15
|
|
16
16
|
keywords = Set.new %w(
|
17
|
-
break case continue default do else fallthrough if in for return switch where while
|
17
|
+
break case continue default do else fallthrough if in for return switch where while try catch throw guard defer repeat
|
18
18
|
|
19
19
|
as dynamicType is new super self Self Type __COLUMN__ __FILE__ __FUNCTION__ __LINE__
|
20
20
|
|
21
|
-
associativity didSet get infix inout left mutating none nonmutating operator override postfix precedence prefix right set unowned weak willSet
|
21
|
+
associativity didSet get infix inout left mutating none nonmutating operator override postfix precedence prefix right set unowned weak willSet throws rethrows
|
22
22
|
)
|
23
23
|
|
24
24
|
declarations = Set.new %w(
|
25
25
|
class deinit enum extension final func import init internal lazy let optional private protocol public required static struct subscript typealias var dynamic
|
26
26
|
)
|
27
27
|
|
28
|
-
attributes = Set.new %w(
|
29
|
-
autoclosure IBAction IBDesignable IBInspectable IBOutlet noreturn NSCopying NSManaged objc UIApplicationMain NSApplicationMain objc_block noescape
|
30
|
-
)
|
31
|
-
|
32
28
|
constants = Set.new %w(
|
33
29
|
true false nil
|
34
30
|
)
|
@@ -70,21 +66,7 @@ module Rouge
|
|
70
66
|
rule /0b[01]+(?:_[01]+)*/, Num::Bin
|
71
67
|
rule %r{[\d]+(?:_\d+)*}, Num::Integer
|
72
68
|
|
73
|
-
rule
|
74
|
-
|
75
|
-
rule /(@objc[(])([^)]+)([)])/ do
|
76
|
-
groups Keyword::Declaration, Name::Class, Keyword::Declaration
|
77
|
-
end
|
78
|
-
|
79
|
-
rule /@autoclosure\(escaping\)/, Keyword::Declaration
|
80
|
-
|
81
|
-
rule /@(#{id})/ do |m|
|
82
|
-
if attributes.include? m[1]
|
83
|
-
token Keyword
|
84
|
-
else
|
85
|
-
token Error
|
86
|
-
end
|
87
|
-
end
|
69
|
+
rule /@#{id}(\([^)]+\))?/, Keyword::Declaration
|
88
70
|
|
89
71
|
rule /(private|internal)(\([ ]*)(\w+)([ ]*\))/ do |m|
|
90
72
|
if m[3] == 'set'
|
@@ -101,6 +83,8 @@ module Rouge
|
|
101
83
|
groups Keyword::Declaration, Error, Keyword::Declaration
|
102
84
|
end
|
103
85
|
end
|
86
|
+
|
87
|
+
rule /#available\([^)]+\)/, Keyword::Declaration
|
104
88
|
|
105
89
|
rule /(let|var)\b(\s*)(#{id})/ do
|
106
90
|
groups Keyword, Text, Name::Variable
|
@@ -115,6 +99,7 @@ module Rouge
|
|
115
99
|
end
|
116
100
|
|
117
101
|
rule /as[?!]?/, Keyword
|
102
|
+
rule /try[!]?/, Keyword
|
118
103
|
|
119
104
|
rule /(#?(?!default)(?![[:upper:]])#{id})(\s*)(:)/ do
|
120
105
|
groups Name::Variable, Text, Punctuation
|
data/lib/rouge/lexers/vb.rb
CHANGED
data/lib/rouge/theme.rb
CHANGED
data/lib/rouge/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rouge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeanine Adkisson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Rouge aims to a be a simple, easy-to-extend drop-in replacement for pygments.
|
14
14
|
email:
|
@@ -71,6 +71,7 @@ files:
|
|
71
71
|
- lib/rouge/demos/php
|
72
72
|
- lib/rouge/demos/plaintext
|
73
73
|
- lib/rouge/demos/powershell
|
74
|
+
- lib/rouge/demos/praat
|
74
75
|
- lib/rouge/demos/prolog
|
75
76
|
- lib/rouge/demos/properties
|
76
77
|
- lib/rouge/demos/puppet
|
@@ -157,6 +158,7 @@ files:
|
|
157
158
|
- lib/rouge/lexers/php/builtins.rb
|
158
159
|
- lib/rouge/lexers/plain_text.rb
|
159
160
|
- lib/rouge/lexers/powershell.rb
|
161
|
+
- lib/rouge/lexers/praat.rb
|
160
162
|
- lib/rouge/lexers/prolog.rb
|
161
163
|
- lib/rouge/lexers/properties.rb
|
162
164
|
- lib/rouge/lexers/puppet.rb
|