-
-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathpcaxis.js
64 lines (63 loc) · 1.48 KB
/
pcaxis.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// @ts-nocheck
/**
* @import {Refractor} from '../lib/core.js'
*/
pcaxis.displayName = 'pcaxis'
pcaxis.aliases = ['px']
/** @param {Refractor} Prism */
export default function pcaxis(Prism) {
Prism.languages.pcaxis = {
string: /"[^"]*"/,
keyword: {
pattern:
/((?:^|;)\s*)[-A-Z\d]+(?:\s*\[[-\w]+\])?(?:\s*\("[^"]*"(?:,\s*"[^"]*")*\))?(?=\s*=)/,
lookbehind: true,
greedy: true,
inside: {
keyword: /^[-A-Z\d]+/,
language: {
pattern: /^(\s*)\[[-\w]+\]/,
lookbehind: true,
inside: {
punctuation: /^\[|\]$/,
property: /[-\w]+/
}
},
'sub-key': {
pattern: /^(\s*)\S[\s\S]*/,
lookbehind: true,
inside: {
parameter: {
pattern: /"[^"]*"/,
alias: 'property'
},
punctuation: /^\(|\)$|,/
}
}
}
},
operator: /=/,
tlist: {
pattern:
/TLIST\s*\(\s*\w+(?:(?:\s*,\s*"[^"]*")+|\s*,\s*"[^"]*"-"[^"]*")?\s*\)/,
greedy: true,
inside: {
function: /^TLIST/,
property: {
pattern: /^(\s*\(\s*)\w+/,
lookbehind: true
},
string: /"[^"]*"/,
punctuation: /[(),]/,
operator: /-/
}
},
punctuation: /[;,]/,
number: {
pattern: /(^|\s)\d+(?:\.\d+)?(?!\S)/,
lookbehind: true
},
boolean: /NO|YES/
}
Prism.languages.px = Prism.languages.pcaxis
}