Skip to content

Commit 384132a

Browse files
authored
Merge branch 'main' into multi_class_highlight
2 parents 9a9bbb6 + 396e6db commit 384132a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+7059
-1005
lines changed

CHANGES.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,30 @@ Parser:
77

88
Grammars:
99

10+
- chore(properties) disable auto-detection #3102 [Josh Goebel][]
11+
- fix(properties) fix incorrect handling of non-alphanumeric keys #3102 [Egor Rogov][]
1012
- enh(shell) add alias ShellSession [Ryan Mulligan][]
1113
- enh(shell) consider one space after prompt as part of prompt [Ryan Mulligan][]
1214
- fix(nginx) fix bug with $ and @ variables [Josh Goebel][]
1315
- enh(nginx) improving highlighting of some sections [Josh Goebel][]
1416
- fix(vim) variable names may not be zero length [Josh Goebel][]
17+
- enh(sqf) Updated keywords to Arma 3 v2.02 (#3084) [R3voA3][]
18+
- enh(nim) highlight types properly (not as built-ins) [Josh Goebel][]
19+
- (chore) throttle deprecation messages (#3092) [Mihkel Eidast][]
20+
- enh(c) Update keyword list for C11/C18 (#3010) [Josh Goebel][]
21+
22+
New Languages:
23+
24+
- Added 3rd party Splunk search processing language grammar to SUPPORTED_LANGUAGES (#3090) [Wei Su][]
1525

1626
Theme Improvements:
1727

1828
- chore(theme) Update GitHub theme css to match GitHub's current styling (#1616) [Jan Pilzer][]
1929

2030
[Josh Goebel]: https://github.com/joshgoebel
2131
[Ryan Mulligan]: https://github.com/ryantm
22-
32+
[R3voA3]: https://github.com/R3voA3
33+
[Wei Su]: https://github.com/swsoyee
2334

2435
## Version 10.7.1
2536

SUPPORTED_LANGUAGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ Languages that listed a **Package** below are 3rd party languages and are not bu
180180
| Smalltalk | smalltalk, st | |
181181
| SML | sml, ml | |
182182
| Solidity | solidity, sol | [highlightjs-solidity](https://github.com/highlightjs/highlightjs-solidity) |
183+
| Splunk SPL | spl | [highlightjs-spl](https://github.com/swsoyee/highlightjs-spl) |
183184
| Stan | stan, stanfuncs | |
184185
| Stata | stata | |
185186
| Structured Text | iecst, scl, stl, structured-text | [highlightjs-structured-text](https://github.com/highlightjs/highlightjs-structured-text) |

src/languages/abnf.js

+27-24
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@ import * as regex from '../lib/regex.js';
99

1010
/** @type LanguageFn */
1111
export default function(hljs) {
12-
const regexes = {
13-
ruleDeclaration: /^[a-zA-Z][a-zA-Z0-9-]*/,
14-
unexpectedChars: /[!@#$^&',?+~`|:]/
15-
};
12+
const IDENT = /^[a-zA-Z][a-zA-Z0-9-]*/;
1613

17-
const keywords = [
14+
const KEYWORDS = [
1815
"ALPHA",
1916
"BIT",
2017
"CHAR",
@@ -33,44 +30,50 @@ export default function(hljs) {
3330
"WSP"
3431
];
3532

36-
const commentMode = hljs.COMMENT(/;/, /$/);
33+
const COMMENT = hljs.COMMENT(/;/, /$/);
3734

38-
const terminalBinaryMode = {
35+
const TERMINAL_BINARY = {
3936
className: "symbol",
40-
begin: /%b[0-1]+(-[0-1]+|(\.[0-1]+)+){0,1}/
37+
match: /%b[0-1]+(-[0-1]+|(\.[0-1]+)+)?/
4138
};
4239

43-
const terminalDecimalMode = {
40+
const TERMINAL_DECIMAL = {
4441
className: "symbol",
45-
begin: /%d[0-9]+(-[0-9]+|(\.[0-9]+)+){0,1}/
42+
match: /%d[0-9]+(-[0-9]+|(\.[0-9]+)+)?/
4643
};
4744

48-
const terminalHexadecimalMode = {
45+
const TERMINAL_HEXADECIMAL = {
4946
className: "symbol",
50-
begin: /%x[0-9A-F]+(-[0-9A-F]+|(\.[0-9A-F]+)+){0,1}/
47+
match: /%x[0-9A-F]+(-[0-9A-F]+|(\.[0-9A-F]+)+)?/
5148
};
5249

53-
const caseSensitivityIndicatorMode = {
50+
const CASE_SENSITIVITY = {
5451
className: "symbol",
55-
begin: /%[si]/
52+
match: /%[si](?=".*")/
5653
};
5754

58-
const ruleDeclarationMode = {
55+
const RULE_DECLARATION = {
5956
className: "attribute",
60-
begin: regex.concat(regexes.ruleDeclaration, /(?=\s*=)/)
57+
match: regex.concat(IDENT, /(?=\s*=)/)
58+
};
59+
60+
const ASSIGNMENT = {
61+
className: "operator",
62+
match: /=\/?/
6163
};
6264

6365
return {
6466
name: 'Augmented Backus-Naur Form',
65-
illegal: regexes.unexpectedChars,
66-
keywords: keywords,
67+
illegal: /[!@#$^&',?+~`|:]/,
68+
keywords: KEYWORDS,
6769
contains: [
68-
ruleDeclarationMode,
69-
commentMode,
70-
terminalBinaryMode,
71-
terminalDecimalMode,
72-
terminalHexadecimalMode,
73-
caseSensitivityIndicatorMode,
70+
ASSIGNMENT,
71+
RULE_DECLARATION,
72+
COMMENT,
73+
TERMINAL_BINARY,
74+
TERMINAL_DECIMAL,
75+
TERMINAL_HEXADECIMAL,
76+
CASE_SENSITIVITY,
7477
hljs.QUOTE_STRING_MODE,
7578
hljs.NUMBER_MODE
7679
]

src/languages/actionscript.js

+61-6
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,71 @@ export default function(hljs) {
1919
relevance: 10
2020
};
2121

22+
const KEYWORDS = [
23+
"as",
24+
"break",
25+
"case",
26+
"catch",
27+
"class",
28+
"const",
29+
"continue",
30+
"default",
31+
"delete",
32+
"do",
33+
"dynamic",
34+
"each",
35+
"else",
36+
"extends",
37+
"final",
38+
"finally",
39+
"for",
40+
"function",
41+
"get",
42+
"if",
43+
"implements",
44+
"import",
45+
"in",
46+
"include",
47+
"instanceof",
48+
"interface",
49+
"internal",
50+
"is",
51+
"namespace",
52+
"native",
53+
"new",
54+
"override",
55+
"package",
56+
"private",
57+
"protected",
58+
"public",
59+
"return",
60+
"set",
61+
"static",
62+
"super",
63+
"switch",
64+
"this",
65+
"throw",
66+
"try",
67+
"typeof",
68+
"use",
69+
"var",
70+
"void",
71+
"while",
72+
"with"
73+
];
74+
const LITERALS = [
75+
"true",
76+
"false",
77+
"null",
78+
"undefined"
79+
];
80+
2281
return {
2382
name: 'ActionScript',
2483
aliases: [ 'as' ],
2584
keywords: {
26-
keyword: 'as break case catch class const continue default delete do dynamic each ' +
27-
'else extends final finally for function get if implements import in include ' +
28-
'instanceof interface internal is namespace native new override package private ' +
29-
'protected public return set static super switch this throw try typeof use var void ' +
30-
'while with',
31-
literal: 'true false null undefined'
85+
keyword: KEYWORDS,
86+
literal: LITERALS
3287
},
3388
contains: [
3489
hljs.APOS_STRING_MODE,

src/languages/ada.js

+79-10
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,89 @@ export default function(hljs) {
7575
]
7676
};
7777

78+
const KEYWORDS = [
79+
"abort",
80+
"else",
81+
"new",
82+
"return",
83+
"abs",
84+
"elsif",
85+
"not",
86+
"reverse",
87+
"abstract",
88+
"end",
89+
"accept",
90+
"entry",
91+
"select",
92+
"access",
93+
"exception",
94+
"of",
95+
"separate",
96+
"aliased",
97+
"exit",
98+
"or",
99+
"some",
100+
"all",
101+
"others",
102+
"subtype",
103+
"and",
104+
"for",
105+
"out",
106+
"synchronized",
107+
"array",
108+
"function",
109+
"overriding",
110+
"at",
111+
"tagged",
112+
"generic",
113+
"package",
114+
"task",
115+
"begin",
116+
"goto",
117+
"pragma",
118+
"terminate",
119+
"body",
120+
"private",
121+
"then",
122+
"if",
123+
"procedure",
124+
"type",
125+
"case",
126+
"in",
127+
"protected",
128+
"constant",
129+
"interface",
130+
"is",
131+
"raise",
132+
"use",
133+
"declare",
134+
"range",
135+
"delay",
136+
"limited",
137+
"record",
138+
"when",
139+
"delta",
140+
"loop",
141+
"rem",
142+
"while",
143+
"digits",
144+
"renames",
145+
"with",
146+
"do",
147+
"mod",
148+
"requeue",
149+
"xor"
150+
];
151+
78152
return {
79153
name: 'Ada',
80154
case_insensitive: true,
81155
keywords: {
82-
keyword:
83-
'abort else new return abs elsif not reverse abstract end ' +
84-
'accept entry select access exception of separate aliased exit or some ' +
85-
'all others subtype and for out synchronized array function overriding ' +
86-
'at tagged generic package task begin goto pragma terminate ' +
87-
'body private then if procedure type case in protected constant interface ' +
88-
'is raise use declare range delay limited record when delta loop rem while ' +
89-
'digits renames with do mod requeue xor',
90-
literal:
91-
'True False'
156+
keyword: KEYWORDS,
157+
literal: [
158+
"True",
159+
"False"
160+
]
92161
},
93162
contains: [
94163
COMMENTS,

src/languages/angelscript.js

+50-5
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,60 @@ export default function(hljs) {
3030
builtInTypeMode.contains = [ genericMode ];
3131
objectHandleMode.contains = [ genericMode ];
3232

33+
const KEYWORDS = [
34+
"for",
35+
"in|0",
36+
"break",
37+
"continue",
38+
"while",
39+
"do|0",
40+
"return",
41+
"if",
42+
"else",
43+
"case",
44+
"switch",
45+
"namespace",
46+
"is",
47+
"cast",
48+
"or",
49+
"and",
50+
"xor",
51+
"not",
52+
"get|0",
53+
"in",
54+
"inout|10",
55+
"out",
56+
"override",
57+
"set|0",
58+
"private",
59+
"public",
60+
"const",
61+
"default|0",
62+
"final",
63+
"shared",
64+
"external",
65+
"mixin|10",
66+
"enum",
67+
"typedef",
68+
"funcdef",
69+
"this",
70+
"super",
71+
"import",
72+
"from",
73+
"interface",
74+
"abstract|0",
75+
"try",
76+
"catch",
77+
"protected",
78+
"explicit",
79+
"property"
80+
];
81+
3382
return {
3483
name: 'AngelScript',
3584
aliases: [ 'asc' ],
3685

37-
keywords:
38-
'for in|0 break continue while do|0 return if else case switch namespace is cast ' +
39-
'or and xor not get|0 in inout|10 out override set|0 private public const default|0 ' +
40-
'final shared external mixin|10 enum typedef funcdef this super import from interface ' +
41-
'abstract|0 try catch protected explicit property',
86+
keywords: KEYWORDS,
4287

4388
// avoid close detection with C# and JS
4489
illegal: '(^using\\s+[A-Za-z0-9_\\.]+;$|\\bfunction\\s*[^\\(])',

src/languages/apache.js

+18-4
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,24 @@ export default function(hljs) {
5151
// keywords aren’t needed for highlighting per se, they only boost relevance
5252
// for a very generally defined mode (starts with a word, ends with line-end
5353
keywords: {
54-
nomarkup:
55-
'order deny allow setenv rewriterule rewriteengine rewritecond documentroot ' +
56-
'sethandler errordocument loadmodule options header listen serverroot ' +
57-
'servername'
54+
_: [
55+
"order",
56+
"deny",
57+
"allow",
58+
"setenv",
59+
"rewriterule",
60+
"rewriteengine",
61+
"rewritecond",
62+
"documentroot",
63+
"sethandler",
64+
"errordocument",
65+
"loadmodule",
66+
"options",
67+
"header",
68+
"listen",
69+
"serverroot",
70+
"servername"
71+
]
5872
},
5973
starts: {
6074
end: /$/,

0 commit comments

Comments
 (0)