rouge 3.9.0 → 3.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/demos/clean +6 -0
- data/lib/rouge/demos/jsl +3 -0
- data/lib/rouge/demos/lustre +6 -0
- data/lib/rouge/demos/lutin +18 -0
- data/lib/rouge/demos/sparql +6 -0
- data/lib/rouge/lexers/clean.rb +156 -0
- data/lib/rouge/lexers/common_lisp.rb +1 -1
- data/lib/rouge/lexers/http.rb +1 -1
- data/lib/rouge/lexers/jsl.rb +55 -0
- data/lib/rouge/lexers/lustre.rb +79 -0
- data/lib/rouge/lexers/lutin.rb +33 -0
- data/lib/rouge/lexers/sparql.rb +129 -0
- data/lib/rouge/version.rb +1 -1
- metadata +12 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fb254c48c7225eb55006a7e1fb0cd713afa34faf35d4f4c92bec44c663a7a49
|
4
|
+
data.tar.gz: 0d5193efc0336f18a8012f09135deb4eb988051367b78928c5b7bc61f3f0b49c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41128ed9650fe8aa804d9c93c44ebaf8f93131ee156ed1b57acfd1b790f435cf9f7f2233fd7ca3701b206b7131d979a2517abbf87da6c01ca931ec8d7ac4c04b
|
7
|
+
data.tar.gz: 255518b66c766562b22005ade1eebc7bf092e3b29b1f5fe298b0497801a86de2e350e726b57ac52380d58e9aa28bfb84cff2f917759053548704bd2bb4bf4b8c
|
data/lib/rouge/demos/jsl
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
node gen_x_v1() returns (x:real) = loop 0.0<x and x<42.0
|
2
|
+
|
3
|
+
node gen_x_v2() returns (x:real) =
|
4
|
+
loop { 0.0<x and x<42.0 fby loop [20] x = pre x }
|
5
|
+
|
6
|
+
node gen_x_v3() returns (target:real; x:real=0.0) =
|
7
|
+
run target := gen_x_v2() in
|
8
|
+
loop { x = (pre x + target) / 2.0 }
|
9
|
+
|
10
|
+
let inertia=0.6
|
11
|
+
|
12
|
+
node gen_x_v4() returns (target:real; x:real=0.0) =
|
13
|
+
run target := gen_x_v2() in
|
14
|
+
exist px,ppx : real = 0.0 in
|
15
|
+
loop {
|
16
|
+
px = pre x and ppx = pre px and
|
17
|
+
x = (px+target) / 2.0+inertia*(px-ppx)
|
18
|
+
}
|
@@ -0,0 +1,156 @@
|
|
1
|
+
# -*- coding: utf-8 -*- #
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Rouge
|
5
|
+
module Lexers
|
6
|
+
class Clean < RegexLexer
|
7
|
+
title "Clean"
|
8
|
+
desc "The Clean programming language (clean.cs.ru.nl)"
|
9
|
+
|
10
|
+
tag 'clean'
|
11
|
+
filenames '*.dcl', '*.icl'
|
12
|
+
|
13
|
+
def self.keywords
|
14
|
+
@keywords ||= Set.new %w(
|
15
|
+
if otherwise
|
16
|
+
let in
|
17
|
+
with where
|
18
|
+
case of
|
19
|
+
infix infixl infixr
|
20
|
+
class instance
|
21
|
+
generic derive
|
22
|
+
special
|
23
|
+
implementation definition system module
|
24
|
+
from import qualified as
|
25
|
+
dynamic
|
26
|
+
code inline foreign export ccall stdcall
|
27
|
+
)
|
28
|
+
end
|
29
|
+
|
30
|
+
# These are literal patterns common to the ABC intermediate language and
|
31
|
+
# Clean. Clean has more extensive literal patterns (see :basic below).
|
32
|
+
state :common_literals do
|
33
|
+
rule %r/'(?:[^'\\]|\\(?:x[0-9a-fA-F]+|\d+|.))'/, Str::Char
|
34
|
+
|
35
|
+
rule %r/[+~-]?\d+\.\d+(?:E[+-]?\d+)?\b/, Num::Float
|
36
|
+
rule %r/[+~-]?\d+E[+-]?\d+\b/, Num::Float
|
37
|
+
rule %r/[+~-]?\d+/, Num::Integer
|
38
|
+
|
39
|
+
rule %r/"/, Str::Double, :string
|
40
|
+
end
|
41
|
+
|
42
|
+
state :basic do
|
43
|
+
rule %r/\s+/m, Text::Whitespace
|
44
|
+
|
45
|
+
rule %r/\/\/\*.*/, Comment::Doc
|
46
|
+
rule %r/\/\/.*/, Comment::Single
|
47
|
+
rule %r/\/\*\*/, Comment::Doc, :comment_doc
|
48
|
+
rule %r/\/\*/, Comment::Multiline, :comment
|
49
|
+
|
50
|
+
rule %r/[+~-]?0[0-7]+/, Num::Oct
|
51
|
+
rule %r/[+~-]?0x[0-9a-fA-F]+/, Num::Hex
|
52
|
+
mixin :common_literals
|
53
|
+
rule %r/(\[)(\s*)(')(?=.*?'\])/ do
|
54
|
+
groups Punctuation, Text::Whitespace, Str::Single, Punctuation
|
55
|
+
push :charlist
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# nested commenting
|
60
|
+
state :comment_doc do
|
61
|
+
rule %r/\*\//, Comment::Doc, :pop!
|
62
|
+
rule %r/\/\/.*/, Comment::Doc # Singleline comments in multiline comments are skipped
|
63
|
+
rule %r/\/\*/, Comment::Doc, :comment
|
64
|
+
rule %r/[^*\/]+/, Comment::Doc
|
65
|
+
rule %r/[*\/]/, Comment::Doc
|
66
|
+
end
|
67
|
+
|
68
|
+
# This is the same as the above, but with Multiline instead of Doc
|
69
|
+
state :comment do
|
70
|
+
rule %r/\*\//, Comment::Multiline, :pop!
|
71
|
+
rule %r/\/\/.*/, Comment::Multiline # Singleline comments in multiline comments are skipped
|
72
|
+
rule %r/\/\*/, Comment::Multiline, :comment
|
73
|
+
rule %r/[^*\/]+/, Comment::Multiline
|
74
|
+
rule %r/[*\/]/, Comment::Multiline
|
75
|
+
end
|
76
|
+
|
77
|
+
state :root do
|
78
|
+
mixin :basic
|
79
|
+
|
80
|
+
rule %r/code(\s+inline)?\s*{/, Comment::Preproc, :abc
|
81
|
+
|
82
|
+
rule %r/_*[a-z][\w_`]*/ do |m|
|
83
|
+
if self.class.keywords.include?(m[0])
|
84
|
+
token Keyword
|
85
|
+
else
|
86
|
+
token Name
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
rule %r/_*[A-Z][\w_`]*/ do |m|
|
91
|
+
if m[0]=='True' || m[0]=='False'
|
92
|
+
token Keyword::Constant
|
93
|
+
else
|
94
|
+
token Keyword::Type
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
rule %r/[^\w_\s`]/, Punctuation
|
99
|
+
rule %r/_\b/, Punctuation
|
100
|
+
end
|
101
|
+
|
102
|
+
state :escapes do
|
103
|
+
rule %r/\\x[0-9a-fA-F]{1,2}/i, Str::Escape
|
104
|
+
rule %r/\\d\d{0,3}/i, Str::Escape
|
105
|
+
rule %r/\\0[0-7]{0,3}/, Str::Escape
|
106
|
+
rule %r/\\[0-7]{1,3}/, Str::Escape
|
107
|
+
rule %r/\\[nrfbtv\\"']/, Str::Escape
|
108
|
+
end
|
109
|
+
|
110
|
+
state :string do
|
111
|
+
rule %r/"/, Str::Double, :pop!
|
112
|
+
mixin :escapes
|
113
|
+
rule %r/[^\\"]+/, Str::Double
|
114
|
+
end
|
115
|
+
|
116
|
+
state :charlist do
|
117
|
+
rule %r/(')(\])/ do
|
118
|
+
groups Str::Single, Punctuation
|
119
|
+
pop!
|
120
|
+
end
|
121
|
+
mixin :escapes
|
122
|
+
rule %r/[^\\']/, Str::Single
|
123
|
+
end
|
124
|
+
|
125
|
+
state :abc_basic do
|
126
|
+
rule %r/\s+/, Text::Whitespace
|
127
|
+
rule %r/\|.*/, Comment::Single
|
128
|
+
mixin :common_literals
|
129
|
+
end
|
130
|
+
|
131
|
+
# The ABC intermediate language can be included, similar to C's inline
|
132
|
+
# assembly. For some information about ABC, see:
|
133
|
+
# https://en.wikipedia.org/wiki/Clean_(programming_language)#The_ABC-Machine
|
134
|
+
state :abc do
|
135
|
+
mixin :abc_basic
|
136
|
+
|
137
|
+
rule %r/}/, Comment::Preproc, :pop!
|
138
|
+
rule %r/\.\w*/, Keyword, :abc_rest_of_line
|
139
|
+
rule %r/[\w_]+/, Name::Builtin, :abc_rest_of_line
|
140
|
+
end
|
141
|
+
|
142
|
+
state :abc_rest_of_line do
|
143
|
+
rule %r/\n/, Text::Whitespace, :pop!
|
144
|
+
rule %r/}/ do
|
145
|
+
token Comment::Preproc
|
146
|
+
pop!
|
147
|
+
pop!
|
148
|
+
end
|
149
|
+
|
150
|
+
mixin :abc_basic
|
151
|
+
|
152
|
+
rule %r/\S+/, Name
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
@@ -7,7 +7,7 @@ module Rouge
|
|
7
7
|
title "Common Lisp"
|
8
8
|
desc "The Common Lisp variant of Lisp (common-lisp.net)"
|
9
9
|
tag 'common_lisp'
|
10
|
-
aliases 'cl', 'common-lisp', 'elisp', 'emacs-lisp'
|
10
|
+
aliases 'cl', 'common-lisp', 'elisp', 'emacs-lisp', 'lisp'
|
11
11
|
|
12
12
|
filenames '*.cl', '*.lisp', '*.asd', '*.el' # used for Elisp too
|
13
13
|
mimetypes 'text/x-common-lisp'
|
data/lib/rouge/lexers/http.rb
CHANGED
@@ -0,0 +1,55 @@
|
|
1
|
+
# -*- coding: utf-8 -*- #
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Rouge
|
5
|
+
module Lexers
|
6
|
+
class JSL < RegexLexer
|
7
|
+
title "JSL"
|
8
|
+
desc "The JMP Scripting Language (JSL) (jmp.com)"
|
9
|
+
|
10
|
+
tag 'jsl'
|
11
|
+
filenames '*.jsl'
|
12
|
+
|
13
|
+
state :root do
|
14
|
+
rule %r/\s+/m, Text::Whitespace
|
15
|
+
|
16
|
+
rule %r(//.*?$), Comment::Single
|
17
|
+
rule %r(/\*.*?\*/)m, Comment::Multiline
|
18
|
+
|
19
|
+
# messages
|
20
|
+
rule %r/(<<)(.*?)(\(|;)/ do |m|
|
21
|
+
groups Operator, Name::Function, Punctuation
|
22
|
+
end
|
23
|
+
|
24
|
+
# covers built-in and custom functions
|
25
|
+
rule %r/([a-z_][\w\s'%.\\]*)(\()/i do |m|
|
26
|
+
groups Keyword, Punctuation
|
27
|
+
end
|
28
|
+
|
29
|
+
rule %r/\b[+-]?(?:[0-9]+(?:\.[0-9]+)?|\.[0-9]+|\.)(?:e[+-]?[0-9]+)?i?\b/i, Num
|
30
|
+
|
31
|
+
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
|
+
|
33
|
+
rule %r/::[a-z_][\w\s'%.\\]*/i, Name::Variable
|
34
|
+
rule %r/:\w+/, Name
|
35
|
+
rule %r/[a-z_][\w\s'%.\\]*/i, Name::Variable
|
36
|
+
rule %r/"(?:\\!"|[^"])*?"n/m, Name::Variable
|
37
|
+
|
38
|
+
rule %r/(")(\\\[)(.*?)(\]\\)(")/m do
|
39
|
+
groups Str::Double, Str::Escape, Str::Double, Str::Escape, Str::Double # escaped string
|
40
|
+
end
|
41
|
+
rule %r/"/, Str::Double, :dq
|
42
|
+
|
43
|
+
rule %r/[-+*\/!%&<>\|=:]/, Operator
|
44
|
+
rule %r/[\[\](){},;]/, Punctuation
|
45
|
+
end
|
46
|
+
|
47
|
+
state :dq do
|
48
|
+
rule %r/\\![btrnNf0\\"]/, Str::Escape
|
49
|
+
rule %r/\\/, Str::Double
|
50
|
+
rule %r/"/, Str::Double, :pop!
|
51
|
+
rule %r/[^\\"]*/m, Str::Double
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
# -*- coding: utf-8 -*- #
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Rouge
|
5
|
+
module Lexers
|
6
|
+
class Lustre < RegexLexer
|
7
|
+
title "Lustre"
|
8
|
+
desc 'The Lustre programming language (Verimag)'
|
9
|
+
tag 'lustre'
|
10
|
+
filenames '*.lus'
|
11
|
+
mimetypes 'text/x-lustre'
|
12
|
+
|
13
|
+
def self.keywords
|
14
|
+
@keywords ||= Set.new %w(
|
15
|
+
extern unsafe assert const current enum function let node operator
|
16
|
+
returns step struct tel type var model package needs provides uses is
|
17
|
+
body end include merge
|
18
|
+
)
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.word_operators
|
22
|
+
@word_operators ||= Set.new %w(
|
23
|
+
div and xor mod or not nor if then else fby pre when with
|
24
|
+
)
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.primitives
|
28
|
+
@primitives ||= Set.new %w(int real bool)
|
29
|
+
end
|
30
|
+
|
31
|
+
operator = %r([,!$%&*+./:<=>?@^|~#-]+)
|
32
|
+
id = /[a-z_][\w']*/i
|
33
|
+
|
34
|
+
state :root do
|
35
|
+
rule %r/\s+/m, Text
|
36
|
+
rule %r/false|true/, Keyword::Constant
|
37
|
+
rule %r(\-\-.*), Comment::Single
|
38
|
+
rule %r(/\*.*?\*/)m, Comment::Multiline
|
39
|
+
rule %r(\(\*.*?\*\))m, Comment::Multiline
|
40
|
+
rule id do |m|
|
41
|
+
match = m[0]
|
42
|
+
if self.class.keywords.include? match
|
43
|
+
token Keyword
|
44
|
+
elsif self.class.word_operators.include? match
|
45
|
+
token Operator::Word
|
46
|
+
elsif self.class.primitives.include? match
|
47
|
+
token Keyword::Type
|
48
|
+
else
|
49
|
+
token Name
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
rule %r/[(){}\[\];]+/, Punctuation
|
54
|
+
rule operator, Operator
|
55
|
+
|
56
|
+
rule %r/-?\d[\d_]*(.[\d_]*)?(e[+-]?\d[\d_]*)/i, Num::Float
|
57
|
+
rule %r/\d[\d_]*/, Num::Integer
|
58
|
+
|
59
|
+
rule %r/'(?:(\\[\\"'ntbr ])|(\\[0-9]{3})|(\\x\h{2}))'/, Str::Char
|
60
|
+
rule %r/'[.]'/, Str::Char
|
61
|
+
rule %r/"/, Str::Double, :string
|
62
|
+
rule %r/[~?]#{id}/, Name::Variable
|
63
|
+
end
|
64
|
+
|
65
|
+
state :string do
|
66
|
+
rule %r/[^\\"]+/, Str::Double
|
67
|
+
mixin :escape_sequence
|
68
|
+
rule %r/\\\n/, Str::Double
|
69
|
+
rule %r/"/, Str::Double, :pop!
|
70
|
+
end
|
71
|
+
|
72
|
+
state :escape_sequence do
|
73
|
+
rule %r/\\[\\"'ntbr]/, Str::Escape
|
74
|
+
rule %r/\\\d{3}/, Str::Escape
|
75
|
+
rule %r/\\x\h{2}/, Str::Escape
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# -*- coding: utf-8 -*- #
|
2
|
+
# frozen_string_literal: true
|
3
|
+
#
|
4
|
+
# adapted from lustre.rf (adapted from ocaml.rb), hence some ocaml-ism migth remains
|
5
|
+
module Rouge
|
6
|
+
module Lexers
|
7
|
+
load_lexer 'lustre.rb'
|
8
|
+
|
9
|
+
class Lutin < Lustre
|
10
|
+
title "Lutin"
|
11
|
+
desc 'The Lutin programming language (Verimag)'
|
12
|
+
tag 'lutin'
|
13
|
+
filenames '*.lut'
|
14
|
+
mimetypes 'text/x-lutin'
|
15
|
+
|
16
|
+
def self.keywords
|
17
|
+
@keywords ||= Set.new %w(
|
18
|
+
let in node extern system returns weak strong assert raise try catch
|
19
|
+
trap do exist erun run type ref exception include false true
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.word_operators
|
24
|
+
@word_operators ||= Set.new %w(
|
25
|
+
div and xor mod or not nor if then else pre)
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.primitives
|
29
|
+
@primitives ||= Set.new %w(int real bool trace loop fby)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,129 @@
|
|
1
|
+
# -*- coding: utf-8 -*- #
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Rouge
|
5
|
+
module Lexers
|
6
|
+
class SPARQL < RegexLexer
|
7
|
+
title "SPARQL"
|
8
|
+
desc "Semantic Query Language, for RDF data"
|
9
|
+
tag 'sparql'
|
10
|
+
filenames '*.rq'
|
11
|
+
mimetypes 'application/sparql-query'
|
12
|
+
|
13
|
+
def self.builtins
|
14
|
+
@builtins = Set.new %w[
|
15
|
+
ABS AVG BNODE BOUND CEIL COALESCE CONCAT CONTAINS COUNT DATATYPE DAY
|
16
|
+
ENCODE_FOR_URI FLOOR GROUP_CONCAT HOURS IF IRI isBLANK isIRI
|
17
|
+
isLITERAL isNUMERIC isURI LANG LANGMATCHES LCASE MAX MD5 MIN MINUTES
|
18
|
+
MONTH NOW RAND REGEX REPLACE ROUND SAMETERM SAMPLE SECONDS SEPARATOR
|
19
|
+
SHA1 SHA256 SHA384 SHA512 STR STRAFTER STRBEFORE STRDT STRENDS
|
20
|
+
STRLANG STRLEN STRSTARTS STRUUID SUBSTR SUM TIMEZONE TZ UCASE URI
|
21
|
+
UUID YEAR
|
22
|
+
]
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.keywords
|
26
|
+
@keywords = Set.new %w[
|
27
|
+
ADD ALL AS ASC ASK BASE BIND BINDINGS BY CLEAR CONSTRUCT COPY CREATE
|
28
|
+
DATA DEFAULT DELETE DESC DESCRIBE DISTINCT DROP EXISTS FILTER FROM
|
29
|
+
GRAPH GROUP BY HAVING IN INSERT LIMIT LOAD MINUS MOVE NAMED NOT
|
30
|
+
OFFSET OPTIONAL ORDER PREFIX SELECT REDUCED SERVICE SILENT TO UNDEF
|
31
|
+
UNION USING VALUES WHERE WITH
|
32
|
+
]
|
33
|
+
end
|
34
|
+
|
35
|
+
state :root do
|
36
|
+
rule %r(\s+)m, Text::Whitespace
|
37
|
+
rule %r(#.*), Comment::Single
|
38
|
+
|
39
|
+
rule %r("""), Str::Double, :string_double_literal
|
40
|
+
rule %r("), Str::Double, :string_double
|
41
|
+
rule %r('''), Str::Single, :string_single_literal
|
42
|
+
rule %r('), Str::Single, :string_single
|
43
|
+
|
44
|
+
rule %r([$?]\w+), Name::Variable
|
45
|
+
rule %r((\w*:)(\w+)?) do |m|
|
46
|
+
token Name::Namespace, m[1]
|
47
|
+
token Str::Symbol, m[2]
|
48
|
+
end
|
49
|
+
rule %r(<[^>]*>), Name::Namespace
|
50
|
+
rule %r(true|false)i, Keyword::Constant
|
51
|
+
|
52
|
+
rule %r([A-Z]\w+\b)i do |m|
|
53
|
+
if self.class.builtins.include? m[0].upcase
|
54
|
+
token Name::Builtin
|
55
|
+
elsif self.class.keywords.include? m[0].upcase
|
56
|
+
token Keyword
|
57
|
+
else
|
58
|
+
token Error
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
rule %r([+\-]?(?:\d+\.\d*|\.\d+)(?:[e][+\-]?[0-9]+)?)i, Num::Float
|
63
|
+
rule %r([+\-]?\d+), Num::Integer
|
64
|
+
rule %r([\]\[(){}.,;=]), Punctuation
|
65
|
+
rule %r([/?*+=!<>]|&&|\|\||\^\^), Operator
|
66
|
+
end
|
67
|
+
|
68
|
+
state :string_double_common do
|
69
|
+
mixin :string_escapes
|
70
|
+
rule %r(\\), Str::Double
|
71
|
+
rule %r([^"\\]+), Str::Double
|
72
|
+
end
|
73
|
+
|
74
|
+
state :string_double do
|
75
|
+
rule %r(") do
|
76
|
+
token Str::Double
|
77
|
+
goto :string_end
|
78
|
+
end
|
79
|
+
mixin :string_double_common
|
80
|
+
end
|
81
|
+
|
82
|
+
state :string_double_literal do
|
83
|
+
rule %r(""") do
|
84
|
+
token Str::Double
|
85
|
+
goto :string_end
|
86
|
+
end
|
87
|
+
rule %r("), Str::Double
|
88
|
+
mixin :string_double_common
|
89
|
+
end
|
90
|
+
|
91
|
+
state :string_single_common do
|
92
|
+
mixin :string_escapes
|
93
|
+
rule %r(\\), Str::Single
|
94
|
+
rule %r([^'\\]+), Str::Single
|
95
|
+
end
|
96
|
+
|
97
|
+
state :string_single do
|
98
|
+
rule %r(') do
|
99
|
+
token Str::Single
|
100
|
+
goto :string_end
|
101
|
+
end
|
102
|
+
mixin :string_single_common
|
103
|
+
end
|
104
|
+
|
105
|
+
state :string_single_literal do
|
106
|
+
rule %r(''') do
|
107
|
+
token Str::Single
|
108
|
+
goto :string_end
|
109
|
+
end
|
110
|
+
rule %r('), Str::Single
|
111
|
+
mixin :string_single_common
|
112
|
+
end
|
113
|
+
|
114
|
+
state :string_escapes do
|
115
|
+
rule %r(\\[tbnrf"'\\]), Str::Escape
|
116
|
+
rule %r(\\u\h{4}), Str::Escape
|
117
|
+
rule %r(\\U\h{8}), Str::Escape
|
118
|
+
end
|
119
|
+
|
120
|
+
state :string_end do
|
121
|
+
rule %r((@)([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)) do
|
122
|
+
groups Operator, Name::Property
|
123
|
+
end
|
124
|
+
rule %r(\^\^), Operator
|
125
|
+
rule(//) { pop! }
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
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.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: 2019-
|
11
|
+
date: 2019-09-03 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:
|
@@ -40,6 +40,7 @@ files:
|
|
40
40
|
- lib/rouge/demos/c
|
41
41
|
- lib/rouge/demos/ceylon
|
42
42
|
- lib/rouge/demos/cfscript
|
43
|
+
- lib/rouge/demos/clean
|
43
44
|
- lib/rouge/demos/clojure
|
44
45
|
- lib/rouge/demos/cmake
|
45
46
|
- lib/rouge/demos/cmhg
|
@@ -98,6 +99,7 @@ files:
|
|
98
99
|
- lib/rouge/demos/java
|
99
100
|
- lib/rouge/demos/javascript
|
100
101
|
- lib/rouge/demos/jinja
|
102
|
+
- lib/rouge/demos/jsl
|
101
103
|
- lib/rouge/demos/json
|
102
104
|
- lib/rouge/demos/json-doc
|
103
105
|
- lib/rouge/demos/jsonnet
|
@@ -111,6 +113,8 @@ files:
|
|
111
113
|
- lib/rouge/demos/literate_haskell
|
112
114
|
- lib/rouge/demos/llvm
|
113
115
|
- lib/rouge/demos/lua
|
116
|
+
- lib/rouge/demos/lustre
|
117
|
+
- lib/rouge/demos/lutin
|
114
118
|
- lib/rouge/demos/m68k
|
115
119
|
- lib/rouge/demos/magik
|
116
120
|
- lib/rouge/demos/make
|
@@ -163,6 +167,7 @@ files:
|
|
163
167
|
- lib/rouge/demos/smalltalk
|
164
168
|
- lib/rouge/demos/smarty
|
165
169
|
- lib/rouge/demos/sml
|
170
|
+
- lib/rouge/demos/sparql
|
166
171
|
- lib/rouge/demos/sqf
|
167
172
|
- lib/rouge/demos/sql
|
168
173
|
- lib/rouge/demos/supercollider
|
@@ -227,6 +232,7 @@ files:
|
|
227
232
|
- lib/rouge/lexers/c.rb
|
228
233
|
- lib/rouge/lexers/ceylon.rb
|
229
234
|
- lib/rouge/lexers/cfscript.rb
|
235
|
+
- lib/rouge/lexers/clean.rb
|
230
236
|
- lib/rouge/lexers/clojure.rb
|
231
237
|
- lib/rouge/lexers/cmake.rb
|
232
238
|
- lib/rouge/lexers/cmhg.rb
|
@@ -285,6 +291,7 @@ files:
|
|
285
291
|
- lib/rouge/lexers/java.rb
|
286
292
|
- lib/rouge/lexers/javascript.rb
|
287
293
|
- lib/rouge/lexers/jinja.rb
|
294
|
+
- lib/rouge/lexers/jsl.rb
|
288
295
|
- lib/rouge/lexers/json.rb
|
289
296
|
- lib/rouge/lexers/json_doc.rb
|
290
297
|
- lib/rouge/lexers/jsonnet.rb
|
@@ -300,6 +307,8 @@ files:
|
|
300
307
|
- lib/rouge/lexers/llvm.rb
|
301
308
|
- lib/rouge/lexers/lua.rb
|
302
309
|
- lib/rouge/lexers/lua/builtins.rb
|
310
|
+
- lib/rouge/lexers/lustre.rb
|
311
|
+
- lib/rouge/lexers/lutin.rb
|
303
312
|
- lib/rouge/lexers/m68k.rb
|
304
313
|
- lib/rouge/lexers/magik.rb
|
305
314
|
- lib/rouge/lexers/make.rb
|
@@ -357,6 +366,7 @@ files:
|
|
357
366
|
- lib/rouge/lexers/smalltalk.rb
|
358
367
|
- lib/rouge/lexers/smarty.rb
|
359
368
|
- lib/rouge/lexers/sml.rb
|
369
|
+
- lib/rouge/lexers/sparql.rb
|
360
370
|
- lib/rouge/lexers/sqf.rb
|
361
371
|
- lib/rouge/lexers/sqf/commands.rb
|
362
372
|
- lib/rouge/lexers/sql.rb
|