rouge 3.6.0 → 3.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/rouge/demos/ada +26 -0
- data/lib/rouge/demos/armasm +12 -0
- data/lib/rouge/demos/batchfile +3 -0
- data/lib/rouge/demos/bbcbasic +6 -0
- data/lib/rouge/demos/cmhg +8 -0
- data/lib/rouge/demos/cuda +11 -0
- data/lib/rouge/demos/cython +6 -0
- data/lib/rouge/demos/epp +4 -0
- data/lib/rouge/demos/gdscript +18 -0
- data/lib/rouge/demos/hocon +8 -0
- data/lib/rouge/demos/mason +22 -0
- data/lib/rouge/demos/msgtrans +4 -0
- data/lib/rouge/demos/opentype_feature_file +6 -0
- data/lib/rouge/demos/plist +1 -132
- data/lib/rouge/demos/reasonml +12 -0
- data/lib/rouge/demos/sas +13 -0
- data/lib/rouge/formatters/html_line_table.rb +3 -1
- data/lib/rouge/formatters/tex.rb +14 -12
- data/lib/rouge/guessers/disambiguation.rb +12 -0
- data/lib/rouge/lexers/ada.rb +162 -0
- data/lib/rouge/lexers/armasm.rb +145 -0
- data/lib/rouge/lexers/batchfile.rb +164 -0
- data/lib/rouge/lexers/bbcbasic.rb +112 -0
- data/lib/rouge/lexers/cmhg.rb +34 -0
- data/lib/rouge/lexers/console.rb +1 -1
- data/lib/rouge/lexers/cpp.rb +4 -1
- data/lib/rouge/lexers/cuda.rb +35 -0
- data/lib/rouge/lexers/cython.rb +151 -0
- data/lib/rouge/lexers/epp.rb +51 -0
- data/lib/rouge/lexers/escape.rb +3 -0
- data/lib/rouge/lexers/gdscript.rb +171 -0
- data/lib/rouge/lexers/gherkin.rb +4 -2
- data/lib/rouge/lexers/graphql.rb +10 -3
- data/lib/rouge/lexers/handlebars.rb +14 -3
- data/lib/rouge/lexers/hocon.rb +86 -0
- data/lib/rouge/lexers/html.rb +2 -2
- data/lib/rouge/lexers/igorpro.rb +1 -1
- data/lib/rouge/lexers/json.rb +43 -5
- data/lib/rouge/lexers/julia.rb +1 -1
- data/lib/rouge/lexers/make.rb +39 -12
- data/lib/rouge/lexers/mason.rb +115 -0
- data/lib/rouge/lexers/msgtrans.rb +26 -0
- data/lib/rouge/lexers/ocaml.rb +12 -48
- data/lib/rouge/lexers/ocaml/common.rb +53 -0
- data/lib/rouge/lexers/opentype_feature_file.rb +113 -0
- data/lib/rouge/lexers/php.rb +31 -9
- data/lib/rouge/lexers/php/builtins.rb +181 -174
- data/lib/rouge/lexers/plain_text.rb +1 -1
- data/lib/rouge/lexers/puppet.rb +2 -2
- data/lib/rouge/lexers/r.rb +2 -3
- data/lib/rouge/lexers/reasonml.rb +65 -0
- data/lib/rouge/lexers/rust.rb +12 -9
- data/lib/rouge/lexers/sas.rb +563 -0
- data/lib/rouge/lexers/sed.rb +1 -1
- data/lib/rouge/lexers/smarty.rb +10 -10
- data/lib/rouge/tex_theme_renderer.rb +5 -1
- data/lib/rouge/themes/magritte.rb +3 -3
- data/lib/rouge/themes/thankful_eyes.rb +1 -1
- data/lib/rouge/themes/tulip.rb +1 -1
- data/lib/rouge/version.rb +1 -1
- data/rouge.gemspec +4 -3
- metadata +38 -5
data/lib/rouge/lexers/sed.rb
CHANGED
data/lib/rouge/lexers/smarty.rb
CHANGED
@@ -64,18 +64,18 @@ module Rouge
|
|
64
64
|
rule %r/#[a-zA-Z_]\w*#/, Name::Variable
|
65
65
|
rule %r/\$[a-zA-Z_]\w*(\.\w+)*/, Name::Variable
|
66
66
|
rule %r/(true|false|null)\b/, Keyword::Constant
|
67
|
-
|
68
|
-
|
67
|
+
rule %r/[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?/, Num
|
68
|
+
rule %r/"(\\.|.)*?"/, Str::Double
|
69
69
|
rule %r/'(\\.|.)*?'/, Str::Single
|
70
|
-
rule %r/([a-zA-Z_]\w*)/ do |m|
|
71
|
-
if self.class.builtins.include? m[0]
|
72
|
-
token Name::Builtin
|
73
|
-
else
|
74
|
-
token Name::Attribute
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
78
70
|
|
71
|
+
rule %r/([a-zA-Z_]\w*)/ do |m|
|
72
|
+
if self.class.builtins.include? m[0]
|
73
|
+
token Name::Builtin
|
74
|
+
else
|
75
|
+
token Name::Attribute
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
79
|
end
|
80
80
|
end
|
81
81
|
end
|
@@ -1,3 +1,6 @@
|
|
1
|
+
# -*- coding: utf-8 -*- #
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
1
4
|
module Rouge
|
2
5
|
class TexThemeRenderer
|
3
6
|
def initialize(theme, opts={})
|
@@ -110,7 +113,8 @@ END
|
|
110
113
|
end
|
111
114
|
|
112
115
|
def render_style(tok, style, &b)
|
113
|
-
out =
|
116
|
+
out = String.new('')
|
117
|
+
out << "\\expandafter\\def#{token_name(tok)}#1{"
|
114
118
|
out << "\\fboxsep=0pt\\colorbox{#{palette_name(style[:bg])}}{" if style[:bg]
|
115
119
|
out << '\\textbf{' if style[:bold]
|
116
120
|
out << '\\textit{' if style[:italic]
|
@@ -32,7 +32,7 @@ module Rouge
|
|
32
32
|
# style Generic::Prompt, :fg => :chilly, :bold => true
|
33
33
|
|
34
34
|
style Comment, :fg => :dragon, :italic => true
|
35
|
-
style Comment::Preproc, :fg => :chocolate, :bold => true
|
35
|
+
style Comment::Preproc, :fg => :chocolate, :bold => true
|
36
36
|
style Error, :fg => :eggshell, :bg => :cherry
|
37
37
|
style Generic::Error, :fg => :cherry, :italic => true, :bold => true
|
38
38
|
style Keyword, :fg => :royal, :bold => true
|
@@ -67,8 +67,8 @@ module Rouge
|
|
67
67
|
Literal::String::Interpol, :fg => :purple, :bold => true
|
68
68
|
style Name::Builtin, :bold => true
|
69
69
|
style Name::Entity, :fg => :darkgray, :bold => true
|
70
|
-
style Text::Whitespace,
|
71
|
-
|
70
|
+
style Text::Whitespace, :fg => :lightgray
|
71
|
+
style Generic::Output, :fg => :royal
|
72
72
|
style Name::Function,
|
73
73
|
Name::Property,
|
74
74
|
Name::Attribute, :fg => :candy
|
@@ -29,7 +29,7 @@ module Rouge
|
|
29
29
|
style Generic::Prompt, :fg => :chilly, :bold => true
|
30
30
|
|
31
31
|
style Comment, :fg => :cool_as_ice, :italic => true
|
32
|
-
style Comment::Preproc, :fg => :go_get_it, :bold => true
|
32
|
+
style Comment::Preproc, :fg => :go_get_it, :bold => true
|
33
33
|
style Error, :fg => :aluminum1, :bg => :scarletred2
|
34
34
|
style Generic::Error, :fg => :scarletred2, :italic => true, :bold => true
|
35
35
|
style Keyword, :fg => :sandy, :bold => true
|
data/lib/rouge/themes/tulip.rb
CHANGED
@@ -24,7 +24,7 @@ module Rouge
|
|
24
24
|
style Text, :fg => :white, :bg => :dark_purple
|
25
25
|
|
26
26
|
style Comment, :fg => :gray, :italic => true
|
27
|
-
style Comment::Preproc, :fg => :lgreen, :bold => true
|
27
|
+
style Comment::Preproc, :fg => :lgreen, :bold => true
|
28
28
|
style Error,
|
29
29
|
Generic::Error, :fg => :white, :bg => :red
|
30
30
|
style Keyword, :fg => :yellow, :bold => true
|
data/lib/rouge/version.rb
CHANGED
data/rouge.gemspec
CHANGED
@@ -13,13 +13,14 @@ Gem::Specification.new do |s|
|
|
13
13
|
for pygments.
|
14
14
|
desc
|
15
15
|
s.homepage = "http://rouge.jneen.net/"
|
16
|
-
s.rubyforge_project = "rouge"
|
17
16
|
s.files = Dir['Gemfile', 'LICENSE', 'rouge.gemspec', 'lib/**/*.rb', 'lib/**/*.yml', 'bin/rougify', 'lib/rouge/demos/*']
|
18
17
|
s.executables = %w(rougify)
|
19
18
|
s.licenses = ['MIT', 'BSD-2-Clause']
|
20
19
|
s.required_ruby_version = '>= 2.0'
|
21
20
|
s.metadata = {
|
22
|
-
|
23
|
-
|
21
|
+
"bug_tracker_uri" => "https://github.com/rouge-ruby/rouge/issues",
|
22
|
+
"changelog_uri" => "https://github.com/rouge-ruby/rouge/blob/master/CHANGELOG.md",
|
23
|
+
"documentation_uri" => "https://rouge-ruby.github.io/docs/",
|
24
|
+
"source_code_uri" => "https://github.com/rouge-ruby/rouge"
|
24
25
|
}
|
25
26
|
end
|
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: 3.
|
4
|
+
version: 3.8.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: 2019-
|
11
|
+
date: 2019-08-06 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:
|
@@ -25,10 +25,14 @@ files:
|
|
25
25
|
- lib/rouge/cli.rb
|
26
26
|
- lib/rouge/demos/abap
|
27
27
|
- lib/rouge/demos/actionscript
|
28
|
+
- lib/rouge/demos/ada
|
28
29
|
- lib/rouge/demos/apache
|
29
30
|
- lib/rouge/demos/apiblueprint
|
30
31
|
- lib/rouge/demos/applescript
|
32
|
+
- lib/rouge/demos/armasm
|
31
33
|
- lib/rouge/demos/awk
|
34
|
+
- lib/rouge/demos/batchfile
|
35
|
+
- lib/rouge/demos/bbcbasic
|
32
36
|
- lib/rouge/demos/biml
|
33
37
|
- lib/rouge/demos/bpf
|
34
38
|
- lib/rouge/demos/brainfuck
|
@@ -38,6 +42,7 @@ files:
|
|
38
42
|
- lib/rouge/demos/cfscript
|
39
43
|
- lib/rouge/demos/clojure
|
40
44
|
- lib/rouge/demos/cmake
|
45
|
+
- lib/rouge/demos/cmhg
|
41
46
|
- lib/rouge/demos/coffeescript
|
42
47
|
- lib/rouge/demos/common_lisp
|
43
48
|
- lib/rouge/demos/conf
|
@@ -47,6 +52,8 @@ files:
|
|
47
52
|
- lib/rouge/demos/crystal
|
48
53
|
- lib/rouge/demos/csharp
|
49
54
|
- lib/rouge/demos/css
|
55
|
+
- lib/rouge/demos/cuda
|
56
|
+
- lib/rouge/demos/cython
|
50
57
|
- lib/rouge/demos/d
|
51
58
|
- lib/rouge/demos/dart
|
52
59
|
- lib/rouge/demos/diff
|
@@ -56,12 +63,14 @@ files:
|
|
56
63
|
- lib/rouge/demos/eiffel
|
57
64
|
- lib/rouge/demos/elixir
|
58
65
|
- lib/rouge/demos/elm
|
66
|
+
- lib/rouge/demos/epp
|
59
67
|
- lib/rouge/demos/erb
|
60
68
|
- lib/rouge/demos/erlang
|
61
69
|
- lib/rouge/demos/escape
|
62
70
|
- lib/rouge/demos/factor
|
63
71
|
- lib/rouge/demos/fortran
|
64
72
|
- lib/rouge/demos/fsharp
|
73
|
+
- lib/rouge/demos/gdscript
|
65
74
|
- lib/rouge/demos/gherkin
|
66
75
|
- lib/rouge/demos/glsl
|
67
76
|
- lib/rouge/demos/go
|
@@ -73,6 +82,7 @@ files:
|
|
73
82
|
- lib/rouge/demos/handlebars
|
74
83
|
- lib/rouge/demos/haskell
|
75
84
|
- lib/rouge/demos/hcl
|
85
|
+
- lib/rouge/demos/hocon
|
76
86
|
- lib/rouge/demos/html
|
77
87
|
- lib/rouge/demos/http
|
78
88
|
- lib/rouge/demos/hylang
|
@@ -102,10 +112,12 @@ files:
|
|
102
112
|
- lib/rouge/demos/magik
|
103
113
|
- lib/rouge/demos/make
|
104
114
|
- lib/rouge/demos/markdown
|
115
|
+
- lib/rouge/demos/mason
|
105
116
|
- lib/rouge/demos/mathematica
|
106
117
|
- lib/rouge/demos/matlab
|
107
118
|
- lib/rouge/demos/moonscript
|
108
119
|
- lib/rouge/demos/mosel
|
120
|
+
- lib/rouge/demos/msgtrans
|
109
121
|
- lib/rouge/demos/mxml
|
110
122
|
- lib/rouge/demos/nasm
|
111
123
|
- lib/rouge/demos/nginx
|
@@ -114,6 +126,7 @@ files:
|
|
114
126
|
- lib/rouge/demos/objective_c
|
115
127
|
- lib/rouge/demos/ocaml
|
116
128
|
- lib/rouge/demos/openedge
|
129
|
+
- lib/rouge/demos/opentype_feature_file
|
117
130
|
- lib/rouge/demos/pascal
|
118
131
|
- lib/rouge/demos/perl
|
119
132
|
- lib/rouge/demos/php
|
@@ -132,8 +145,10 @@ files:
|
|
132
145
|
- lib/rouge/demos/qml
|
133
146
|
- lib/rouge/demos/r
|
134
147
|
- lib/rouge/demos/racket
|
148
|
+
- lib/rouge/demos/reasonml
|
135
149
|
- lib/rouge/demos/ruby
|
136
150
|
- lib/rouge/demos/rust
|
151
|
+
- lib/rouge/demos/sas
|
137
152
|
- lib/rouge/demos/sass
|
138
153
|
- lib/rouge/demos/scala
|
139
154
|
- lib/rouge/demos/scheme
|
@@ -193,11 +208,15 @@ files:
|
|
193
208
|
- lib/rouge/lexer.rb
|
194
209
|
- lib/rouge/lexers/abap.rb
|
195
210
|
- lib/rouge/lexers/actionscript.rb
|
211
|
+
- lib/rouge/lexers/ada.rb
|
196
212
|
- lib/rouge/lexers/apache.rb
|
197
213
|
- lib/rouge/lexers/apache/keywords.yml
|
198
214
|
- lib/rouge/lexers/apiblueprint.rb
|
199
215
|
- lib/rouge/lexers/apple_script.rb
|
216
|
+
- lib/rouge/lexers/armasm.rb
|
200
217
|
- lib/rouge/lexers/awk.rb
|
218
|
+
- lib/rouge/lexers/batchfile.rb
|
219
|
+
- lib/rouge/lexers/bbcbasic.rb
|
201
220
|
- lib/rouge/lexers/biml.rb
|
202
221
|
- lib/rouge/lexers/bpf.rb
|
203
222
|
- lib/rouge/lexers/brainfuck.rb
|
@@ -207,6 +226,7 @@ files:
|
|
207
226
|
- lib/rouge/lexers/cfscript.rb
|
208
227
|
- lib/rouge/lexers/clojure.rb
|
209
228
|
- lib/rouge/lexers/cmake.rb
|
229
|
+
- lib/rouge/lexers/cmhg.rb
|
210
230
|
- lib/rouge/lexers/coffeescript.rb
|
211
231
|
- lib/rouge/lexers/common_lisp.rb
|
212
232
|
- lib/rouge/lexers/conf.rb
|
@@ -216,6 +236,8 @@ files:
|
|
216
236
|
- lib/rouge/lexers/crystal.rb
|
217
237
|
- lib/rouge/lexers/csharp.rb
|
218
238
|
- lib/rouge/lexers/css.rb
|
239
|
+
- lib/rouge/lexers/cuda.rb
|
240
|
+
- lib/rouge/lexers/cython.rb
|
219
241
|
- lib/rouge/lexers/d.rb
|
220
242
|
- lib/rouge/lexers/dart.rb
|
221
243
|
- lib/rouge/lexers/diff.rb
|
@@ -225,12 +247,14 @@ files:
|
|
225
247
|
- lib/rouge/lexers/eiffel.rb
|
226
248
|
- lib/rouge/lexers/elixir.rb
|
227
249
|
- lib/rouge/lexers/elm.rb
|
250
|
+
- lib/rouge/lexers/epp.rb
|
228
251
|
- lib/rouge/lexers/erb.rb
|
229
252
|
- lib/rouge/lexers/erlang.rb
|
230
253
|
- lib/rouge/lexers/escape.rb
|
231
254
|
- lib/rouge/lexers/factor.rb
|
232
255
|
- lib/rouge/lexers/fortran.rb
|
233
256
|
- lib/rouge/lexers/fsharp.rb
|
257
|
+
- lib/rouge/lexers/gdscript.rb
|
234
258
|
- lib/rouge/lexers/gherkin.rb
|
235
259
|
- lib/rouge/lexers/gherkin/keywords.rb
|
236
260
|
- lib/rouge/lexers/glsl.rb
|
@@ -243,6 +267,7 @@ files:
|
|
243
267
|
- lib/rouge/lexers/handlebars.rb
|
244
268
|
- lib/rouge/lexers/haskell.rb
|
245
269
|
- lib/rouge/lexers/hcl.rb
|
270
|
+
- lib/rouge/lexers/hocon.rb
|
246
271
|
- lib/rouge/lexers/html.rb
|
247
272
|
- lib/rouge/lexers/http.rb
|
248
273
|
- lib/rouge/lexers/hylang.rb
|
@@ -273,12 +298,14 @@ files:
|
|
273
298
|
- lib/rouge/lexers/magik.rb
|
274
299
|
- lib/rouge/lexers/make.rb
|
275
300
|
- lib/rouge/lexers/markdown.rb
|
301
|
+
- lib/rouge/lexers/mason.rb
|
276
302
|
- lib/rouge/lexers/mathematica.rb
|
277
303
|
- lib/rouge/lexers/mathematica/builtins.rb
|
278
304
|
- lib/rouge/lexers/matlab.rb
|
279
305
|
- lib/rouge/lexers/matlab/builtins.rb
|
280
306
|
- lib/rouge/lexers/moonscript.rb
|
281
307
|
- lib/rouge/lexers/mosel.rb
|
308
|
+
- lib/rouge/lexers/msgtrans.rb
|
282
309
|
- lib/rouge/lexers/mxml.rb
|
283
310
|
- lib/rouge/lexers/nasm.rb
|
284
311
|
- lib/rouge/lexers/nginx.rb
|
@@ -286,7 +313,9 @@ files:
|
|
286
313
|
- lib/rouge/lexers/nix.rb
|
287
314
|
- lib/rouge/lexers/objective_c.rb
|
288
315
|
- lib/rouge/lexers/ocaml.rb
|
316
|
+
- lib/rouge/lexers/ocaml/common.rb
|
289
317
|
- lib/rouge/lexers/openedge.rb
|
318
|
+
- lib/rouge/lexers/opentype_feature_file.rb
|
290
319
|
- lib/rouge/lexers/pascal.rb
|
291
320
|
- lib/rouge/lexers/perl.rb
|
292
321
|
- lib/rouge/lexers/php.rb
|
@@ -306,8 +335,10 @@ files:
|
|
306
335
|
- lib/rouge/lexers/qml.rb
|
307
336
|
- lib/rouge/lexers/r.rb
|
308
337
|
- lib/rouge/lexers/racket.rb
|
338
|
+
- lib/rouge/lexers/reasonml.rb
|
309
339
|
- lib/rouge/lexers/ruby.rb
|
310
340
|
- lib/rouge/lexers/rust.rb
|
341
|
+
- lib/rouge/lexers/sas.rb
|
311
342
|
- lib/rouge/lexers/sass.rb
|
312
343
|
- lib/rouge/lexers/sass/common.rb
|
313
344
|
- lib/rouge/lexers/scala.rb
|
@@ -377,8 +408,10 @@ licenses:
|
|
377
408
|
- MIT
|
378
409
|
- BSD-2-Clause
|
379
410
|
metadata:
|
380
|
-
|
381
|
-
changelog_uri: https://github.com/
|
411
|
+
bug_tracker_uri: https://github.com/rouge-ruby/rouge/issues
|
412
|
+
changelog_uri: https://github.com/rouge-ruby/rouge/blob/master/CHANGELOG.md
|
413
|
+
documentation_uri: https://rouge-ruby.github.io/docs/
|
414
|
+
source_code_uri: https://github.com/rouge-ruby/rouge
|
382
415
|
post_install_message:
|
383
416
|
rdoc_options: []
|
384
417
|
require_paths:
|
@@ -394,7 +427,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
394
427
|
- !ruby/object:Gem::Version
|
395
428
|
version: '0'
|
396
429
|
requirements: []
|
397
|
-
rubygems_version: 3.0.
|
430
|
+
rubygems_version: 3.0.3
|
398
431
|
signing_key:
|
399
432
|
specification_version: 4
|
400
433
|
summary: A pure-ruby colorizer based on pygments
|