@@ -13,34 +13,6 @@ import swift from 'highlight.js/lib/languages/swift';
13
13
export default function swiftOverride ( hljs ) {
14
14
const language = swift ( hljs ) ;
15
15
16
- // Temporarily patch the Swift language syntax to recognize `distributed` as
17
- // a keyword until the next version of highlight.js (v11.6) is released, which
18
- // will have built-in support for this [1]
19
- //
20
- // [1]: https://github.com/highlightjs/highlight.js/pull/3523
21
- language . keywords . keyword = [
22
- ...language . keywords . keyword ,
23
- 'distributed' ,
24
- ] ;
25
-
26
- const isClassMode = ( { beginKeywords = '' } ) => beginKeywords
27
- . split ( ' ' )
28
- . includes ( 'class' ) ;
29
- const classModeIndex = language . contains . findIndex ( isClassMode ) ;
30
- if ( classModeIndex >= 0 ) {
31
- const {
32
- beginKeywords, // purposefully strip this out
33
- ...classMode
34
- } = language . contains [ classModeIndex ] ;
35
- // Update the existing "class" mode by replacing the `beginKeywords` with
36
- // a `begin` regular expression, which is careful not to mistakenly
37
- // recognize class function declarations as class declarations
38
- language . contains [ classModeIndex ] = {
39
- ...classMode ,
40
- begin : / \b ( s t r u c t | p r o t o c o l | e x t e n s i o n | e n u m | a c t o r | c l a s s \b (? ! .* \b f u n c ) ) \b / ,
41
- } ;
42
- }
43
-
44
16
// Checks if a given language sub-mode matches the "ESCAPED_NEWLINE" from the
45
17
// built-in Swift parser from hljs
46
18
const isEscapedNewlineMode = ( mode ) => {
0 commit comments