@canopycanopycanopy/b-ber-markdown-renderer 3.0.0 → 3.0.2
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.
- package/dist/highlightjs/highlight.js +50 -201
- package/dist/highlightjs/index.js +1 -1
- package/dist/highlightjs/languages/1c.js +91 -46
- package/dist/highlightjs/languages/accesslog.js +10 -5
- package/dist/highlightjs/languages/ada.js +26 -12
- package/dist/highlightjs/languages/angelscript.js +12 -5
- package/dist/highlightjs/languages/applescript.js +1 -4
- package/dist/highlightjs/languages/arcade.js +1 -4
- package/dist/highlightjs/languages/armasm.js +35 -16
- package/dist/highlightjs/languages/asciidoc.js +42 -21
- package/dist/highlightjs/languages/autohotkey.js +2 -2
- package/dist/highlightjs/languages/autoit.js +82 -82
- package/dist/highlightjs/languages/avrasm.js +7 -9
- package/dist/highlightjs/languages/bash.js +9 -5
- package/dist/highlightjs/languages/bnf.js +6 -3
- package/dist/highlightjs/languages/cal.js +0 -3
- package/dist/highlightjs/languages/capnproto.js +0 -2
- package/dist/highlightjs/languages/ceylon.js +4 -7
- package/dist/highlightjs/languages/clojure.js +2 -1
- package/dist/highlightjs/languages/cmake.js +10 -5
- package/dist/highlightjs/languages/coffeescript.js +10 -10
- package/dist/highlightjs/languages/cos.js +6 -2
- package/dist/highlightjs/languages/cpp.js +4 -4
- package/dist/highlightjs/languages/crystal.js +0 -4
- package/dist/highlightjs/languages/cs.js +4 -2
- package/dist/highlightjs/languages/d.js +34 -29
- package/dist/highlightjs/languages/dart.js +4 -3
- package/dist/highlightjs/languages/delphi.js +0 -3
- package/dist/highlightjs/languages/dns.js +4 -2
- package/dist/highlightjs/languages/dos.js +2 -1
- package/dist/highlightjs/languages/ebnf.js +2 -1
- package/dist/highlightjs/languages/elm.js +7 -2
- package/dist/highlightjs/languages/erlang.js +9 -6
- package/dist/highlightjs/languages/excel.js +2 -5
- package/dist/highlightjs/languages/gams.js +6 -3
- package/dist/highlightjs/languages/gauss.js +2 -6
- package/dist/highlightjs/languages/gcode.js +0 -3
- package/dist/highlightjs/languages/glsl.js +10 -5
- package/dist/highlightjs/languages/go.js +0 -1
- package/dist/highlightjs/languages/groovy.js +4 -2
- package/dist/highlightjs/languages/haml.js +4 -2
- package/dist/highlightjs/languages/haskell.js +9 -3
- package/dist/highlightjs/languages/hy.js +2 -1
- package/dist/highlightjs/languages/inform7.js +8 -4
- package/dist/highlightjs/languages/irpf90.js +4 -2
- package/dist/highlightjs/languages/isbl.js +292 -148
- package/dist/highlightjs/languages/java.js +8 -4
- package/dist/highlightjs/languages/javascript.js +3 -6
- package/dist/highlightjs/languages/json.js +0 -2
- package/dist/highlightjs/languages/julia.js +12 -5
- package/dist/highlightjs/languages/kotlin.js +15 -8
- package/dist/highlightjs/languages/lasso.js +0 -3
- package/dist/highlightjs/languages/less.js +20 -17
- package/dist/highlightjs/languages/livecodeserver.js +0 -3
- package/dist/highlightjs/languages/livescript.js +8 -9
- package/dist/highlightjs/languages/llvm.js +4 -2
- package/dist/highlightjs/languages/lua.js +6 -6
- package/dist/highlightjs/languages/makefile.js +0 -5
- package/dist/highlightjs/languages/markdown.js +18 -9
- package/dist/highlightjs/languages/mercury.js +4 -2
- package/dist/highlightjs/languages/mipsasm.js +37 -18
- package/dist/highlightjs/languages/mojolicious.js +4 -2
- package/dist/highlightjs/languages/moonscript.js +5 -8
- package/dist/highlightjs/languages/nginx.js +12 -6
- package/dist/highlightjs/languages/ocaml.js +3 -8
- package/dist/highlightjs/languages/openscad.js +39 -39
- package/dist/highlightjs/languages/perl.js +3 -3
- package/dist/highlightjs/languages/pgsql.js +128 -72
- package/dist/highlightjs/languages/php.js +0 -1
- package/dist/highlightjs/languages/pony.js +1 -0
- package/dist/highlightjs/languages/powershell.js +5 -8
- package/dist/highlightjs/languages/processing.js +2 -1
- package/dist/highlightjs/languages/prolog.js +1 -3
- package/dist/highlightjs/languages/properties.js +8 -5
- package/dist/highlightjs/languages/protobuf.js +0 -1
- package/dist/highlightjs/languages/puppet.js +4 -8
- package/dist/highlightjs/languages/purebasic.js +9 -5
- package/dist/highlightjs/languages/python.js +0 -1
- package/dist/highlightjs/languages/qml.js +15 -11
- package/dist/highlightjs/languages/reasonml.js +0 -6
- package/dist/highlightjs/languages/roboconf.js +8 -4
- package/dist/highlightjs/languages/routeros.js +36 -18
- package/dist/highlightjs/languages/ruby.js +0 -4
- package/dist/highlightjs/languages/ruleslanguage.js +2 -1
- package/dist/highlightjs/languages/rust.js +8 -4
- package/dist/highlightjs/languages/sas.js +4 -2
- package/dist/highlightjs/languages/scala.js +2 -1
- package/dist/highlightjs/languages/scheme.js +0 -3
- package/dist/highlightjs/languages/scilab.js +2 -4
- package/dist/highlightjs/languages/sml.js +2 -6
- package/dist/highlightjs/languages/sqf.js +8 -5
- package/dist/highlightjs/languages/stan.js +2 -1
- package/dist/highlightjs/languages/stylus.js +45 -24
- package/dist/highlightjs/languages/swift.js +4 -3
- package/dist/highlightjs/languages/tap.js +8 -4
- package/dist/highlightjs/languages/thrift.js +0 -1
- package/dist/highlightjs/languages/tp.js +1 -3
- package/dist/highlightjs/languages/twig.js +0 -3
- package/dist/highlightjs/languages/typescript.js +0 -3
- package/dist/highlightjs/languages/vala.js +12 -6
- package/dist/highlightjs/languages/vbnet.js +12 -27
- package/dist/highlightjs/languages/verilog.js +1 -2
- package/dist/highlightjs/languages/vhdl.js +8 -5
- package/dist/highlightjs/languages/vim.js +6 -3
- package/dist/highlightjs/languages/x86asm.js +52 -26
- package/dist/highlightjs/languages/xml.js +2 -2
- package/dist/highlightjs/languages/xquery.js +12 -7
- package/dist/highlightjs/languages/yaml.js +3 -1
- package/dist/highlightjs/languages/zephir.js +0 -1
- package/dist/index.js +9 -36
- package/package.json +17 -17
|
@@ -6,9 +6,10 @@ module.exports = function (hljs) {
|
|
|
6
6
|
literal: 'true false null undefined NaN Infinity',
|
|
7
7
|
built_in: 'eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent ' + 'encodeURI encodeURIComponent escape unescape Object Function Boolean Error ' + 'EvalError InternalError RangeError ReferenceError StopIteration SyntaxError ' + 'TypeError URIError Number Math Date String RegExp Array Float32Array ' + 'Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array ' + 'Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require ' + 'module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect ' + 'Behavior bool color coordinate date double enumeration font geocircle georectangle ' + 'geoshape int list matrix4x4 parent point quaternion real rect ' + 'size string url variant vector2d vector3d vector4d' + 'Promise'
|
|
8
8
|
};
|
|
9
|
-
var QML_IDENT_RE = '[a-zA-Z_][a-zA-Z0-9\\._]*';
|
|
10
|
-
// Use property class.
|
|
9
|
+
var QML_IDENT_RE = '[a-zA-Z_][a-zA-Z0-9\\._]*';
|
|
11
10
|
|
|
11
|
+
// Isolate property statements. Ends at a :, =, ;, ,, a comment or end of line.
|
|
12
|
+
// Use property class.
|
|
12
13
|
var PROPERTY = {
|
|
13
14
|
className: 'keyword',
|
|
14
15
|
begin: '\\bproperty\\b',
|
|
@@ -17,9 +18,10 @@ module.exports = function (hljs) {
|
|
|
17
18
|
end: '(:|=|;|,|//|/\\*|$)',
|
|
18
19
|
returnEnd: true
|
|
19
20
|
}
|
|
20
|
-
};
|
|
21
|
-
// Use property class.
|
|
21
|
+
};
|
|
22
22
|
|
|
23
|
+
// Isolate signal statements. Ends at a ) a comment or end of line.
|
|
24
|
+
// Use property class.
|
|
23
25
|
var SIGNAL = {
|
|
24
26
|
className: 'keyword',
|
|
25
27
|
begin: '\\bsignal\\b',
|
|
@@ -28,9 +30,10 @@ module.exports = function (hljs) {
|
|
|
28
30
|
end: '(\\(|:|=|;|,|//|/\\*|$)',
|
|
29
31
|
returnEnd: true
|
|
30
32
|
}
|
|
31
|
-
};
|
|
32
|
-
// emphasize the token following.
|
|
33
|
+
};
|
|
33
34
|
|
|
35
|
+
// id: is special in QML. When we see id: we want to mark the id: as attribute and
|
|
36
|
+
// emphasize the token following.
|
|
34
37
|
var ID_ID = {
|
|
35
38
|
className: 'attribute',
|
|
36
39
|
begin: '\\bid\\s*:',
|
|
@@ -39,11 +42,12 @@ module.exports = function (hljs) {
|
|
|
39
42
|
end: QML_IDENT_RE,
|
|
40
43
|
returnEnd: false
|
|
41
44
|
}
|
|
42
|
-
};
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// Find QML object attribute. An attribute is a QML identifier followed by :.
|
|
43
48
|
// Unfortunately it's hard to know where it ends, as it may contain scalars,
|
|
44
49
|
// objects, object definitions, or javascript. The true end is either when the parent
|
|
45
50
|
// ends or the next attribute is detected.
|
|
46
|
-
|
|
47
51
|
var QML_ATTRIBUTE = {
|
|
48
52
|
begin: QML_IDENT_RE + '\\s*:',
|
|
49
53
|
returnBegin: true,
|
|
@@ -55,9 +59,10 @@ module.exports = function (hljs) {
|
|
|
55
59
|
relevance: 0
|
|
56
60
|
}],
|
|
57
61
|
relevance: 0
|
|
58
|
-
};
|
|
59
|
-
// All we really care about is finding IDENT followed by { and just mark up the IDENT and ignore the {.
|
|
62
|
+
};
|
|
60
63
|
|
|
64
|
+
// Find QML object. A QML object is a QML identifier followed by { and ends at the matching }.
|
|
65
|
+
// All we really care about is finding IDENT followed by { and just mark up the IDENT and ignore the {.
|
|
61
66
|
var QML_OBJECT = {
|
|
62
67
|
begin: QML_IDENT_RE + '\\s*{',
|
|
63
68
|
end: '{',
|
|
@@ -125,7 +130,6 @@ module.exports = function (hljs) {
|
|
|
125
130
|
}, {
|
|
126
131
|
begin: '\\.' + hljs.IDENT_RE,
|
|
127
132
|
relevance: 0 // hack: prevents detection of keywords after dots
|
|
128
|
-
|
|
129
133
|
}, ID_ID, QML_ATTRIBUTE, QML_OBJECT],
|
|
130
134
|
illegal: /#/
|
|
131
135
|
};
|
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
6
|
-
|
|
7
5
|
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
8
|
-
|
|
9
6
|
module.exports = function (hljs) {
|
|
10
7
|
var _context2, _context3;
|
|
11
|
-
|
|
12
8
|
function orReValues(ops) {
|
|
13
9
|
return (0, _map.default)(ops).call(ops, function (op) {
|
|
14
10
|
var _context;
|
|
15
|
-
|
|
16
11
|
return (0, _map.default)(_context = op.split('')).call(_context, function (char) {
|
|
17
12
|
return '\\' + char;
|
|
18
13
|
}).join('');
|
|
19
14
|
}).join('|');
|
|
20
15
|
}
|
|
21
|
-
|
|
22
16
|
var RE_IDENT = '~?[a-z$_][0-9a-zA-Z$_]*';
|
|
23
17
|
var RE_MODULE_IDENT = '`?[A-Z$_][0-9a-zA-Z$_]*';
|
|
24
18
|
var RE_PARAM_TYPEPARAM = '\'?[a-z$_][0-9a-z$_]*';
|
|
@@ -23,25 +23,29 @@ module.exports = function (hljs) {
|
|
|
23
23
|
aliases: ['graph', 'instances'],
|
|
24
24
|
case_insensitive: true,
|
|
25
25
|
keywords: 'import',
|
|
26
|
-
contains: [
|
|
26
|
+
contains: [
|
|
27
|
+
// Facet sections
|
|
27
28
|
{
|
|
28
29
|
begin: '^facet ' + IDENTIFIER,
|
|
29
30
|
end: '}',
|
|
30
31
|
keywords: 'facet',
|
|
31
32
|
contains: [PROPERTY, hljs.HASH_COMMENT_MODE]
|
|
32
|
-
},
|
|
33
|
+
},
|
|
34
|
+
// Instance sections
|
|
33
35
|
{
|
|
34
36
|
begin: '^\\s*instance of ' + IDENTIFIER,
|
|
35
37
|
end: '}',
|
|
36
38
|
keywords: 'name count channels instance-data instance-state instance of',
|
|
37
39
|
illegal: /\S/,
|
|
38
40
|
contains: ['self', PROPERTY, hljs.HASH_COMMENT_MODE]
|
|
39
|
-
},
|
|
41
|
+
},
|
|
42
|
+
// Component sections
|
|
40
43
|
{
|
|
41
44
|
begin: '^' + IDENTIFIER,
|
|
42
45
|
end: '}',
|
|
43
46
|
contains: [PROPERTY, hljs.HASH_COMMENT_MODE]
|
|
44
|
-
},
|
|
47
|
+
},
|
|
48
|
+
// Comments
|
|
45
49
|
hljs.HASH_COMMENT_MODE]
|
|
46
50
|
};
|
|
47
51
|
};
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
module.exports =
|
|
3
|
+
module.exports =
|
|
4
|
+
// Colors from RouterOS terminal:
|
|
4
5
|
// green - #0E9A00
|
|
5
6
|
// teal - #0C9A9A
|
|
6
7
|
// purple - #99069A
|
|
7
8
|
// light-brown - #9A9900
|
|
9
|
+
|
|
8
10
|
function (hljs) {
|
|
9
|
-
var STATEMENTS = 'foreach do while for if from to step else on-error and or not in';
|
|
11
|
+
var STATEMENTS = 'foreach do while for if from to step else on-error and or not in';
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
// Global commands: Every global command should start with ":" token, otherwise it will be treated as variable.
|
|
14
|
+
var GLOBAL_COMMANDS = 'global local beep delay put len typeof pick log time set find environment terminal error execute parse resolve toarray tobool toid toip toip6 tonum tostr totime';
|
|
12
15
|
|
|
16
|
+
// Common commands: Following commands available from most sub-menus:
|
|
13
17
|
var COMMON_COMMANDS = 'add remove enable disable set get print export edit find run debug error info warning';
|
|
14
18
|
var LITERALS = 'true false yes no nothing nil null';
|
|
15
|
-
var OBJECTS = 'traffic-flow traffic-generator firewall scheduler aaa accounting address-list address align area bandwidth-server bfd bgp bridge client clock community config connection console customer default dhcp-client dhcp-server discovery dns e-mail ethernet filter firewall firmware gps graphing group hardware health hotspot identity igmp-proxy incoming instance interface ip ipsec ipv6 irq l2tp-server lcd ldp logging mac-server mac-winbox mangle manual mirror mme mpls nat nd neighbor network note ntp ospf ospf-v3 ovpn-server page peer pim ping policy pool port ppp pppoe-client pptp-server prefix profile proposal proxy queue radius resource rip ripng route routing screen script security-profiles server service service-port settings shares smb sms sniffer snmp snooper socks sstp-server system tool tracking type upgrade upnp user-manager users user vlan secret vrrp watchdog web-access wireless pptp pppoe lan wan layer7-protocol lease simple raw';
|
|
19
|
+
var OBJECTS = 'traffic-flow traffic-generator firewall scheduler aaa accounting address-list address align area bandwidth-server bfd bgp bridge client clock community config connection console customer default dhcp-client dhcp-server discovery dns e-mail ethernet filter firewall firmware gps graphing group hardware health hotspot identity igmp-proxy incoming instance interface ip ipsec ipv6 irq l2tp-server lcd ldp logging mac-server mac-winbox mangle manual mirror mme mpls nat nd neighbor network note ntp ospf ospf-v3 ovpn-server page peer pim ping policy pool port ppp pppoe-client pptp-server prefix profile proposal proxy queue radius resource rip ripng route routing screen script security-profiles server service service-port settings shares smb sms sniffer snmp snooper socks sstp-server system tool tracking type upgrade upnp user-manager users user vlan secret vrrp watchdog web-access wireless pptp pppoe lan wan layer7-protocol lease simple raw';
|
|
20
|
+
|
|
21
|
+
// print parameters
|
|
16
22
|
// Several parameters are available for print command:
|
|
17
23
|
// ToDo: var PARAMETERS_PRINT = 'append as-value brief detail count-only file follow follow-only from interval terse value-list without-paging where info';
|
|
18
24
|
// ToDo: var OPERATORS = '&& and ! not || or in ~ ^ & << >> + - * /';
|
|
@@ -45,8 +51,8 @@ function (hljs) {
|
|
|
45
51
|
end: /'/
|
|
46
52
|
};
|
|
47
53
|
var IPADDR = '((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\b';
|
|
48
|
-
var IPADDR_wBITMASK = IPADDR + '/(3[0-2]|[1-2][0-9]|\\d)';
|
|
49
|
-
|
|
54
|
+
var IPADDR_wBITMASK = IPADDR + '/(3[0-2]|[1-2][0-9]|\\d)';
|
|
55
|
+
//////////////////////////////////////////////////////////////////////
|
|
50
56
|
return {
|
|
51
57
|
aliases: ['routeros', 'mikrotik'],
|
|
52
58
|
case_insensitive: true,
|
|
@@ -60,44 +66,54 @@ function (hljs) {
|
|
|
60
66
|
variants: [{
|
|
61
67
|
begin: /^@/,
|
|
62
68
|
end: /$/
|
|
63
|
-
},
|
|
69
|
+
},
|
|
70
|
+
// dns
|
|
64
71
|
{
|
|
65
72
|
begin: /\/\*/,
|
|
66
73
|
end: /\*\//
|
|
67
|
-
},
|
|
74
|
+
},
|
|
75
|
+
// -- comment
|
|
68
76
|
{
|
|
69
77
|
begin: /%%/,
|
|
70
78
|
end: /$/
|
|
71
|
-
},
|
|
79
|
+
},
|
|
80
|
+
// -- comment
|
|
72
81
|
{
|
|
73
82
|
begin: /^'/,
|
|
74
83
|
end: /$/
|
|
75
|
-
},
|
|
84
|
+
},
|
|
85
|
+
// Monkey one line comment
|
|
76
86
|
{
|
|
77
87
|
begin: /^\s*\/[\w-]+=/,
|
|
78
88
|
end: /$/
|
|
79
|
-
},
|
|
89
|
+
},
|
|
90
|
+
// jboss-cli
|
|
80
91
|
{
|
|
81
92
|
begin: /\/\//,
|
|
82
93
|
end: /$/
|
|
83
|
-
},
|
|
94
|
+
},
|
|
95
|
+
// Stan comment
|
|
84
96
|
{
|
|
85
97
|
begin: /^\[\</,
|
|
86
98
|
end: /\>\]$/
|
|
87
|
-
},
|
|
99
|
+
},
|
|
100
|
+
// F# class declaration?
|
|
88
101
|
{
|
|
89
102
|
begin: /<\//,
|
|
90
103
|
end: />/
|
|
91
|
-
},
|
|
104
|
+
},
|
|
105
|
+
// HTML tags
|
|
92
106
|
{
|
|
93
107
|
begin: /^facet /,
|
|
94
108
|
end: /\}/
|
|
95
|
-
},
|
|
109
|
+
},
|
|
110
|
+
// roboconf - лютый костыль )))
|
|
96
111
|
{
|
|
97
112
|
begin: '^1\\.\\.(\\d+)$',
|
|
98
113
|
end: /$/
|
|
99
114
|
} // tap
|
|
100
115
|
],
|
|
116
|
+
|
|
101
117
|
illegal: /./
|
|
102
118
|
}, hljs.COMMENT('^#', '$'), QUOTE_STRING, APOS_STRING, VAR, {
|
|
103
119
|
// attribute=value
|
|
@@ -124,7 +140,6 @@ function (hljs) {
|
|
|
124
140
|
{begin: IPADDR+'(,'+IPADDR+')*'}, // 192.168.0.1,192.168.0.34,192.168.24.1,192.168.0.1
|
|
125
141
|
]
|
|
126
142
|
}, // */
|
|
127
|
-
|
|
128
143
|
/*{
|
|
129
144
|
// MAC addresses and DHCP Client IDs
|
|
130
145
|
className: 'number',
|
|
@@ -138,12 +153,15 @@ function (hljs) {
|
|
|
138
153
|
]
|
|
139
154
|
} //*/
|
|
140
155
|
]
|
|
141
|
-
},
|
|
156
|
+
},
|
|
157
|
+
//*/
|
|
142
158
|
{
|
|
143
159
|
// HEX values
|
|
144
160
|
className: 'number',
|
|
145
161
|
begin: /\*[0-9a-fA-F]+/
|
|
146
|
-
},
|
|
162
|
+
},
|
|
163
|
+
//*/
|
|
164
|
+
|
|
147
165
|
{
|
|
148
166
|
begin: '\\b(' + COMMON_COMMANDS.split(' ').join('|') + ')([\\s\[\(]|\])',
|
|
149
167
|
returnBegin: true,
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
6
|
-
|
|
7
5
|
module.exports = function (hljs) {
|
|
8
6
|
var _context, _context2, _context3, _context4, _context5;
|
|
9
|
-
|
|
10
7
|
var RUBY_METHOD_RE = '[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?';
|
|
11
8
|
var RUBY_KEYWORDS = {
|
|
12
9
|
keyword: 'and then defined module in return redo if BEGIN retry end for self when ' + 'next until do begin unless END rescue else break undef not super class case ' + 'require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor',
|
|
@@ -124,7 +121,6 @@ module.exports = function (hljs) {
|
|
|
124
121
|
relevance: 0
|
|
125
122
|
}, {
|
|
126
123
|
begin: '(\\$\\W)|((\\$|\\@\\@?)(\\w+))' // variables
|
|
127
|
-
|
|
128
124
|
}, {
|
|
129
125
|
className: 'params',
|
|
130
126
|
begin: /\|/,
|
|
@@ -3,10 +3,14 @@
|
|
|
3
3
|
module.exports = function (hljs) {
|
|
4
4
|
var NUM_SUFFIX = '([ui](8|16|32|64|128|size)|f(32|64))\?';
|
|
5
5
|
var KEYWORDS = 'alignof as be box break const continue crate do else enum extern ' + 'false fn for if impl in let loop match mod mut offsetof once priv ' + 'proc pub pure ref return self Self sizeof static struct super trait true ' + 'type typeof unsafe unsized use virtual while where yield move default';
|
|
6
|
-
var BUILTINS =
|
|
7
|
-
|
|
8
|
-
'
|
|
9
|
-
|
|
6
|
+
var BUILTINS =
|
|
7
|
+
// functions
|
|
8
|
+
'drop ' +
|
|
9
|
+
// types
|
|
10
|
+
'i8 i16 i32 i64 i128 isize ' + 'u8 u16 u32 u64 u128 usize ' + 'f32 f64 ' + 'str char bool ' + 'Box Option Result String Vec ' +
|
|
11
|
+
// traits
|
|
12
|
+
'Copy Send Sized Sync Drop Fn FnMut FnOnce ToOwned Clone Debug ' + 'PartialEq PartialOrd Eq Ord AsRef AsMut Into From Default Iterator ' + 'Extend IntoIterator DoubleEndedIterator ExactSizeIterator ' + 'SliceConcatExt ToString ' +
|
|
13
|
+
// macros
|
|
10
14
|
'assert! assert_eq! bitflags! bytes! cfg! col! concat! concat_idents! ' + 'debug_assert! debug_assert_eq! env! panic! file! format! format_args! ' + 'include_bin! include_str! line! local_data_key! module_path! ' + 'option_env! print! println! select! stringify! try! unimplemented! ' + 'unreachable! vec! write! writeln! macro_rules! assert_ne! debug_assert_ne!';
|
|
11
15
|
return {
|
|
12
16
|
aliases: ['rs'],
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
module.exports = function (hljs) {
|
|
4
4
|
// Data step and PROC SQL statements
|
|
5
|
-
var SAS_KEYWORDS = '' + 'do if then else end until while ' + '' + 'abort array attrib by call cards cards4 catname continue ' + 'datalines datalines4 delete delim delimiter display dm drop ' + 'endsas error file filename footnote format goto in infile ' + 'informat input keep label leave length libname link list ' + 'lostcard merge missing modify options output out page put ' + 'redirect remove rename replace retain return select set skip ' + 'startsas stop title update waitsas where window x systask ' + '' + 'add and alter as cascade check create delete describe ' + 'distinct drop foreign from group having index insert into in ' + 'key like message modify msgtype not null on or order primary ' + 'references reset restrict select set table unique update ' + 'validate view where';
|
|
5
|
+
var SAS_KEYWORDS = '' + 'do if then else end until while ' + '' + 'abort array attrib by call cards cards4 catname continue ' + 'datalines datalines4 delete delim delimiter display dm drop ' + 'endsas error file filename footnote format goto in infile ' + 'informat input keep label leave length libname link list ' + 'lostcard merge missing modify options output out page put ' + 'redirect remove rename replace retain return select set skip ' + 'startsas stop title update waitsas where window x systask ' + '' + 'add and alter as cascade check create delete describe ' + 'distinct drop foreign from group having index insert into in ' + 'key like message modify msgtype not null on or order primary ' + 'references reset restrict select set table unique update ' + 'validate view where';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// Built-in SAS functions
|
|
8
|
+
var SAS_FUN = '' + 'abs|addr|airy|arcos|arsin|atan|attrc|attrn|band|' + 'betainv|blshift|bnot|bor|brshift|bxor|byte|cdf|ceil|' + 'cexist|cinv|close|cnonct|collate|compbl|compound|' + 'compress|cos|cosh|css|curobs|cv|daccdb|daccdbsl|' + 'daccsl|daccsyd|dacctab|dairy|date|datejul|datepart|' + 'datetime|day|dclose|depdb|depdbsl|depdbsl|depsl|' + 'depsl|depsyd|depsyd|deptab|deptab|dequote|dhms|dif|' + 'digamma|dim|dinfo|dnum|dopen|doptname|doptnum|dread|' + 'dropnote|dsname|erf|erfc|exist|exp|fappend|fclose|' + 'fcol|fdelete|fetch|fetchobs|fexist|fget|fileexist|' + 'filename|fileref|finfo|finv|fipname|fipnamel|' + 'fipstate|floor|fnonct|fnote|fopen|foptname|foptnum|' + 'fpoint|fpos|fput|fread|frewind|frlen|fsep|fuzz|' + 'fwrite|gaminv|gamma|getoption|getvarc|getvarn|hbound|' + 'hms|hosthelp|hour|ibessel|index|indexc|indexw|input|' + 'inputc|inputn|int|intck|intnx|intrr|irr|jbessel|' + 'juldate|kurtosis|lag|lbound|left|length|lgamma|' + 'libname|libref|log|log10|log2|logpdf|logpmf|logsdf|' + 'lowcase|max|mdy|mean|min|minute|mod|month|mopen|' + 'mort|n|netpv|nmiss|normal|note|npv|open|ordinal|' + 'pathname|pdf|peek|peekc|pmf|point|poisson|poke|' + 'probbeta|probbnml|probchi|probf|probgam|probhypr|' + 'probit|probnegb|probnorm|probt|put|putc|putn|qtr|' + 'quote|ranbin|rancau|ranexp|rangam|range|rank|rannor|' + 'ranpoi|rantbl|rantri|ranuni|repeat|resolve|reverse|' + 'rewind|right|round|saving|scan|sdf|second|sign|' + 'sin|sinh|skewness|soundex|spedis|sqrt|std|stderr|' + 'stfips|stname|stnamel|substr|sum|symget|sysget|' + 'sysmsg|sysprod|sysrc|system|tan|tanh|time|timepart|' + 'tinv|tnonct|today|translate|tranwrd|trigamma|' + 'trim|trimn|trunc|uniform|upcase|uss|var|varfmt|' + 'varinfmt|varlabel|varlen|varname|varnum|varray|' + 'varrayx|vartype|verify|vformat|vformatd|vformatdx|' + 'vformatn|vformatnx|vformatw|vformatwx|vformatx|' + 'vinarray|vinarrayx|vinformat|vinformatd|vinformatdx|' + 'vinformatn|vinformatnx|vinformatw|vinformatwx|' + 'vinformatx|vlabel|vlabelx|vlength|vlengthx|vname|' + 'vnamex|vtype|vtypex|weekday|year|yyq|zipfips|zipname|' + 'zipnamel|zipstate';
|
|
8
9
|
|
|
10
|
+
// Built-in macro functions
|
|
9
11
|
var SAS_MACRO_FUN = 'bquote|nrbquote|cmpres|qcmpres|compstor|' + 'datatyp|display|do|else|end|eval|global|goto|' + 'if|index|input|keydef|label|left|length|let|' + 'local|lowcase|macro|mend|nrbquote|nrquote|' + 'nrstr|put|qcmpres|qleft|qlowcase|qscan|' + 'qsubstr|qsysfunc|qtrim|quote|qupcase|scan|str|' + 'substr|superq|syscall|sysevalf|sysexec|sysfunc|' + 'sysget|syslput|sysprod|sysrc|sysrput|then|to|' + 'trim|unquote|until|upcase|verify|while|window';
|
|
10
12
|
return {
|
|
11
13
|
aliases: ['sas', 'SAS'],
|
|
@@ -4,8 +4,9 @@ module.exports = function (hljs) {
|
|
|
4
4
|
var ANNOTATION = {
|
|
5
5
|
className: 'meta',
|
|
6
6
|
begin: '@[A-Za-z]+'
|
|
7
|
-
};
|
|
7
|
+
};
|
|
8
8
|
|
|
9
|
+
// used in strings for escaping/interpolation/substitution
|
|
9
10
|
var SUBST = {
|
|
10
11
|
className: 'subst',
|
|
11
12
|
variants: [{
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
6
|
-
|
|
7
5
|
module.exports = function (hljs) {
|
|
8
6
|
var _context, _context2;
|
|
9
|
-
|
|
10
7
|
var SCHEME_IDENT_RE = '[^\\(\\)\\[\\]\\{\\}",\'`;#|\\\\\\s]+';
|
|
11
8
|
var SCHEME_SIMPLE_NUMBER_RE = '(\\-|\\+)?\\d+([./]\\d+)?';
|
|
12
9
|
var SCHEME_COMPLEX_NUMBER_RE = SCHEME_SIMPLE_NUMBER_RE + '[+\\-]' + SCHEME_SIMPLE_NUMBER_RE + 'i';
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
6
|
-
|
|
7
5
|
module.exports = function (hljs) {
|
|
8
6
|
var _context;
|
|
9
|
-
|
|
10
7
|
var COMMON_CONTAINS = [hljs.C_NUMBER_MODE, {
|
|
11
8
|
className: 'string',
|
|
12
9
|
begin: '\'|\"',
|
|
@@ -21,7 +18,8 @@ module.exports = function (hljs) {
|
|
|
21
18
|
keywords: {
|
|
22
19
|
keyword: 'abort break case clear catch continue do elseif else endfunction end for function ' + 'global if pause return resume select try then while',
|
|
23
20
|
literal: '%f %F %t %T %pi %eps %inf %nan %e %i %z %s',
|
|
24
|
-
built_in:
|
|
21
|
+
built_in:
|
|
22
|
+
// Scilab has more than 2000 functions. Just list the most commons
|
|
25
23
|
'abs and acos asin atan ceil cd chdir clearglobal cosh cos cumprod deff disp error ' + 'exec execstr exists exp eye gettext floor fprintf fread fsolve imag isdef isempty ' + 'isinfisnan isvector lasterror length load linspace list listfiles log10 log2 log ' + 'max min msprintf mclose mopen ones or pathconvert poly printf prod pwd rand real ' + 'round sinh sin size gsort sprintf sqrt strcat strcmps tring sum system tanh tan ' + 'type typename warning zeros matrix'
|
|
26
24
|
},
|
|
27
25
|
illegal: '("|#|/\\*|\\s+/\\w+)',
|
|
@@ -4,11 +4,9 @@ module.exports = function (hljs) {
|
|
|
4
4
|
return {
|
|
5
5
|
aliases: ['ml'],
|
|
6
6
|
keywords: {
|
|
7
|
-
keyword:
|
|
8
|
-
/* according to Definition of Standard ML 97 */
|
|
7
|
+
keyword: /* according to Definition of Standard ML 97 */
|
|
9
8
|
'abstype and andalso as case datatype do else end eqtype ' + 'exception fn fun functor handle if in include infix infixr ' + 'let local nonfix of op open orelse raise rec sharing sig ' + 'signature struct structure then type val with withtype where while',
|
|
10
|
-
built_in:
|
|
11
|
-
/* built-in types according to basis library */
|
|
9
|
+
built_in: /* built-in types according to basis library */
|
|
12
10
|
'array bool char exn int list option order real ref string substring vector unit word',
|
|
13
11
|
literal: 'true false NONE SOME LESS EQUAL GREATER nil'
|
|
14
12
|
},
|
|
@@ -25,7 +23,6 @@ module.exports = function (hljs) {
|
|
|
25
23
|
className: 'symbol',
|
|
26
24
|
begin: '\'[A-Za-z_](?!\')[\\w\']*'
|
|
27
25
|
/* the grammar is ambiguous on how 'a'b should be interpreted but not the compiler */
|
|
28
|
-
|
|
29
26
|
}, {
|
|
30
27
|
/* polymorphic variant */
|
|
31
28
|
className: 'type',
|
|
@@ -49,7 +46,6 @@ module.exports = function (hljs) {
|
|
|
49
46
|
relevance: 0
|
|
50
47
|
}, {
|
|
51
48
|
begin: /[-=]>/ // relevance booster
|
|
52
|
-
|
|
53
49
|
}]
|
|
54
50
|
};
|
|
55
51
|
};
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
module.exports = function (hljs) {
|
|
4
|
-
var CPP = hljs.getLanguage('cpp').exports;
|
|
4
|
+
var CPP = hljs.getLanguage('cpp').exports;
|
|
5
5
|
|
|
6
|
+
// In SQF, a variable start with _
|
|
6
7
|
var VARIABLE = {
|
|
7
8
|
className: 'variable',
|
|
8
9
|
begin: /\b_+[a-zA-Z_]\w*/
|
|
9
|
-
};
|
|
10
|
-
// https://community.bistudio.com/wiki/Functions_Library_(Arma_3)#Adding_a_Function
|
|
10
|
+
};
|
|
11
11
|
|
|
12
|
+
// In SQF, a function should fit myTag_fnc_myFunction pattern
|
|
13
|
+
// https://community.bistudio.com/wiki/Functions_Library_(Arma_3)#Adding_a_Function
|
|
12
14
|
var FUNCTION = {
|
|
13
15
|
className: 'title',
|
|
14
16
|
begin: /[a-zA-Z][a-zA-Z0-9]+_fnc_\w*/
|
|
15
|
-
};
|
|
16
|
-
// Example of single escaped quotes: " "" " and ' '' '.
|
|
17
|
+
};
|
|
17
18
|
|
|
19
|
+
// In SQF strings, quotes matching the start are escaped by adding a consecutive.
|
|
20
|
+
// Example of single escaped quotes: " "" " and ' '' '.
|
|
18
21
|
var STRINGS = {
|
|
19
22
|
className: 'string',
|
|
20
23
|
variants: [{
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _reverse = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/reverse"));
|
|
6
|
-
|
|
7
5
|
module.exports = function (hljs) {
|
|
8
6
|
var VARIABLE = {
|
|
9
7
|
className: 'variable',
|
|
@@ -17,27 +15,41 @@ module.exports = function (hljs) {
|
|
|
17
15
|
var PSEUDO_SELECTORS = ['after', 'before', 'first-letter', 'first-line', 'active', 'first-child', 'focus', 'hover', 'lang', 'link', 'visited'];
|
|
18
16
|
var TAGS = ['a', 'abbr', 'address', 'article', 'aside', 'audio', 'b', 'blockquote', 'body', 'button', 'canvas', 'caption', 'cite', 'code', 'dd', 'del', 'details', 'dfn', 'div', 'dl', 'dt', 'em', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hgroup', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'mark', 'menu', 'nav', 'object', 'ol', 'p', 'q', 'quote', 'samp', 'section', 'span', 'strong', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'ul', 'var', 'video'];
|
|
19
17
|
var TAG_END = '[\\.\\s\\n\\[\\:,]';
|
|
20
|
-
var ATTRIBUTES = ['align-content', 'align-items', 'align-self', 'animation', 'animation-delay', 'animation-direction', 'animation-duration', 'animation-fill-mode', 'animation-iteration-count', 'animation-name', 'animation-play-state', 'animation-timing-function', 'auto', 'backface-visibility', 'background', 'background-attachment', 'background-clip', 'background-color', 'background-image', 'background-origin', 'background-position', 'background-repeat', 'background-size', 'border', 'border-bottom', 'border-bottom-color', 'border-bottom-left-radius', 'border-bottom-right-radius', 'border-bottom-style', 'border-bottom-width', 'border-collapse', 'border-color', 'border-image', 'border-image-outset', 'border-image-repeat', 'border-image-slice', 'border-image-source', 'border-image-width', 'border-left', 'border-left-color', 'border-left-style', 'border-left-width', 'border-radius', 'border-right', 'border-right-color', 'border-right-style', 'border-right-width', 'border-spacing', 'border-style', 'border-top', 'border-top-color', 'border-top-left-radius', 'border-top-right-radius', 'border-top-style', 'border-top-width', 'border-width', 'bottom', 'box-decoration-break', 'box-shadow', 'box-sizing', 'break-after', 'break-before', 'break-inside', 'caption-side', 'clear', 'clip', 'clip-path', 'color', 'column-count', 'column-fill', 'column-gap', 'column-rule', 'column-rule-color', 'column-rule-style', 'column-rule-width', 'column-span', 'column-width', 'columns', 'content', 'counter-increment', 'counter-reset', 'cursor', 'direction', 'display', 'empty-cells', 'filter', 'flex', 'flex-basis', 'flex-direction', 'flex-flow', 'flex-grow', 'flex-shrink', 'flex-wrap', 'float', 'font', 'font-family', 'font-feature-settings', 'font-kerning', 'font-language-override', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-variant-ligatures', 'font-weight', 'height', 'hyphens', 'icon', 'image-orientation', 'image-rendering', 'image-resolution', 'ime-mode', 'inherit', 'initial', 'justify-content', 'left', 'letter-spacing', 'line-height', 'list-style', 'list-style-image', 'list-style-position', 'list-style-type', 'margin', 'margin-bottom', 'margin-left', 'margin-right', 'margin-top', 'marks', 'mask', 'max-height', 'max-width', 'min-height', 'min-width', 'nav-down', 'nav-index', 'nav-left', 'nav-right', 'nav-up', 'none', 'normal', 'object-fit', 'object-position', 'opacity', 'order', 'orphans', 'outline', 'outline-color', 'outline-offset', 'outline-style', 'outline-width', 'overflow', 'overflow-wrap', 'overflow-x', 'overflow-y', 'padding', 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', 'page-break-after', 'page-break-before', 'page-break-inside', 'perspective', 'perspective-origin', 'pointer-events', 'position', 'quotes', 'resize', 'right', 'tab-size', 'table-layout', 'text-align', 'text-align-last', 'text-decoration', 'text-decoration-color', 'text-decoration-line', 'text-decoration-style', 'text-indent', 'text-overflow', 'text-rendering', 'text-shadow', 'text-transform', 'text-underline-position', 'top', 'transform', 'transform-origin', 'transform-style', 'transition', 'transition-delay', 'transition-duration', 'transition-property', 'transition-timing-function', 'unicode-bidi', 'vertical-align', 'visibility', 'white-space', 'widows', 'width', 'word-break', 'word-spacing', 'word-wrap', 'z-index'];
|
|
18
|
+
var ATTRIBUTES = ['align-content', 'align-items', 'align-self', 'animation', 'animation-delay', 'animation-direction', 'animation-duration', 'animation-fill-mode', 'animation-iteration-count', 'animation-name', 'animation-play-state', 'animation-timing-function', 'auto', 'backface-visibility', 'background', 'background-attachment', 'background-clip', 'background-color', 'background-image', 'background-origin', 'background-position', 'background-repeat', 'background-size', 'border', 'border-bottom', 'border-bottom-color', 'border-bottom-left-radius', 'border-bottom-right-radius', 'border-bottom-style', 'border-bottom-width', 'border-collapse', 'border-color', 'border-image', 'border-image-outset', 'border-image-repeat', 'border-image-slice', 'border-image-source', 'border-image-width', 'border-left', 'border-left-color', 'border-left-style', 'border-left-width', 'border-radius', 'border-right', 'border-right-color', 'border-right-style', 'border-right-width', 'border-spacing', 'border-style', 'border-top', 'border-top-color', 'border-top-left-radius', 'border-top-right-radius', 'border-top-style', 'border-top-width', 'border-width', 'bottom', 'box-decoration-break', 'box-shadow', 'box-sizing', 'break-after', 'break-before', 'break-inside', 'caption-side', 'clear', 'clip', 'clip-path', 'color', 'column-count', 'column-fill', 'column-gap', 'column-rule', 'column-rule-color', 'column-rule-style', 'column-rule-width', 'column-span', 'column-width', 'columns', 'content', 'counter-increment', 'counter-reset', 'cursor', 'direction', 'display', 'empty-cells', 'filter', 'flex', 'flex-basis', 'flex-direction', 'flex-flow', 'flex-grow', 'flex-shrink', 'flex-wrap', 'float', 'font', 'font-family', 'font-feature-settings', 'font-kerning', 'font-language-override', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-variant-ligatures', 'font-weight', 'height', 'hyphens', 'icon', 'image-orientation', 'image-rendering', 'image-resolution', 'ime-mode', 'inherit', 'initial', 'justify-content', 'left', 'letter-spacing', 'line-height', 'list-style', 'list-style-image', 'list-style-position', 'list-style-type', 'margin', 'margin-bottom', 'margin-left', 'margin-right', 'margin-top', 'marks', 'mask', 'max-height', 'max-width', 'min-height', 'min-width', 'nav-down', 'nav-index', 'nav-left', 'nav-right', 'nav-up', 'none', 'normal', 'object-fit', 'object-position', 'opacity', 'order', 'orphans', 'outline', 'outline-color', 'outline-offset', 'outline-style', 'outline-width', 'overflow', 'overflow-wrap', 'overflow-x', 'overflow-y', 'padding', 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', 'page-break-after', 'page-break-before', 'page-break-inside', 'perspective', 'perspective-origin', 'pointer-events', 'position', 'quotes', 'resize', 'right', 'tab-size', 'table-layout', 'text-align', 'text-align-last', 'text-decoration', 'text-decoration-color', 'text-decoration-line', 'text-decoration-style', 'text-indent', 'text-overflow', 'text-rendering', 'text-shadow', 'text-transform', 'text-underline-position', 'top', 'transform', 'transform-origin', 'transform-style', 'transition', 'transition-delay', 'transition-duration', 'transition-property', 'transition-timing-function', 'unicode-bidi', 'vertical-align', 'visibility', 'white-space', 'widows', 'width', 'word-break', 'word-spacing', 'word-wrap', 'z-index'];
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
'(\\
|
|
24
|
-
|
|
25
|
-
'(\\
|
|
26
|
-
|
|
27
|
-
'
|
|
28
|
-
|
|
29
|
-
'
|
|
20
|
+
// illegals
|
|
21
|
+
var ILLEGAL = ['\\?', '(\\bReturn\\b)',
|
|
22
|
+
// monkey
|
|
23
|
+
'(\\bEnd\\b)',
|
|
24
|
+
// monkey
|
|
25
|
+
'(\\bend\\b)',
|
|
26
|
+
// vbscript
|
|
27
|
+
'(\\bdef\\b)',
|
|
28
|
+
// gradle
|
|
29
|
+
';',
|
|
30
|
+
// a whole lot of languages
|
|
31
|
+
'#\\s',
|
|
32
|
+
// markdown
|
|
33
|
+
'\\*\\s',
|
|
34
|
+
// markdown
|
|
35
|
+
'===\\s',
|
|
36
|
+
// markdown
|
|
30
37
|
'\\|', '%' // prolog
|
|
31
38
|
];
|
|
39
|
+
|
|
32
40
|
return {
|
|
33
41
|
aliases: ['styl'],
|
|
34
42
|
case_insensitive: false,
|
|
35
43
|
keywords: 'if else for in',
|
|
36
44
|
illegal: '(' + ILLEGAL.join('|') + ')',
|
|
37
|
-
contains: [
|
|
38
|
-
|
|
39
|
-
hljs.
|
|
40
|
-
|
|
45
|
+
contains: [
|
|
46
|
+
// strings
|
|
47
|
+
hljs.QUOTE_STRING_MODE, hljs.APOS_STRING_MODE,
|
|
48
|
+
// comments
|
|
49
|
+
hljs.C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE,
|
|
50
|
+
// hex colors
|
|
51
|
+
HEX_COLOR,
|
|
52
|
+
// class tag
|
|
41
53
|
{
|
|
42
54
|
begin: '\\.[a-zA-Z][a-zA-Z0-9_-]*' + TAG_END,
|
|
43
55
|
returnBegin: true,
|
|
@@ -45,7 +57,8 @@ module.exports = function (hljs) {
|
|
|
45
57
|
className: 'selector-class',
|
|
46
58
|
begin: '\\.[a-zA-Z][a-zA-Z0-9_-]*'
|
|
47
59
|
}]
|
|
48
|
-
},
|
|
60
|
+
},
|
|
61
|
+
// id tag
|
|
49
62
|
{
|
|
50
63
|
begin: '\\#[a-zA-Z][a-zA-Z0-9_-]*' + TAG_END,
|
|
51
64
|
returnBegin: true,
|
|
@@ -53,7 +66,8 @@ module.exports = function (hljs) {
|
|
|
53
66
|
className: 'selector-id',
|
|
54
67
|
begin: '\\#[a-zA-Z][a-zA-Z0-9_-]*'
|
|
55
68
|
}]
|
|
56
|
-
},
|
|
69
|
+
},
|
|
70
|
+
// tags
|
|
57
71
|
{
|
|
58
72
|
begin: '\\b(' + TAGS.join('|') + ')' + TAG_END,
|
|
59
73
|
returnBegin: true,
|
|
@@ -61,16 +75,22 @@ module.exports = function (hljs) {
|
|
|
61
75
|
className: 'selector-tag',
|
|
62
76
|
begin: '\\b[a-zA-Z][a-zA-Z0-9_-]*'
|
|
63
77
|
}]
|
|
64
|
-
},
|
|
78
|
+
},
|
|
79
|
+
// psuedo selectors
|
|
65
80
|
{
|
|
66
81
|
begin: '&?:?:\\b(' + PSEUDO_SELECTORS.join('|') + ')' + TAG_END
|
|
67
|
-
},
|
|
82
|
+
},
|
|
83
|
+
// @ keywords
|
|
68
84
|
{
|
|
69
85
|
begin: '\@(' + AT_KEYWORDS.join('|') + ')\\b'
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
86
|
+
},
|
|
87
|
+
// variables
|
|
88
|
+
VARIABLE,
|
|
89
|
+
// dimension
|
|
90
|
+
hljs.CSS_NUMBER_MODE,
|
|
91
|
+
// number
|
|
92
|
+
hljs.NUMBER_MODE,
|
|
93
|
+
// functions
|
|
74
94
|
// - only from beginning of line + whitespace
|
|
75
95
|
{
|
|
76
96
|
className: 'function',
|
|
@@ -86,7 +106,8 @@ module.exports = function (hljs) {
|
|
|
86
106
|
end: /\)/,
|
|
87
107
|
contains: [HEX_COLOR, VARIABLE, hljs.APOS_STRING_MODE, hljs.CSS_NUMBER_MODE, hljs.NUMBER_MODE, hljs.QUOTE_STRING_MODE]
|
|
88
108
|
}]
|
|
89
|
-
},
|
|
109
|
+
},
|
|
110
|
+
// attributes
|
|
90
111
|
// - only from beginning of line + whitespace
|
|
91
112
|
// - must have whitespace after it
|
|
92
113
|
{
|
|
@@ -10,8 +10,8 @@ module.exports = function (hljs) {
|
|
|
10
10
|
className: 'type',
|
|
11
11
|
begin: '\\b[A-Z][\\w\u00C0-\u02B8\']*',
|
|
12
12
|
relevance: 0
|
|
13
|
-
};
|
|
14
|
-
|
|
13
|
+
};
|
|
14
|
+
// slightly more special to swift
|
|
15
15
|
var OPTIONAL_USING_TYPE = {
|
|
16
16
|
className: 'type',
|
|
17
17
|
begin: '\\b[A-Z][\\w\u00C0-\u02B8\']*[!?]'
|
|
@@ -25,8 +25,8 @@ module.exports = function (hljs) {
|
|
|
25
25
|
end: '\\)',
|
|
26
26
|
keywords: SWIFT_KEYWORDS,
|
|
27
27
|
contains: [] // assigned later
|
|
28
|
-
|
|
29
28
|
};
|
|
29
|
+
|
|
30
30
|
var STRING = {
|
|
31
31
|
className: 'string',
|
|
32
32
|
contains: [hljs.BACKSLASH_ESCAPE, SUBST],
|
|
@@ -66,6 +66,7 @@ module.exports = function (hljs) {
|
|
|
66
66
|
begin: ':'
|
|
67
67
|
} // relevance booster
|
|
68
68
|
],
|
|
69
|
+
|
|
69
70
|
illegal: /["']/
|
|
70
71
|
}],
|
|
71
72
|
illegal: /\[|%/
|