rouge 3.25.0 → 3.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rouge/demos/ocl +4 -0
- data/lib/rouge/demos/rescript +26 -0
- data/lib/rouge/lexers/cmake.rb +10 -0
- data/lib/rouge/lexers/crystal.rb +14 -9
- data/lib/rouge/lexers/jsl.rb +19 -7
- data/lib/rouge/lexers/ocaml/common.rb +1 -1
- data/lib/rouge/lexers/ocl.rb +85 -0
- data/lib/rouge/lexers/python.rb +1 -1
- data/lib/rouge/lexers/reasonml.rb +6 -5
- data/lib/rouge/lexers/rescript.rb +119 -0
- data/lib/rouge/lexers/rust.rb +1 -0
- data/lib/rouge/themes/base16.rb +1 -0
- data/lib/rouge/themes/bw.rb +1 -0
- data/lib/rouge/themes/colorful.rb +1 -0
- data/lib/rouge/themes/github.rb +1 -0
- data/lib/rouge/themes/gruvbox.rb +2 -0
- data/lib/rouge/themes/igor_pro.rb +1 -0
- data/lib/rouge/themes/magritte.rb +1 -0
- data/lib/rouge/themes/monokai.rb +1 -0
- data/lib/rouge/themes/pastie.rb +1 -0
- data/lib/rouge/themes/thankful_eyes.rb +1 -0
- data/lib/rouge/themes/tulip.rb +1 -0
- data/lib/rouge/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b4023b528780340984bedccbe7068091fe13e092ec69c43972849924928eaf0
|
4
|
+
data.tar.gz: 20d90c29a74768ad39ffd84202396ba17be6c67c4d91daef83c7aa11b8bf55a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ce0c09ee43cf473c4e86dcc74fa84c735cc045080a47fc46e31a40553e8e0e106069b1f8cc2c23bcf76f80a5ba9749717e47a8385e970456b035bdb9ea626aa
|
7
|
+
data.tar.gz: 1a54b8b602cc6bca9b1f04c9eebc5353962f6476866f04b48092ffde45511408c6fbfb096fe0b450aa55bf8922ccbb62dd61363e4d71ef198651f49a6a0dac95
|
data/lib/rouge/demos/ocl
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
module Person = {
|
2
|
+
type t = Teacher | Director | Student(string)
|
3
|
+
|
4
|
+
let greeting = person =>
|
5
|
+
switch person {
|
6
|
+
| Teacher => "Hey Professor!"
|
7
|
+
| Director => "Hello Director."
|
8
|
+
| Student("Richard") => "Still here Ricky?"
|
9
|
+
| Student(other) => "Hey, " ++ other ++ "."
|
10
|
+
}
|
11
|
+
}
|
12
|
+
|
13
|
+
module Button = {
|
14
|
+
@react.component
|
15
|
+
let make = (~count: int, ~onClick) => {
|
16
|
+
let times = switch count {
|
17
|
+
| 1 => "once"
|
18
|
+
| 2 => "twice"
|
19
|
+
| n => Belt.Int.toString(n) ++ " times"
|
20
|
+
}
|
21
|
+
|
22
|
+
let msg = "Click me " ++ times
|
23
|
+
|
24
|
+
<button onClick> {msg->React.string} </button>
|
25
|
+
}
|
26
|
+
}
|
data/lib/rouge/lexers/cmake.rb
CHANGED
@@ -22,6 +22,7 @@ module Rouge
|
|
22
22
|
}
|
23
23
|
|
24
24
|
BUILTIN_COMMANDS = Set.new %w[
|
25
|
+
add_compile_definitions
|
25
26
|
add_compile_options
|
26
27
|
add_custom_command
|
27
28
|
add_custom_target
|
@@ -29,6 +30,7 @@ module Rouge
|
|
29
30
|
add_dependencies
|
30
31
|
add_executable
|
31
32
|
add_library
|
33
|
+
add_link_options
|
32
34
|
add_subdirectory
|
33
35
|
add_test
|
34
36
|
aux_source_directory
|
@@ -36,7 +38,9 @@ module Rouge
|
|
36
38
|
build_command
|
37
39
|
build_name
|
38
40
|
cmake_host_system_information
|
41
|
+
cmake_language
|
39
42
|
cmake_minimum_required
|
43
|
+
cmake_parse_arguments
|
40
44
|
cmake_policy
|
41
45
|
configure_file
|
42
46
|
create_test_sourcelist
|
@@ -74,6 +78,7 @@ module Rouge
|
|
74
78
|
include
|
75
79
|
include_directories
|
76
80
|
include_external_msproject
|
81
|
+
include_guard
|
77
82
|
include_regular_expression
|
78
83
|
install
|
79
84
|
install_files
|
@@ -110,9 +115,14 @@ module Rouge
|
|
110
115
|
subdir_depends
|
111
116
|
subdirs
|
112
117
|
target_compile_definitions
|
118
|
+
target_compile_features
|
113
119
|
target_compile_options
|
114
120
|
target_include_directories
|
121
|
+
target_link_directories
|
115
122
|
target_link_libraries
|
123
|
+
target_link_options
|
124
|
+
target_precompile_headers
|
125
|
+
target_sources
|
116
126
|
try_compile
|
117
127
|
try_run
|
118
128
|
unset
|
data/lib/rouge/lexers/crystal.rb
CHANGED
@@ -25,8 +25,7 @@ module Rouge
|
|
25
25
|
)xi, Str::Symbol
|
26
26
|
|
27
27
|
# special symbols
|
28
|
-
rule %r(:(
|
29
|
-
Str::Symbol
|
28
|
+
rule %r(:(?:===|=?~|\[\][=?]?|\*\*=?|\/\/=?|[=^*/+-]=?|&[&*+-]?=?|\|\|?=?|![=~]?|%=?|<=>|<<?=?|>>?=?|\.\.\.?)), Str::Symbol
|
30
29
|
|
31
30
|
rule %r/:'(\\\\|\\'|[^'])*'/, Str::Symbol
|
32
31
|
rule %r/:"/, Str::Symbol, :simple_sym
|
@@ -36,7 +35,7 @@ module Rouge
|
|
36
35
|
# %-sigiled strings
|
37
36
|
# %(abc), %[abc], %<abc>, %.abc., %r.abc., etc
|
38
37
|
delimiter_map = { '{' => '}', '[' => ']', '(' => ')', '<' => '>' }
|
39
|
-
rule %r/%([rqswQWxiI])?([^\w\s])/ do |m|
|
38
|
+
rule %r/%([rqswQWxiI])?([^\w\s}])/ do |m|
|
40
39
|
open = Regexp.escape(m[2])
|
41
40
|
close = Regexp.escape(delimiter_map[m[2]] || m[2])
|
42
41
|
interp = /[rQWxI]/ === m[1]
|
@@ -79,9 +78,11 @@ module Rouge
|
|
79
78
|
state :strings do
|
80
79
|
mixin :symbols
|
81
80
|
rule %r/\b[a-z_]\w*?[?!]?:\s+/, Str::Symbol, :expr_start
|
82
|
-
rule %r/'(\\\\|\\'|[^'])*'/, Str::Single
|
83
81
|
rule %r/"/, Str::Double, :simple_string
|
84
82
|
rule %r/(?<!\.)`/, Str::Backtick, :simple_backtick
|
83
|
+
rule %r/(')(\\u[a-fA-F0-9]{4}|\\u\{[a-fA-F0-9]{1,6}\}|\\[abefnrtv])?(\\\\|\\'|[^'])*(')/ do
|
84
|
+
groups Str::Single, Str::Escape, Str::Single, Str::Single
|
85
|
+
end
|
85
86
|
end
|
86
87
|
|
87
88
|
state :regex_flags do
|
@@ -154,11 +155,13 @@ module Rouge
|
|
154
155
|
mixin :whitespace
|
155
156
|
rule %r/__END__/, Comment::Preproc, :end_part
|
156
157
|
|
157
|
-
rule %r/
|
158
|
+
rule %r/0o[0-7]+(?:_[0-7]+)*/, Num::Oct
|
158
159
|
rule %r/0x[0-9A-Fa-f]+(?:_[0-9A-Fa-f]+)*/, Num::Hex
|
159
160
|
rule %r/0b[01]+(?:_[01]+)*/, Num::Bin
|
160
|
-
rule %r/\d+\.\d+(e[\+\-]?\d+)
|
161
|
-
rule %r
|
161
|
+
rule %r/\d+\.\d+(e[\+\-]?\d+)?(_f32)?/i, Num::Float
|
162
|
+
rule %r/\d+(e[\+\-]?\d+)/i, Num::Float
|
163
|
+
rule %r/\d+_f32/i, Num::Float
|
164
|
+
rule %r/[\d]+(?:_\d+)*(_[iu]\d+)?/, Num::Integer
|
162
165
|
|
163
166
|
rule %r/@\[([^\]]+)\]/, Name::Decorator
|
164
167
|
|
@@ -183,7 +186,7 @@ module Rouge
|
|
183
186
|
groups Keyword, Text, Name::Namespace
|
184
187
|
end
|
185
188
|
|
186
|
-
rule %r/(def\b)(\s*)/ do
|
189
|
+
rule %r/(def|macro\b)(\s*)/ do
|
187
190
|
groups Keyword, Text
|
188
191
|
push :funcname
|
189
192
|
end
|
@@ -212,8 +215,9 @@ module Rouge
|
|
212
215
|
|
213
216
|
rule %r/[a-zA-Z_]\w*[?!]/, Name, :expr_start
|
214
217
|
rule %r/[a-zA-Z_]\w*/, Name, :method_call
|
215
|
-
rule %r
|
218
|
+
rule %r/\*\*|\/\/|>=|<=|<=>|<<?|>>?|=~|={3}|!~|&&?|\|\||\./,
|
216
219
|
Operator, :expr_start
|
220
|
+
rule %r/{%|%}/, Punctuation
|
217
221
|
rule %r/[-+\/*%=<>&!^|~]=?/, Operator, :expr_start
|
218
222
|
rule(/[?]/) { token Punctuation; push :ternary; push :expr_start }
|
219
223
|
rule %r<[\[({,:\\;/]>, Punctuation, :expr_start
|
@@ -346,6 +350,7 @@ module Rouge
|
|
346
350
|
mixin :string_intp
|
347
351
|
rule %r/\\([\\abefnrstv#"']|x[a-fA-F0-9]{1,2}|[0-7]{1,3})/,
|
348
352
|
Str::Escape
|
353
|
+
rule %r/\\u([a-fA-F0-9]{4}|\{[^}]+\})/, Str::Escape
|
349
354
|
rule %r/\\./, Str::Escape
|
350
355
|
end
|
351
356
|
|
data/lib/rouge/lexers/jsl.rb
CHANGED
@@ -14,22 +14,20 @@ module Rouge
|
|
14
14
|
rule %r/\s+/m, Text::Whitespace
|
15
15
|
|
16
16
|
rule %r(//.*?$), Comment::Single
|
17
|
-
rule %r
|
17
|
+
rule %r'/[*].*', Comment::Multiline, :comment
|
18
18
|
|
19
19
|
# messages
|
20
|
-
rule %r
|
21
|
-
groups Operator, Name::Function, Punctuation
|
22
|
-
end
|
20
|
+
rule %r/<</, Operator, :message
|
23
21
|
|
24
22
|
# covers built-in and custom functions
|
25
23
|
rule %r/([a-z_][\w\s'%.\\]*)(\()/i do |m|
|
26
24
|
groups Keyword, Punctuation
|
27
25
|
end
|
28
26
|
|
29
|
-
rule %r/\b[+-]?(?:[0-9]+(?:\.[0-9]+)?|\.[0-9]+|\.)(?:e[+-]?[0-9]+)?i?\b/i, Num
|
30
|
-
|
31
27
|
rule %r/\d{2}(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d{2}(\d{2})?(:\d{2}:\d{2}(:\d{2}(\.\d*)?)?)?/i, Literal::Date
|
32
28
|
|
29
|
+
rule %r/-?(?:[0-9]+(?:[.][0-9]+)?|[.][0-9]*)(?:e[+-]?[0-9]+)?i?/i, Num
|
30
|
+
|
33
31
|
rule %r/::[a-z_][\w\s'%.\\]*/i, Name::Variable
|
34
32
|
rule %r/:\w+/, Name
|
35
33
|
rule %r/[a-z_][\w\s'%.\\]*/i, Name::Variable
|
@@ -40,16 +38,30 @@ module Rouge
|
|
40
38
|
end
|
41
39
|
rule %r/"/, Str::Double, :dq
|
42
40
|
|
43
|
-
rule %r/[
|
41
|
+
rule %r/[-+*\/!%&<>\|=:`^]/, Operator
|
44
42
|
rule %r/[\[\](){},;]/, Punctuation
|
45
43
|
end
|
46
44
|
|
45
|
+
state :message do
|
46
|
+
rule %r/\s+/m, Text::Whitespace
|
47
|
+
rule %r/[a-z_][\w\s'%.\\]*/i, Name::Function
|
48
|
+
rule %r/[(),;]/, Punctuation, :pop!
|
49
|
+
rule %r/[&|!=<>]/, Operator, :pop!
|
50
|
+
end
|
51
|
+
|
47
52
|
state :dq do
|
48
53
|
rule %r/\\![btrnNf0\\"]/, Str::Escape
|
49
54
|
rule %r/\\/, Str::Double
|
50
55
|
rule %r/"/, Str::Double, :pop!
|
51
56
|
rule %r/[^\\"]+/m, Str::Double
|
52
57
|
end
|
58
|
+
|
59
|
+
state :comment do
|
60
|
+
rule %r'/[*]', Comment::Multiline, :comment
|
61
|
+
rule %r'[*]/', Comment::Multiline, :pop!
|
62
|
+
rule %r'[^/*]+', Comment::Multiline
|
63
|
+
rule %r'[/*]', Comment::Multiline
|
64
|
+
end
|
53
65
|
end
|
54
66
|
end
|
55
67
|
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
module Rouge
|
2
|
+
module Lexers
|
3
|
+
class OCL < RegexLexer
|
4
|
+
title "OCL"
|
5
|
+
desc "OMG Object Constraint Language (omg.org/spec/OCL)"
|
6
|
+
tag 'ocl'
|
7
|
+
aliases 'OCL'
|
8
|
+
filenames '*.ocl'
|
9
|
+
mimetypes 'text/x-ocl'
|
10
|
+
|
11
|
+
def self.keywords
|
12
|
+
@keywords ||= Set.new %w(
|
13
|
+
context pre post inv init body def derive if then else endif import
|
14
|
+
package endpackage let in
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.keywords_type
|
19
|
+
@keywords_type ||= Set.new %w(
|
20
|
+
Boolean Integer UnlimitedNatural Real String OrderedSet Tuple Bag Set
|
21
|
+
Sequence OclInvalid OclVoid TupleType OclState Collection OclMessage
|
22
|
+
)
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.builtins
|
26
|
+
@builtins ||= Set.new %w(
|
27
|
+
self null result true false invalid @pre
|
28
|
+
)
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.operators
|
32
|
+
@operators ||= Set.new %w(
|
33
|
+
or xor and not implies
|
34
|
+
)
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.functions
|
38
|
+
@functions ||= Set.new %w(
|
39
|
+
oclAsSet oclIsNew oclIsUndefined oclIsInvalid oclAsType oclIsTypeOf
|
40
|
+
oclIsKindOf oclInState oclType oclLocale hasReturned result
|
41
|
+
isSignalSent isOperationCallabs floor round max min toString div mod
|
42
|
+
size substring concat toInteger toReal toUpperCase toLowerCase
|
43
|
+
indexOf equalsIgnoreCase at characters toBoolean includes excludes
|
44
|
+
count includesAll excludesAll isEmpty notEmpty sum product
|
45
|
+
selectByKind selectByType asBag asSequence asOrderedSet asSet flatten
|
46
|
+
union intersection including excluding symmetricDifferencecount
|
47
|
+
append prepend insertAt subOrderedSet first last reverse subSequence
|
48
|
+
any closure collect collectNested exists forAll isUnique iterate one
|
49
|
+
reject select sortedBy allInstances average conformsTo
|
50
|
+
)
|
51
|
+
end
|
52
|
+
|
53
|
+
state :single_string do
|
54
|
+
rule %r/\\./, Str::Escape
|
55
|
+
rule %r/'/, Str::Single, :pop!
|
56
|
+
rule %r/[^\\']+/, Str::Single
|
57
|
+
end
|
58
|
+
|
59
|
+
state :root do
|
60
|
+
rule %r/\s+/m, Text
|
61
|
+
rule %r/--.*/, Comment::Single
|
62
|
+
rule %r/\d+/, Num::Integer
|
63
|
+
rule %r/'/, Str::Single, :single_string
|
64
|
+
rule %r([->|+*/<>=~!@#%&|?^-]), Operator
|
65
|
+
rule %r/[;:()\[\],.]/, Punctuation
|
66
|
+
rule %r/\w[\w\d]*/ do |m|
|
67
|
+
if self.class.operators.include? m[0]
|
68
|
+
token Operator
|
69
|
+
elsif self.class.keywords_type.include? m[0]
|
70
|
+
token Keyword::Declaration
|
71
|
+
elsif self.class.keywords.include? m[0]
|
72
|
+
token Keyword
|
73
|
+
elsif self.class.builtins.include? m[0]
|
74
|
+
token Name::Builtin
|
75
|
+
elsif self.class.functions.include? m[0]
|
76
|
+
token Name::Function
|
77
|
+
else
|
78
|
+
token Name
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
data/lib/rouge/lexers/python.rb
CHANGED
@@ -115,7 +115,7 @@ module Rouge
|
|
115
115
|
# TODO: not in python 3
|
116
116
|
rule %r/`.*?`/, Str::Backtick
|
117
117
|
rule %r/([rfbu]{0,2})('''|"""|['"])/i do |m|
|
118
|
-
|
118
|
+
groups Str::Affix, Str
|
119
119
|
current_string.register type: m[1].downcase, delim: m[2]
|
120
120
|
push :generic_string
|
121
121
|
end
|
@@ -24,7 +24,8 @@ module Rouge
|
|
24
24
|
rule %r/#{@@upper_id}(?=\s*[.])/, Name::Namespace, :dotted
|
25
25
|
rule %r/`#{@@id}/, Name::Tag
|
26
26
|
rule @@upper_id, Name::Class
|
27
|
-
rule %r
|
27
|
+
rule %r(//.*), Comment::Single
|
28
|
+
rule %r(/\*), Comment::Multiline, :comment
|
28
29
|
rule @@id do |m|
|
29
30
|
match = m[0]
|
30
31
|
if self.class.keywords.include? match
|
@@ -55,10 +56,10 @@ module Rouge
|
|
55
56
|
end
|
56
57
|
|
57
58
|
state :comment do
|
58
|
-
rule %r
|
59
|
-
rule %r
|
60
|
-
rule %r
|
61
|
-
rule %r
|
59
|
+
rule %r([^/*]+), Comment::Multiline
|
60
|
+
rule %r(/\*), Comment::Multiline, :comment
|
61
|
+
rule %r(\*/), Comment::Multiline, :pop!
|
62
|
+
rule %r([*/]), Comment::Multiline
|
62
63
|
end
|
63
64
|
end
|
64
65
|
end
|
@@ -0,0 +1,119 @@
|
|
1
|
+
# -*- coding: utf-8 -*- #
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Rouge
|
5
|
+
module Lexers
|
6
|
+
load_lexer 'ocaml/common.rb'
|
7
|
+
|
8
|
+
class ReScript < OCamlCommon
|
9
|
+
title "ReScript"
|
10
|
+
desc "The ReScript programming language (rescript-lang.org)"
|
11
|
+
tag 'rescript'
|
12
|
+
filenames '*.res', '*.resi'
|
13
|
+
mimetypes 'text/x-rescript'
|
14
|
+
|
15
|
+
def self.keywords
|
16
|
+
@keywords ||= Set.new(%w(
|
17
|
+
open let rec and as exception assert lazy if else
|
18
|
+
for in to downto while switch when external type private
|
19
|
+
mutable constraint include module of with try import export
|
20
|
+
))
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.types
|
24
|
+
@types ||= Set.new(%w(
|
25
|
+
bool int float char string
|
26
|
+
unit list array option ref exn format
|
27
|
+
))
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.word_operators
|
31
|
+
@word_operators ||= Set.new(%w(mod land lor lxor lsl lsr asr or))
|
32
|
+
end
|
33
|
+
|
34
|
+
state :root do
|
35
|
+
rule %r/\s+/m, Text
|
36
|
+
rule %r([,.:?~\\]), Text
|
37
|
+
|
38
|
+
# Boolean Literal
|
39
|
+
rule %r/\btrue|false\b/, Keyword::Constant
|
40
|
+
|
41
|
+
# Module chain
|
42
|
+
rule %r/#{@@upper_id}(?=\s*[.])/, Name::Namespace, :dotted
|
43
|
+
|
44
|
+
# Decorator
|
45
|
+
rule %r/@#{@@id}(\.#{@@id})*/, Name::Decorator
|
46
|
+
|
47
|
+
# Poly variant
|
48
|
+
rule %r/\##{@@id}/, Name::Class
|
49
|
+
|
50
|
+
# Variant or Module
|
51
|
+
rule @@upper_id, Name::Class
|
52
|
+
|
53
|
+
# Comments
|
54
|
+
rule %r(//.*), Comment::Single
|
55
|
+
rule %r(/\*), Comment::Multiline, :comment
|
56
|
+
|
57
|
+
# Keywords and identifiers
|
58
|
+
rule @@id do |m|
|
59
|
+
match = m[0]
|
60
|
+
if self.class.keywords.include? match
|
61
|
+
token Keyword
|
62
|
+
elsif self.class.word_operators.include? match
|
63
|
+
token Operator::Word
|
64
|
+
elsif self.class.types.include? match
|
65
|
+
token Keyword::Type
|
66
|
+
else
|
67
|
+
token Name
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
# Braces
|
72
|
+
rule %r/[(){}\[\];]+/, Punctuation
|
73
|
+
|
74
|
+
# Operators
|
75
|
+
rule %r([;_!$%&*+/<=>@^|-]+), Operator
|
76
|
+
|
77
|
+
# Numbers
|
78
|
+
rule %r/-?\d[\d_]*(.[\d_]*)?(e[+-]?\d[\d_]*)/i, Num::Float
|
79
|
+
rule %r/0x\h[\h_]*/i, Num::Hex
|
80
|
+
rule %r/0o[0-7][0-7_]*/i, Num::Oct
|
81
|
+
rule %r/0b[01][01_]*/i, Num::Bin
|
82
|
+
rule %r/\d[\d_]*/, Num::Integer
|
83
|
+
|
84
|
+
# String and Char
|
85
|
+
rule %r/'(?:(\\[\\"'ntbr ])|(\\[0-9]{3})|(\\x\h{2}))'/, Str::Char
|
86
|
+
rule %r/'[^'\/]'/, Str::Char
|
87
|
+
rule %r/'/, Keyword
|
88
|
+
rule %r/"/, Str::Double, :string
|
89
|
+
|
90
|
+
# Interpolated string
|
91
|
+
rule %r/`/ do
|
92
|
+
token Str::Double
|
93
|
+
push :interpolated_string
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
state :comment do
|
98
|
+
rule %r([^/\*]+), Comment::Multiline
|
99
|
+
rule %r(/\*), Comment::Multiline, :comment
|
100
|
+
rule %r(\*/), Comment::Multiline, :pop!
|
101
|
+
rule %r([*/]), Comment::Multiline
|
102
|
+
end
|
103
|
+
|
104
|
+
state :interpolated_string do
|
105
|
+
rule %r/[$]{/, Punctuation, :interpolated_expression
|
106
|
+
rule %r/`/, Str::Double, :pop!
|
107
|
+
rule %r/\\[$`]/, Str::Escape
|
108
|
+
rule %r/[^$`\\]+/, Str::Double
|
109
|
+
rule %r/[\\$]/, Str::Double
|
110
|
+
end
|
111
|
+
|
112
|
+
state :interpolated_expression do
|
113
|
+
rule %r/}/, Punctuation, :pop!
|
114
|
+
mixin :root
|
115
|
+
end
|
116
|
+
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
data/lib/rouge/lexers/rust.rb
CHANGED
data/lib/rouge/themes/base16.rb
CHANGED
data/lib/rouge/themes/bw.rb
CHANGED
@@ -37,6 +37,7 @@ module Rouge
|
|
37
37
|
style Name::Decorator, :fg => "#555", :bold => true
|
38
38
|
|
39
39
|
style Literal::String, :bg => "#fff0f0"
|
40
|
+
style Literal::String::Affix, :fg => "#080", :bold => true
|
40
41
|
style Literal::String::Char, :fg => "#04D"
|
41
42
|
style Literal::String::Doc, :fg => "#D42"
|
42
43
|
style Literal::String::Interpol, :bg => "#eee"
|
data/lib/rouge/themes/github.rb
CHANGED
@@ -35,6 +35,7 @@ module Rouge
|
|
35
35
|
style Literal::Number::Integer, :fg => '#009999'
|
36
36
|
style Literal::Number::Oct, :fg => '#009999'
|
37
37
|
style Literal::Number, :fg => '#009999'
|
38
|
+
style Literal::String::Affix, :fg => '#000000', :bold => true
|
38
39
|
style Literal::String::Backtick, :fg => '#d14'
|
39
40
|
style Literal::String::Char, :fg => '#d14'
|
40
41
|
style Literal::String::Doc, :fg => '#d14'
|
data/lib/rouge/themes/gruvbox.rb
CHANGED
@@ -62,6 +62,7 @@ module Rouge
|
|
62
62
|
Literal::Date, :fg => :forest, :bold => true
|
63
63
|
style Literal::String::Symbol, :fg => :forest
|
64
64
|
style Literal::String, :fg => :wine, :bold => true
|
65
|
+
style Literal::String::Affix, :fg => :royal, :bold => true
|
65
66
|
style Literal::String::Escape,
|
66
67
|
Literal::String::Char,
|
67
68
|
Literal::String::Interpol, :fg => :purple, :bold => true
|
data/lib/rouge/themes/monokai.rb
CHANGED
data/lib/rouge/themes/pastie.rb
CHANGED
@@ -36,6 +36,7 @@ module Rouge
|
|
36
36
|
style Num, :fg => '#0000dd', :bold => true
|
37
37
|
|
38
38
|
style Str, :fg => '#dd2200', :bg => '#fff0f0'
|
39
|
+
style Str::Affix, :fg => '#008800', :bold => true
|
39
40
|
style Str::Escape, :fg => '#0044dd', :bg => '#fff0f0'
|
40
41
|
style Str::Interpol, :fg => '#3333bb', :bg => '#fff0f0'
|
41
42
|
style Str::Other, :fg => '#22bb22', :bg => '#f0fff0'
|
@@ -59,6 +59,7 @@ module Rouge
|
|
59
59
|
Literal::Date,
|
60
60
|
Literal::String::Symbol, :fg => :pink_merengue, :bold => true
|
61
61
|
style Literal::String, :fg => :dune, :bold => true
|
62
|
+
style Literal::String::Affix, :fg => :sandy, :bold => true
|
62
63
|
style Literal::String::Escape,
|
63
64
|
Literal::String::Char,
|
64
65
|
Literal::String::Interpol, :fg => :backlit, :bold => true
|
data/lib/rouge/themes/tulip.rb
CHANGED
@@ -55,6 +55,7 @@ module Rouge
|
|
55
55
|
Literal::Date,
|
56
56
|
Literal::String::Symbol, :fg => :lpurple, :bold => true
|
57
57
|
style Literal::String, :fg => :dune, :bold => true
|
58
|
+
style Literal::String::Affix, :fg => :yellow, :bold => true
|
58
59
|
style Literal::String::Escape,
|
59
60
|
Literal::String::Char,
|
60
61
|
Literal::String::Interpol, :fg => :orange, :bold => true
|
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: 3.
|
4
|
+
version: 3.26.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: 2020-
|
11
|
+
date: 2020-12-08 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:
|
@@ -152,6 +152,7 @@ files:
|
|
152
152
|
- lib/rouge/demos/objective_c
|
153
153
|
- lib/rouge/demos/objective_cpp
|
154
154
|
- lib/rouge/demos/ocaml
|
155
|
+
- lib/rouge/demos/ocl
|
155
156
|
- lib/rouge/demos/openedge
|
156
157
|
- lib/rouge/demos/opentype_feature_file
|
157
158
|
- lib/rouge/demos/pascal
|
@@ -175,6 +176,7 @@ files:
|
|
175
176
|
- lib/rouge/demos/racket
|
176
177
|
- lib/rouge/demos/reasonml
|
177
178
|
- lib/rouge/demos/rego
|
179
|
+
- lib/rouge/demos/rescript
|
178
180
|
- lib/rouge/demos/robot_framework
|
179
181
|
- lib/rouge/demos/ruby
|
180
182
|
- lib/rouge/demos/rust
|
@@ -387,6 +389,7 @@ files:
|
|
387
389
|
- lib/rouge/lexers/objective_cpp.rb
|
388
390
|
- lib/rouge/lexers/ocaml.rb
|
389
391
|
- lib/rouge/lexers/ocaml/common.rb
|
392
|
+
- lib/rouge/lexers/ocl.rb
|
390
393
|
- lib/rouge/lexers/openedge.rb
|
391
394
|
- lib/rouge/lexers/opentype_feature_file.rb
|
392
395
|
- lib/rouge/lexers/pascal.rb
|
@@ -411,6 +414,7 @@ files:
|
|
411
414
|
- lib/rouge/lexers/racket.rb
|
412
415
|
- lib/rouge/lexers/reasonml.rb
|
413
416
|
- lib/rouge/lexers/rego.rb
|
417
|
+
- lib/rouge/lexers/rescript.rb
|
414
418
|
- lib/rouge/lexers/robot_framework.rb
|
415
419
|
- lib/rouge/lexers/ruby.rb
|
416
420
|
- lib/rouge/lexers/rust.rb
|