From a98b5ea6fe8e8cc98a55e0fd793e6e8660ea31c1 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Thu, 30 Dec 2021 19:47:21 +0100 Subject: chore: add prismjs for syntax highlighting --- public/prism/prism-apl.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 public/prism/prism-apl.js (limited to 'public/prism/prism-apl.js') diff --git a/public/prism/prism-apl.js b/public/prism/prism-apl.js new file mode 100644 index 0000000..8e63023 --- /dev/null +++ b/public/prism/prism-apl.js @@ -0,0 +1,33 @@ +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', + }, +}; -- cgit v1.2.3