summaryrefslogtreecommitdiffstats
path: root/public/prism/prism-elixir.min.js
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2021-12-30 19:47:21 +0100
committerArmand Philippot <git@armandphilippot.com>2021-12-30 19:47:21 +0100
commita98b5ea6fe8e8cc98a55e0fd793e6e8660ea31c1 (patch)
tree542810ab5aef99150db228bb54fd58303dcb31c7 /public/prism/prism-elixir.min.js
parentab355897a12b7bda1089a44de326d41455a0f7a3 (diff)
chore: add prismjs for syntax highlighting
Diffstat (limited to 'public/prism/prism-elixir.min.js')
-rw-r--r--public/prism/prism-elixir.min.js54
1 files changed, 54 insertions, 0 deletions
diff --git a/public/prism/prism-elixir.min.js b/public/prism/prism-elixir.min.js
new file mode 100644
index 0000000..b6138e9
--- /dev/null
+++ b/public/prism/prism-elixir.min.js
@@ -0,0 +1,54 @@
+(Prism.languages.elixir = {
+ doc: {
+ pattern:
+ /@(?:doc|moduledoc)\s+(?:("""|''')[\s\S]*?\1|("|')(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2)/,
+ inside: { attribute: /^@\w+/, string: /['"][\s\S]+/ },
+ },
+ comment: { pattern: /#.*/, greedy: !0 },
+ regex: {
+ pattern:
+ /~[rR](?:("""|''')(?:\\[\s\S]|(?!\1)[^\\])+\1|([\/|"'])(?:\\.|(?!\2)[^\\\r\n])+\2|\((?:\\.|[^\\)\r\n])+\)|\[(?:\\.|[^\\\]\r\n])+\]|\{(?:\\.|[^\\}\r\n])+\}|<(?:\\.|[^\\>\r\n])+>)[uismxfr]*/,
+ greedy: !0,
+ },
+ string: [
+ {
+ pattern:
+ /~[cCsSwW](?:("""|''')(?:\\[\s\S]|(?!\1)[^\\])+\1|([\/|"'])(?:\\.|(?!\2)[^\\\r\n])+\2|\((?:\\.|[^\\)\r\n])+\)|\[(?:\\.|[^\\\]\r\n])+\]|\{(?:\\.|#\{[^}]+\}|#(?!\{)|[^#\\}\r\n])+\}|<(?:\\.|[^\\>\r\n])+>)[csa]?/,
+ greedy: !0,
+ inside: {},
+ },
+ { pattern: /("""|''')[\s\S]*?\1/, greedy: !0, inside: {} },
+ {
+ pattern: /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
+ greedy: !0,
+ inside: {},
+ },
+ ],
+ atom: { pattern: /(^|[^:]):\w+/, lookbehind: !0, alias: 'symbol' },
+ module: { pattern: /\b[A-Z]\w*\b/, alias: 'class-name' },
+ 'attr-name': /\b\w+\??:(?!:)/,
+ argument: { pattern: /(^|[^&])&\d+/, lookbehind: !0, alias: 'variable' },
+ attribute: { pattern: /@\w+/, alias: 'variable' },
+ function: /\b[_a-zA-Z]\w*[?!]?(?:(?=\s*(?:\.\s*)?\()|(?=\/\d))/,
+ number: /\b(?:0[box][a-f\d_]+|\d[\d_]*)(?:\.[\d_]+)?(?:e[+-]?[\d_]+)?\b/i,
+ keyword:
+ /\b(?:after|alias|and|case|catch|cond|def(?:callback|delegate|exception|impl|macro|module|n|np|p|protocol|struct)?|do|else|end|fn|for|if|import|not|or|quote|raise|require|rescue|try|unless|unquote|use|when)\b/,
+ boolean: /\b(?:false|nil|true)\b/,
+ operator: [
+ /\bin\b|&&?|\|[|>]?|\\\\|::|\.\.\.?|\+\+?|-[->]?|<[-=>]|>=|!==?|\B!|=(?:==?|[>~])?|[*\/^]/,
+ { pattern: /([^<])<(?!<)/, lookbehind: !0 },
+ { pattern: /([^>])>(?!>)/, lookbehind: !0 },
+ ],
+ punctuation: /<<|>>|[.,%\[\]{}()]/,
+}),
+ Prism.languages.elixir.string.forEach(function (e) {
+ e.inside = {
+ interpolation: {
+ pattern: /#\{[^}]+\}/,
+ inside: {
+ delimiter: { pattern: /^#\{|\}$/, alias: 'punctuation' },
+ rest: Prism.languages.elixir,
+ },
+ },
+ };
+ });