rouge 3.26.0 → 3.30.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +6 -1
- data/lib/rouge/cli.rb +23 -20
- data/lib/rouge/demos/brainfuck +1 -1
- data/lib/rouge/demos/brightscript +1 -1
- data/lib/rouge/demos/bsl +1 -1
- data/lib/rouge/demos/cfscript +1 -1
- data/lib/rouge/demos/coq +1 -1
- data/lib/rouge/demos/csvs +1 -1
- data/lib/rouge/demos/dafny +16 -0
- data/lib/rouge/demos/datastudio +0 -1
- data/lib/rouge/demos/ecl +0 -1
- data/lib/rouge/demos/erlang +1 -1
- data/lib/rouge/demos/fluent +13 -0
- data/lib/rouge/demos/fsharp +1 -1
- data/lib/rouge/demos/glsl +1 -1
- data/lib/rouge/demos/haxe +0 -1
- data/lib/rouge/demos/idris +13 -0
- data/lib/rouge/demos/isabelle +16 -0
- data/lib/rouge/demos/lean +8 -0
- data/lib/rouge/demos/meson +10 -0
- data/lib/rouge/demos/nesasm +1 -1
- data/lib/rouge/demos/nial +35 -0
- data/lib/rouge/demos/opentype_feature_file +0 -1
- data/lib/rouge/demos/plsql +2 -0
- data/lib/rouge/demos/smarty +0 -1
- data/lib/rouge/demos/stan +13 -0
- data/lib/rouge/demos/stata +14 -0
- data/lib/rouge/demos/syzlang +15 -0
- data/lib/rouge/demos/syzprog +8 -0
- data/lib/rouge/formatter.rb +2 -2
- data/lib/rouge/formatters/html_inline.rb +0 -1
- data/lib/rouge/guessers/disambiguation.rb +7 -0
- data/lib/rouge/lexer.rb +2 -2
- data/lib/rouge/lexers/apache/keywords.rb +1 -1
- data/lib/rouge/lexers/apple_script.rb +1 -1
- data/lib/rouge/lexers/c.rb +12 -2
- data/lib/rouge/lexers/ceylon.rb +2 -2
- data/lib/rouge/lexers/console.rb +1 -1
- data/lib/rouge/lexers/cpp.rb +8 -5
- data/lib/rouge/lexers/cypher.rb +8 -0
- data/lib/rouge/lexers/dafny.rb +128 -0
- data/lib/rouge/lexers/dart.rb +10 -9
- data/lib/rouge/lexers/docker.rb +4 -0
- data/lib/rouge/lexers/eex.rb +2 -2
- data/lib/rouge/lexers/eiffel.rb +0 -1
- data/lib/rouge/lexers/factor.rb +2 -2
- data/lib/rouge/lexers/fluent.rb +74 -0
- data/lib/rouge/lexers/ghc_core.rb +1 -1
- data/lib/rouge/lexers/gherkin/keywords.rb +1 -1
- data/lib/rouge/lexers/groovy.rb +1 -1
- data/lib/rouge/lexers/handlebars.rb +1 -1
- data/lib/rouge/lexers/hcl.rb +1 -0
- data/lib/rouge/lexers/hylang.rb +0 -1
- data/lib/rouge/lexers/idris.rb +210 -0
- data/lib/rouge/lexers/isabelle.rb +251 -0
- data/lib/rouge/lexers/javascript.rb +1 -1
- data/lib/rouge/lexers/jsl.rb +6 -7
- data/lib/rouge/lexers/jsx.rb +1 -2
- data/lib/rouge/lexers/kotlin.rb +3 -1
- data/lib/rouge/lexers/lasso/keywords.rb +1 -1
- data/lib/rouge/lexers/lean.rb +164 -0
- data/lib/rouge/lexers/llvm/keywords.rb +1 -1
- data/lib/rouge/lexers/lua/keywords.rb +1 -1
- data/lib/rouge/lexers/mathematica/keywords.rb +1 -1
- data/lib/rouge/lexers/matlab/keywords.rb +1 -1
- data/lib/rouge/lexers/matlab.rb +3 -2
- data/lib/rouge/lexers/meson.rb +159 -0
- data/lib/rouge/lexers/nial.rb +166 -0
- data/lib/rouge/lexers/ocl.rb +0 -1
- data/lib/rouge/lexers/pascal.rb +2 -1
- data/lib/rouge/lexers/php/keywords.rb +1 -1
- data/lib/rouge/lexers/php.rb +7 -5
- data/lib/rouge/lexers/plsql.rb +578 -0
- data/lib/rouge/lexers/prometheus.rb +0 -1
- data/lib/rouge/lexers/python.rb +3 -1
- data/lib/rouge/lexers/q.rb +0 -1
- data/lib/rouge/lexers/rust.rb +82 -19
- data/lib/rouge/lexers/sparql.rb +5 -4
- data/lib/rouge/lexers/sqf/keywords.rb +1 -1
- data/lib/rouge/lexers/sql.rb +7 -7
- data/lib/rouge/lexers/stan.rb +451 -0
- data/lib/rouge/lexers/stata.rb +165 -0
- data/lib/rouge/lexers/supercollider.rb +0 -1
- data/lib/rouge/lexers/swift.rb +3 -3
- data/lib/rouge/lexers/syzlang.rb +317 -0
- data/lib/rouge/lexers/syzprog.rb +122 -0
- data/lib/rouge/lexers/tap.rb +0 -1
- data/lib/rouge/lexers/toml.rb +16 -9
- data/lib/rouge/lexers/tsx.rb +0 -1
- data/lib/rouge/lexers/tulip.rb +0 -1
- data/lib/rouge/lexers/viml/keywords.rb +1 -1
- data/lib/rouge/lexers/yaml.rb +1 -1
- data/lib/rouge/version.rb +1 -1
- metadata +30 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acc37e14414bcaa3f67dda77f1b746f8035cfc972dc807610b4a1ef4fcffe848
|
4
|
+
data.tar.gz: 2380291e01345a7251f229dddf858d612f64d89f7ef93d7b75b2c44fa9a093a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4d60e1f37e66b4991b040ff82db8cc59983f37923a7f8b41a44a149407167467b443cd6ac8bb47f8800588e82301be1d58c14175bb1513a728952be21144ed8
|
7
|
+
data.tar.gz: 6f0e6ab3786ac315f0a2d658d02091bb3b8a0b6cd75ef3aac6dc2a116eee9dd5a45b1a4c9ef11f40f0f6338ae50d7c0f0b219e9ab20de950e4ae865f3824e002
|
data/Gemfile
CHANGED
@@ -8,9 +8,11 @@ gem 'rake'
|
|
8
8
|
|
9
9
|
gem 'minitest', '>= 5.0'
|
10
10
|
gem 'minitest-power_assert'
|
11
|
+
gem 'power_assert', '~> 1.2'
|
11
12
|
|
12
13
|
gem 'parallel', '~> 1.13.0' if RUBY_VERSION < '2.2.0'
|
13
|
-
gem 'rubocop', '~> 0.
|
14
|
+
gem 'rubocop', '~> 1.0', '<= 1.11'
|
15
|
+
gem 'rubocop-performance'
|
14
16
|
|
15
17
|
# don't try to install redcarpet under jruby
|
16
18
|
gem 'redcarpet', :platforms => :ruby
|
@@ -36,5 +38,8 @@ group :development do
|
|
36
38
|
else
|
37
39
|
gem 'sinatra'
|
38
40
|
end
|
41
|
+
|
42
|
+
# Ruby 3 no longer ships with a web server
|
43
|
+
gem 'puma' if RUBY_VERSION >= '3'
|
39
44
|
gem 'shotgun'
|
40
45
|
end
|
data/lib/rouge/cli.rb
CHANGED
@@ -174,35 +174,38 @@ module Rouge
|
|
174
174
|
yield %[usage: rougify highlight <filename> [options...]]
|
175
175
|
yield %[ rougify highlight [options...]]
|
176
176
|
yield %[]
|
177
|
-
yield %[--input-file|-i <filename>
|
177
|
+
yield %[--input-file|-i <filename> specify a file to read, or - to use stdin]
|
178
178
|
yield %[]
|
179
|
-
yield %[--lexer|-l <lexer>
|
180
|
-
yield %[
|
181
|
-
yield %[
|
182
|
-
yield %[
|
179
|
+
yield %[--lexer|-l <lexer> specify the lexer to use.]
|
180
|
+
yield %[ If not provided, rougify will try to guess]
|
181
|
+
yield %[ based on --mimetype, the filename, and the]
|
182
|
+
yield %[ file contents.]
|
183
183
|
yield %[]
|
184
|
-
yield %[--formatter|-f <opts>
|
185
|
-
yield %[
|
186
|
-
yield %[
|
184
|
+
yield %[--formatter-preset|-f <opts> specify the output formatter to use.]
|
185
|
+
yield %[ If not provided, rougify will default to]
|
186
|
+
yield %[ terminal256. options are: terminal256,]
|
187
|
+
yield %[ terminal-truecolor, html, html-pygments,]
|
188
|
+
yield %[ html-inline, html-line-table, html-table,]
|
189
|
+
yield %[ null/raw/tokens, or tex.]
|
187
190
|
yield %[]
|
188
|
-
yield %[--theme|-t <theme>
|
189
|
-
yield %[
|
191
|
+
yield %[--theme|-t <theme> specify the theme to use for highlighting]
|
192
|
+
yield %[ the file. (only applies to some formatters)]
|
190
193
|
yield %[]
|
191
|
-
yield %[--mimetype|-m <mimetype>
|
194
|
+
yield %[--mimetype|-m <mimetype> specify a mimetype for lexer guessing]
|
192
195
|
yield %[]
|
193
|
-
yield %[--lexer-opts|-L <opts>
|
194
|
-
yield %[
|
196
|
+
yield %[--lexer-opts|-L <opts> specify lexer options in CGI format]
|
197
|
+
yield %[ (opt1=val1&opt2=val2)]
|
195
198
|
yield %[]
|
196
|
-
yield %[--formatter-opts|-F <opts>
|
197
|
-
yield %[
|
199
|
+
yield %[--formatter-opts|-F <opts> specify formatter options in CGI format]
|
200
|
+
yield %[ (opt1=val1&opt2=val2)]
|
198
201
|
yield %[]
|
199
|
-
yield %[--require|-r <filename>
|
200
|
-
yield %[
|
202
|
+
yield %[--require|-r <filename> require a filename or library before]
|
203
|
+
yield %[ highlighting]
|
201
204
|
yield %[]
|
202
|
-
yield %[--escape
|
205
|
+
yield %[--escape allow the use of escapes between <! and !>]
|
203
206
|
yield %[]
|
204
|
-
yield %[--escape-with <l> <r>
|
205
|
-
yield %[
|
207
|
+
yield %[--escape-with <l> <r> allow the use of escapes between custom]
|
208
|
+
yield %[ delimiters. implies --escape]
|
206
209
|
end
|
207
210
|
|
208
211
|
# There is no consistent way to do this, but this is used elsewhere,
|
data/lib/rouge/demos/brainfuck
CHANGED
data/lib/rouge/demos/bsl
CHANGED
data/lib/rouge/demos/cfscript
CHANGED
data/lib/rouge/demos/coq
CHANGED
data/lib/rouge/demos/csvs
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
module A {
|
2
|
+
const i: int := 56_78
|
3
|
+
}
|
4
|
+
|
5
|
+
method m(b: bool, s: string) {
|
6
|
+
var x: string;
|
7
|
+
var i: int;
|
8
|
+
if b then i := 1; else i := 2;
|
9
|
+
i := if b 1 else 2;
|
10
|
+
assert b;
|
11
|
+
assume b;
|
12
|
+
print s;
|
13
|
+
expect b;
|
14
|
+
}
|
15
|
+
|
16
|
+
function f(i: int): int { i + 1 }
|
data/lib/rouge/demos/datastudio
CHANGED
data/lib/rouge/demos/ecl
CHANGED
data/lib/rouge/demos/erlang
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Simple things are simple.
|
2
|
+
hello-user = Hello, {$userName}!
|
3
|
+
|
4
|
+
# Complex things are possible.
|
5
|
+
shared-photos =
|
6
|
+
{$userName} {$photoCount ->
|
7
|
+
[one] added a new photo
|
8
|
+
*[other] added {$photoCount} new photos
|
9
|
+
} to {$userGender ->
|
10
|
+
[male] his stream
|
11
|
+
[female] her stream
|
12
|
+
*[other] their stream
|
13
|
+
}.
|
data/lib/rouge/demos/fsharp
CHANGED
data/lib/rouge/demos/glsl
CHANGED
data/lib/rouge/demos/haxe
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
import Data.Vect
|
2
|
+
|
3
|
+
insert : Ord elem =>
|
4
|
+
(x : elem) -> (xsSorted : Vect len elem) -> Vect (S len) elem
|
5
|
+
insert x [] = [x]
|
6
|
+
insert x (y :: xs) = case x < y of
|
7
|
+
True => x :: y :: xs
|
8
|
+
False => y :: insert x xs
|
9
|
+
|
10
|
+
insSort : Ord elem => Vect n elem -> Vect n elem
|
11
|
+
insSort [] = []
|
12
|
+
insSort (x :: xs) = let xsSorted = insSort xs in
|
13
|
+
insert x xsSorted
|
@@ -0,0 +1,16 @@
|
|
1
|
+
theory demo imports Main begin
|
2
|
+
|
3
|
+
section ‹Inductive predicates for lists›
|
4
|
+
|
5
|
+
datatype 'a list = Nil ("[]") | Cons 'a "'a list" ("_ # _")
|
6
|
+
|
7
|
+
fun length :: "'a list ⇒ nat" where
|
8
|
+
"length [] = 0" | "length (x # xs) = 1 + length xs"
|
9
|
+
|
10
|
+
inductive ζ :: "'a list ⇒ nat ⇒ bool" where
|
11
|
+
Nil[intro!]: "ζ [] 0" |
|
12
|
+
Cons[intro]: "ζ xs l ⟹ ζ (x # xs) (1 + l)"
|
13
|
+
|
14
|
+
(* Not the answer? *)
|
15
|
+
lemma "ζ xs 42"
|
16
|
+
oops
|
@@ -0,0 +1,10 @@
|
|
1
|
+
project('tutorial', 'c', version: '0.2.3')
|
2
|
+
executable('demo', 'main.c')
|
3
|
+
|
4
|
+
version_array = meson.project_version().split('.')
|
5
|
+
api_version = '@0@.@1@'.format(version_array[0], version_array[1])
|
6
|
+
|
7
|
+
d = dependency('foo', required : get_option('myfeature'))
|
8
|
+
if d.found()
|
9
|
+
app = executable('app', 'app.c', dependencies : [d])
|
10
|
+
endif
|
data/lib/rouge/demos/nesasm
CHANGED
@@ -0,0 +1,35 @@
|
|
1
|
+
% Functional Recursion: ;
|
2
|
+
fact IS RECUR [ 0 =, 1 first, pass, product, -1 +] % from wikipedia;
|
3
|
+
|
4
|
+
% Product of a range: ;
|
5
|
+
fact IS * count;
|
6
|
+
|
7
|
+
% Plain recursion: ;
|
8
|
+
fact IS OPERATION x {
|
9
|
+
if x = 0 then 1 else x * fact (x - 1) endif
|
10
|
+
};
|
11
|
+
|
12
|
+
% While loop: ;
|
13
|
+
fact IS OPERATION x {
|
14
|
+
prod := 1;
|
15
|
+
WHILE x > 0 DO
|
16
|
+
prod := prod * x;
|
17
|
+
x := x - 1;
|
18
|
+
ENDWHILE;
|
19
|
+
prod
|
20
|
+
}
|
21
|
+
|
22
|
+
% A basic divide by zero error: ;
|
23
|
+
1 / 0
|
24
|
+
# OUTPUT:
|
25
|
+
?div
|
26
|
+
|
27
|
+
% Errors are also values called faults, giving you their location: ;
|
28
|
+
5 / 5 10 0 8
|
29
|
+
# OUTPUT:
|
30
|
+
1. 0.5 ?div 0.625
|
31
|
+
|
32
|
+
% You can also define custom faults using 'fault': ;
|
33
|
+
fault 'this is an error'
|
34
|
+
# OUTPUT:
|
35
|
+
this is an error
|
data/lib/rouge/demos/smarty
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
* Run a series of linear regressions
|
2
|
+
sysuse auto, clear
|
3
|
+
foreach v of varlist mpg weight-turn {
|
4
|
+
regress price `v', robust
|
5
|
+
}
|
6
|
+
|
7
|
+
regress price i.foreign
|
8
|
+
local num_obs = e(N)
|
9
|
+
global myglobal = 4
|
10
|
+
|
11
|
+
* Generate and manipulate variables
|
12
|
+
generate newvar1 = "string"
|
13
|
+
generate newvar2 = 34 - `num_obs'
|
14
|
+
replace newvar2 = $myglobal
|
@@ -0,0 +1,15 @@
|
|
1
|
+
include <linux/test.h>
|
2
|
+
|
3
|
+
resource fd_test[fd]
|
4
|
+
|
5
|
+
openat$test(fd const[AT_FDCWD], file ptr[in, string["/dev/test"]], flags flags[open_flags], mode const[0]) fd_test
|
6
|
+
|
7
|
+
ioctl$TEST(fd fd_test, cmd const[TEST], arg ptr[in, test])
|
8
|
+
|
9
|
+
test {
|
10
|
+
number int32
|
11
|
+
size len[data, int32]
|
12
|
+
data array[int8]
|
13
|
+
}
|
14
|
+
|
15
|
+
_ = TEST
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Source: https://github.com/google/syzkaller/blob/master/sys/linux/test/vusb_hid
|
2
|
+
|
3
|
+
r0 = syz_usb_connect$hid(0x0, 0x36, &(0x7f0000000040)=ANY=[@ANYBLOB="12010000000018105e04da07000000000001090224000100000000090400000903000000092100000001222200090581030800000000"], 0x0)
|
4
|
+
syz_usb_control_io$hid(r0, 0x0, 0x0)
|
5
|
+
syz_usb_control_io$hid(r0, &(0x7f00000001c0)={0x24, 0x0, 0x0, &(0x7f0000000000)={0x0, 0x22, 0x22, {[@global=@item_012={0x2, 0x1, 0x9, "2313"}, @global=@item_012={0x2, 0x1, 0x0, "e53f"}, @global=@item_4={0x3, 0x1, 0x0, '\f\x00'}, @local=@item_012={0x2, 0x2, 0x2, "9000"}, @global=@item_4={0x3, 0x1, 0x0, "0900be00"}, @main=@item_4={0x3, 0x0, 0x8, '\x00'}, @local=@item_4={0x3, 0x2, 0x0, "09007a15"}, @local=@item_4={0x3, 0x2, 0x0, "5d8c3dda"}]}}, 0x0}, 0x0)
|
6
|
+
syz_usb_ep_write(r0, 0x81, 0x7, &(0x7f0000000000)='BBBBBBB')
|
7
|
+
syz_usb_ep_write(r0, 0x81, 0x7, &(0x7f0000000000)='BBBBBBB')
|
8
|
+
syz_usb_ep_write(r0, 0x81, 0x7, &(0x7f0000000000)='BBBBBBB')
|
data/lib/rouge/formatter.rb
CHANGED
@@ -42,8 +42,8 @@ module Rouge
|
|
42
42
|
end
|
43
43
|
|
44
44
|
# Format a token stream. Delegates to {#format}.
|
45
|
-
def self.format(tokens, *
|
46
|
-
new(*
|
45
|
+
def self.format(tokens, *args, **kwargs, &b)
|
46
|
+
new(*args, **kwargs).format(tokens, &b)
|
47
47
|
end
|
48
48
|
|
49
49
|
def initialize(opts={})
|
@@ -131,6 +131,13 @@ module Rouge
|
|
131
131
|
next TeX if matches?(/\A\s*(?:\\|%)/)
|
132
132
|
next Apex
|
133
133
|
end
|
134
|
+
|
135
|
+
disambiguate '*.pp' do
|
136
|
+
next Pascal if matches?(/\b(function|begin|var)\b/)
|
137
|
+
next Pascal if matches?(/\b(end(;|\.))/)
|
138
|
+
|
139
|
+
Puppet
|
140
|
+
end
|
134
141
|
end
|
135
142
|
end
|
136
143
|
end
|
data/lib/rouge/lexer.rb
CHANGED
@@ -293,8 +293,8 @@ module Rouge
|
|
293
293
|
|
294
294
|
# @private
|
295
295
|
def assert_utf8!(str)
|
296
|
-
encoding = str.encoding
|
297
|
-
return if encoding ==
|
296
|
+
encoding = str.encoding
|
297
|
+
return if encoding == Encoding::US_ASCII || encoding == Encoding::UTF_8 || encoding == Encoding::BINARY
|
298
298
|
|
299
299
|
raise EncodingError.new(
|
300
300
|
"Bad encoding: #{str.encoding.names.join(',')}. " +
|
@@ -5,7 +5,7 @@ module Rouge
|
|
5
5
|
module Lexers
|
6
6
|
class AppleScript < RegexLexer
|
7
7
|
title "AppleScript"
|
8
|
-
desc "The AppleScript scripting language by Apple Inc. (
|
8
|
+
desc "The AppleScript scripting language by Apple Inc. (https://developer.apple.com/library/archive/documentation/AppleScript/Conceptual/AppleScriptLangGuide/introduction/ASLR_intro.html)"
|
9
9
|
|
10
10
|
tag 'applescript'
|
11
11
|
aliases 'applescript'
|
data/lib/rouge/lexers/c.rb
CHANGED
@@ -170,12 +170,22 @@ module Rouge
|
|
170
170
|
end
|
171
171
|
|
172
172
|
state :macro do
|
173
|
-
|
174
|
-
rule %r/\n/, Comment::Preproc, :pop!
|
173
|
+
mixin :include
|
175
174
|
rule %r([^/\n\\]+), Comment::Preproc
|
176
175
|
rule %r/\\./m, Comment::Preproc
|
177
176
|
mixin :inline_whitespace
|
178
177
|
rule %r(/), Comment::Preproc
|
178
|
+
# NB: pop! goes back to :bol
|
179
|
+
rule %r/\n/, Comment::Preproc, :pop!
|
180
|
+
end
|
181
|
+
|
182
|
+
state :include do
|
183
|
+
rule %r/(include)(\s*)(<[^>]+>)([^\n]*)/ do
|
184
|
+
groups Comment::Preproc, Text, Comment::PreprocFile, Comment::Single
|
185
|
+
end
|
186
|
+
rule %r/(include)(\s*)("[^"]+")([^\n]*)/ do
|
187
|
+
groups Comment::Preproc, Text, Comment::PreprocFile, Comment::Single
|
188
|
+
end
|
179
189
|
end
|
180
190
|
|
181
191
|
state :if_0 do
|
data/lib/rouge/lexers/ceylon.rb
CHANGED
@@ -51,8 +51,8 @@ module Rouge
|
|
51
51
|
|
52
52
|
rule %r("(\\\\|\\"|[^"])*"), Literal::String
|
53
53
|
rule %r('\\.'|'[^\\]'|'\\\{#[0-9a-fA-F]{4}\}'), Literal::String::Char
|
54
|
-
rule %r("
|
55
|
-
rule %r(\.)([a-z_]\w*)) do
|
54
|
+
rule %r("[^`]*``[^`]*``[^`]*"), Literal::String::Interpol
|
55
|
+
rule %r((\.)([a-z_]\w*)) do
|
56
56
|
groups Operator, Name::Attribute
|
57
57
|
end
|
58
58
|
rule %r([a-zA-Z_]\w*:), Name::Label
|
data/lib/rouge/lexers/console.rb
CHANGED
data/lib/rouge/lexers/cpp.rb
CHANGED
@@ -22,12 +22,14 @@ module Rouge
|
|
22
22
|
|
23
23
|
def self.keywords
|
24
24
|
@keywords ||= super + Set.new(%w(
|
25
|
-
asm auto catch
|
25
|
+
asm auto catch char8_t concept
|
26
|
+
consteval constexpr constinit const_cast co_await co_return co_yield
|
27
|
+
delete dynamic_cast explicit export friend
|
26
28
|
mutable namespace new operator private protected public
|
27
|
-
reinterpret_cast restrict size_of static_cast this throw throws
|
29
|
+
reinterpret_cast requires restrict size_of static_cast this throw throws
|
28
30
|
typeid typename using virtual final override
|
29
31
|
|
30
|
-
alignas alignof
|
32
|
+
alignas alignof decltype noexcept static_assert
|
31
33
|
thread_local try
|
32
34
|
))
|
33
35
|
end
|
@@ -59,7 +61,7 @@ module Rouge
|
|
59
61
|
prepend :statements do
|
60
62
|
rule %r/(class|struct)\b/, Keyword, :classname
|
61
63
|
rule %r/template\b/, Keyword, :template
|
62
|
-
rule %r
|
64
|
+
rule %r/#{dq}(\.#{dq})?(?:y|d|h|(?:min)|s|(?:ms)|(?:us)|(?:ns)|i|(?:if)|(?:il))\b/, Num::Other
|
63
65
|
rule %r((#{dq}[.]#{dq}?|[.]#{dq})(e[+-]?#{dq}[lu]*)?)i, Num::Float
|
64
66
|
rule %r(#{dq}e[+-]?#{dq}[lu]*)i, Num::Float
|
65
67
|
rule %r/0x\h('?\h)*[lu]*/i, Num::Hex
|
@@ -68,7 +70,8 @@ module Rouge
|
|
68
70
|
rule %r/#{dq}[lu]*/i, Num::Integer
|
69
71
|
rule %r/\bnullptr\b/, Name::Builtin
|
70
72
|
rule %r/(?:u8|u|U|L)?R"([a-zA-Z0-9_{}\[\]#<>%:;.?*\+\-\/\^&|~!=,"']{,16})\(.*?\)\1"/m, Str
|
71
|
-
rule %r
|
73
|
+
rule %r/(::|<=>)/, Operator
|
74
|
+
rule %r/[{}]/, Punctuation
|
72
75
|
end
|
73
76
|
|
74
77
|
state :classname do
|
data/lib/rouge/lexers/cypher.rb
CHANGED
@@ -45,6 +45,7 @@ module Rouge
|
|
45
45
|
state :root do
|
46
46
|
rule %r/[\s]+/, Text
|
47
47
|
rule %r(//.*?$), Comment::Single
|
48
|
+
rule %r(/\*), Comment::Multiline, :multiline_comments
|
48
49
|
|
49
50
|
rule %r([*+\-<>=&|~%^]), Operator
|
50
51
|
rule %r/[{}),;\[\]]/, Str::Symbol
|
@@ -103,6 +104,13 @@ module Rouge
|
|
103
104
|
rule %r/'(\\\\|\\'|[^'])*'/, Str::Single
|
104
105
|
rule %r/`(\\\\|\\`|[^`])*`/, Str::Backtick
|
105
106
|
end
|
107
|
+
|
108
|
+
state :multiline_comments do
|
109
|
+
rule %r(/[*]), Comment::Multiline, :multiline_comments
|
110
|
+
rule %r([*]/), Comment::Multiline, :pop!
|
111
|
+
rule %r([^/*]+), Comment::Multiline
|
112
|
+
rule %r([/*]), Comment::Multiline
|
113
|
+
end
|
106
114
|
end
|
107
115
|
end
|
108
116
|
end
|