rouge 4.1.2 → 4.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rouge/lexers/hcl.rb +3 -2
- data/lib/rouge/lexers/irb.rb +7 -1
- data/lib/rouge/lexers/swift.rb +32 -16
- data/lib/rouge/lexers/terraform.rb +0 -8
- data/lib/rouge/lexers/typescript.rb +2 -2
- data/lib/rouge/lexers/xquery.rb +1 -1
- data/lib/rouge/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b018694487d82223169762c7e7231fdc62382011f8b6b82bb57bd7677d7ba0c0
|
4
|
+
data.tar.gz: 026d1ea6626c3df24491451ef54688af78123207d8d5147c6ac878da6605f029
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bc574ff5559d97bb347cdd2677abf1d2446ead33382a83ff7876876c6ad7bec715bd201debddf93cf2dac1ba004126d636a47958f372691c737174a37f9c7a9
|
7
|
+
data.tar.gz: 1404ac65d64ba46dc54843f32ec93f7dc9106b6175d6f070ac0c64fdb59d255916c402e6442b7b75402d29de67728be7df3a25dc8d588e7a4ef6445515e2ea89
|
data/lib/rouge/lexers/hcl.rb
CHANGED
@@ -56,7 +56,7 @@ module Rouge
|
|
56
56
|
@builtins ||= %w()
|
57
57
|
end
|
58
58
|
|
59
|
-
id = /[$a-z_][a-z0-9_]*/io
|
59
|
+
id = /[$a-z_\-][a-z0-9_\-]*/io
|
60
60
|
|
61
61
|
state :root do
|
62
62
|
mixin :comments_and_whitespace
|
@@ -114,6 +114,7 @@ module Rouge
|
|
114
114
|
state :hash do
|
115
115
|
mixin :comments_and_whitespace
|
116
116
|
|
117
|
+
rule %r/[.,()\\\/*]/, Punctuation
|
117
118
|
rule %r/\=/, Punctuation
|
118
119
|
rule %r/\}/, Punctuation, :pop!
|
119
120
|
|
@@ -123,7 +124,7 @@ module Rouge
|
|
123
124
|
state :array do
|
124
125
|
mixin :comments_and_whitespace
|
125
126
|
|
126
|
-
rule %r
|
127
|
+
rule %r/[.,()\\\/*]/, Punctuation
|
127
128
|
rule %r/\]/, Punctuation, :pop!
|
128
129
|
|
129
130
|
mixin :root
|
data/lib/rouge/lexers/irb.rb
CHANGED
data/lib/rouge/lexers/swift.rb
CHANGED
@@ -15,28 +15,29 @@ module Rouge
|
|
15
15
|
id = /#{id_head}#{id_rest}*/
|
16
16
|
|
17
17
|
keywords = Set.new %w(
|
18
|
-
await break case continue default do else fallthrough if in for return switch
|
18
|
+
autoreleasepool await break case catch consume continue default defer discard do each else fallthrough guard if in for repeat return switch throw try where while
|
19
19
|
|
20
|
-
as dynamicType is new super self Self Type
|
20
|
+
as dynamicType is new super self Self Type
|
21
21
|
|
22
|
-
associativity async didSet get infix inout isolated mutating none nonmutating operator override postfix precedence prefix set unowned weak willSet
|
23
|
-
|
24
|
-
#available #colorLiteral #column #else #elseif #endif #error #file #fileLiteral #function #if #imageLiteral #line #selector #sourceLocation #warning
|
22
|
+
associativity async didSet get infix inout isolated left mutating none nonmutating operator override postfix precedence precedencegroup prefix rethrows right set throws unowned weak willSet
|
25
23
|
)
|
26
24
|
|
27
25
|
declarations = Set.new %w(
|
28
|
-
actor class deinit enum convenience extension final func import init internal lazy let nonisolated optional private protocol public required static struct subscript typealias var
|
26
|
+
actor any associatedtype borrowing class consuming deinit distributed dynamic enum convenience extension fileprivate final func import indirect init internal lazy let macro nonisolated open optional package private protocol public required some static struct subscript typealias var
|
29
27
|
)
|
30
28
|
|
31
29
|
constants = Set.new %w(
|
32
30
|
true false nil
|
33
31
|
)
|
34
32
|
|
35
|
-
start
|
33
|
+
start do
|
34
|
+
push :bol
|
35
|
+
@re_delim = "" # multi-line regex delimiter
|
36
|
+
end
|
36
37
|
|
37
38
|
# beginning of line
|
38
39
|
state :bol do
|
39
|
-
rule %r
|
40
|
+
rule %r/#(?![#"\/]).*/, Comment::Preproc
|
40
41
|
|
41
42
|
mixin :inline_whitespace
|
42
43
|
|
@@ -69,8 +70,11 @@ module Rouge
|
|
69
70
|
mixin :whitespace
|
70
71
|
|
71
72
|
rule %r/\$(([1-9]\d*)?\d)/, Name::Variable
|
73
|
+
rule %r/\$#{id}/, Name
|
74
|
+
rule %r/~Copyable\b/, Keyword::Type
|
72
75
|
|
73
76
|
rule %r{[()\[\]{}:;,?\\]}, Punctuation
|
77
|
+
rule %r{(#*)/(?!\s).*(?<![\s\\])/\1}, Str::Regex
|
74
78
|
rule %r([-/=+*%<>!&|^.~]+), Operator
|
75
79
|
rule %r/@?"/, Str, :dq
|
76
80
|
rule %r/'(\\.|.)'/, Str::Char
|
@@ -82,6 +86,7 @@ module Rouge
|
|
82
86
|
rule %r{[\d]+(?:_\d+)*}, Num::Integer
|
83
87
|
|
84
88
|
rule %r/@#{id}/, Keyword::Declaration
|
89
|
+
rule %r/##{id}/, Keyword
|
85
90
|
|
86
91
|
rule %r/(private|internal)(\([ ]*)(\w+)([ ]*\))/ do |m|
|
87
92
|
if m[3] == 'set'
|
@@ -99,14 +104,6 @@ module Rouge
|
|
99
104
|
end
|
100
105
|
end
|
101
106
|
|
102
|
-
rule %r/#available\([^)]+\)/, Keyword::Declaration
|
103
|
-
|
104
|
-
rule %r/(#(?:selector|keyPath)\()([^)]+?(?:[(].*?[)])?)(\))/ do
|
105
|
-
groups Keyword::Declaration, Name::Function, Keyword::Declaration
|
106
|
-
end
|
107
|
-
|
108
|
-
rule %r/#(line|file|column|function|dsohandle)/, Keyword::Declaration
|
109
|
-
|
110
107
|
rule %r/(let|var)\b(\s*)(#{id})/ do
|
111
108
|
groups Keyword, Text, Name::Variable
|
112
109
|
end
|
@@ -148,6 +145,12 @@ module Rouge
|
|
148
145
|
rule %r/(`)(#{id})(`)/ do
|
149
146
|
groups Punctuation, Name::Variable, Punctuation
|
150
147
|
end
|
148
|
+
|
149
|
+
rule %r{(#+)/\n} do |m|
|
150
|
+
@re_delim = m[1]
|
151
|
+
token Str::Regex
|
152
|
+
push :re_multi
|
153
|
+
end
|
151
154
|
end
|
152
155
|
|
153
156
|
state :tuple do
|
@@ -181,6 +184,19 @@ module Rouge
|
|
181
184
|
rule %r/[)]/, Punctuation, :pop!
|
182
185
|
mixin :root
|
183
186
|
end
|
187
|
+
|
188
|
+
state :re_multi do
|
189
|
+
rule %r{^\s*/#+} do |m|
|
190
|
+
token Str::Regex
|
191
|
+
if m[0].end_with?("/#{@re_delim}")
|
192
|
+
@re_delim = ""
|
193
|
+
pop!
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
rule %r/#.*/, Comment::Single
|
198
|
+
rule %r/./m, Str::Regex
|
199
|
+
end
|
184
200
|
end
|
185
201
|
end
|
186
202
|
end
|
@@ -10,12 +10,12 @@ module Rouge
|
|
10
10
|
extend TypescriptCommon
|
11
11
|
|
12
12
|
title "TypeScript"
|
13
|
-
desc "TypeScript, a superset of JavaScript"
|
13
|
+
desc "TypeScript, a superset of JavaScript (https://www.typescriptlang.org/)"
|
14
14
|
|
15
15
|
tag 'typescript'
|
16
16
|
aliases 'ts'
|
17
17
|
|
18
|
-
filenames '*.ts', '*.d.ts'
|
18
|
+
filenames '*.ts', '*.d.ts', '*.cts', '*.mts'
|
19
19
|
|
20
20
|
mimetypes 'text/typescript'
|
21
21
|
end
|
data/lib/rouge/lexers/xquery.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: 4.1.
|
4
|
+
version: 4.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeanine Adkisson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-31 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:
|
@@ -543,7 +543,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
543
543
|
- !ruby/object:Gem::Version
|
544
544
|
version: '0'
|
545
545
|
requirements: []
|
546
|
-
rubygems_version: 3.4.
|
546
|
+
rubygems_version: 3.4.13
|
547
547
|
signing_key:
|
548
548
|
specification_version: 4
|
549
549
|
summary: A pure-ruby colorizer based on pygments
|