-
-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathapl.js
40 lines (39 loc) · 1.1 KB
/
apl.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
// @ts-nocheck
apl.displayName = 'apl'
apl.aliases = []
/** @type {import('../core.js').Syntax} */
export default function apl(Prism) {
Prism.languages.apl = {
comment: /(?:⍝|#[! ]).*$/m,
string: {
pattern: /'(?:[^'\r\n]|'')*'/,
greedy: true
},
number:
/¯?(?:\d*\.?\b\d+(?:e[+¯]?\d+)?|¯|∞)(?:j¯?(?:(?:\d+(?:\.\d+)?|\.\d+)(?:e[+¯]?\d+)?|¯|∞))?/i,
statement: /:[A-Z][a-z][A-Za-z]*\b/,
'system-function': {
pattern: /⎕[A-Z]+/i,
alias: 'function'
},
constant: /[⍬⌾#⎕⍞]/,
function: /[-+×÷⌈⌊∣|⍳⍸?*⍟○!⌹<≤=>≥≠≡≢∊⍷∪∩~∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⊆⊇⌷⍋⍒⊤⊥⍕⍎⊣⊢⍁⍂≈⍯↗¤→]/,
'monadic-operator': {
pattern: /[\\\/⌿⍀¨⍨⌶&∥]/,
alias: 'operator'
},
'dyadic-operator': {
pattern: /[.⍣⍠⍤∘⌸@⌺⍥]/,
alias: 'operator'
},
assignment: {
pattern: /←/,
alias: 'keyword'
},
punctuation: /[\[;\]()◇⋄]/,
dfn: {
pattern: /[{}⍺⍵⍶⍹∇⍫:]/,
alias: 'builtin'
}
}
}