diff options
| author | Armand Philippot <git@armandphilippot.com> | 2021-12-30 19:47:21 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2021-12-30 19:47:21 +0100 |
| commit | a98b5ea6fe8e8cc98a55e0fd793e6e8660ea31c1 (patch) | |
| tree | 542810ab5aef99150db228bb54fd58303dcb31c7 /public/prism/prism-pascaligo.min.js | |
| parent | ab355897a12b7bda1089a44de326d41455a0f7a3 (diff) | |
chore: add prismjs for syntax highlighting
Diffstat (limited to 'public/prism/prism-pascaligo.min.js')
| -rw-r--r-- | public/prism/prism-pascaligo.min.js | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/public/prism/prism-pascaligo.min.js b/public/prism/prism-pascaligo.min.js new file mode 100644 index 0000000..b7d55db --- /dev/null +++ b/public/prism/prism-pascaligo.min.js @@ -0,0 +1,69 @@ +!(function (e) { + var n = '(?:\\b\\w+(?:<braces>)?|<braces>)'.replace(/<braces>/g, function () { + return '\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)'; + }), + t = (e.languages.pascaligo = { + comment: /\(\*[\s\S]+?\*\)|\/\/.*/, + string: { + pattern: /(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1|\^[a-z]/i, + greedy: !0, + }, + 'class-name': [ + { + pattern: RegExp( + '(\\btype\\s+\\w+\\s+is\\s+)<type>'.replace(/<type>/g, function () { + return n; + }), + 'i' + ), + lookbehind: !0, + inside: null, + }, + { + pattern: RegExp( + '<type>(?=\\s+is\\b)'.replace(/<type>/g, function () { + return n; + }), + 'i' + ), + inside: null, + }, + { + pattern: RegExp( + '(:\\s*)<type>'.replace(/<type>/g, function () { + return n; + }) + ), + lookbehind: !0, + inside: null, + }, + ], + keyword: { + pattern: + /(^|[^&])\b(?:begin|block|case|const|else|end|fail|for|from|function|if|is|nil|of|remove|return|skip|then|type|var|while|with)\b/i, + lookbehind: !0, + }, + boolean: { pattern: /(^|[^&])\b(?:False|True)\b/i, lookbehind: !0 }, + builtin: { + pattern: /(^|[^&])\b(?:bool|int|list|map|nat|record|string|unit)\b/i, + lookbehind: !0, + }, + function: /\b\w+(?=\s*\()/, + number: [ + /%[01]+|&[0-7]+|\$[a-f\d]+/i, + /\b\d+(?:\.\d+)?(?:e[+-]?\d+)?(?:mtz|n)?/i, + ], + operator: + /->|=\/=|\.\.|\*\*|:=|<[<=>]?|>[>=]?|[+\-*\/]=?|[@^=|]|\b(?:and|mod|or)\b/, + punctuation: /\(\.|\.\)|[()\[\]:;,.{}]/, + }), + i = ['comment', 'keyword', 'builtin', 'operator', 'punctuation'].reduce( + function (e, n) { + return (e[n] = t[n]), e; + }, + {} + ); + t['class-name'].forEach(function (e) { + e.inside = i; + }); +})(Prism); |
