summaryrefslogtreecommitdiffstats
path: root/public/prism/prism-moonscript.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-moonscript.min.js
parentab355897a12b7bda1089a44de326d41455a0f7a3 (diff)
chore: add prismjs for syntax highlighting
Diffstat (limited to 'public/prism/prism-moonscript.min.js')
-rw-r--r--public/prism/prism-moonscript.min.js48
1 files changed, 48 insertions, 0 deletions
diff --git a/public/prism/prism-moonscript.min.js b/public/prism/prism-moonscript.min.js
new file mode 100644
index 0000000..75fb04b
--- /dev/null
+++ b/public/prism/prism-moonscript.min.js
@@ -0,0 +1,48 @@
+(Prism.languages.moonscript = {
+ comment: /--.*/,
+ string: [
+ { pattern: /'[^']*'|\[(=*)\[[\s\S]*?\]\1\]/, greedy: !0 },
+ {
+ pattern: /"[^"]*"/,
+ greedy: !0,
+ inside: {
+ interpolation: {
+ pattern: /#\{[^{}]*\}/,
+ inside: {
+ moonscript: {
+ pattern: /(^#\{)[\s\S]+(?=\})/,
+ lookbehind: !0,
+ inside: null,
+ },
+ 'interpolation-punctuation': {
+ pattern: /#\{|\}/,
+ alias: 'punctuation',
+ },
+ },
+ },
+ },
+ },
+ ],
+ 'class-name': [
+ { pattern: /(\b(?:class|extends)[ \t]+)\w+/, lookbehind: !0 },
+ /\b[A-Z]\w*/,
+ ],
+ keyword:
+ /\b(?:class|continue|do|else|elseif|export|extends|for|from|if|import|in|local|nil|return|self|super|switch|then|unless|using|when|while|with)\b/,
+ variable: /@@?\w*/,
+ property: { pattern: /\b(?!\d)\w+(?=:)|(:)(?!\d)\w+/, lookbehind: !0 },
+ function: {
+ pattern:
+ /\b(?:_G|_VERSION|assert|collectgarbage|coroutine\.(?:create|resume|running|status|wrap|yield)|debug\.(?:debug|getfenv|gethook|getinfo|getlocal|getmetatable|getregistry|getupvalue|setfenv|sethook|setlocal|setmetatable|setupvalue|traceback)|dofile|error|getfenv|getmetatable|io\.(?:close|flush|input|lines|open|output|popen|read|stderr|stdin|stdout|tmpfile|type|write)|ipairs|load|loadfile|loadstring|math\.(?:abs|acos|asin|atan|atan2|ceil|cos|cosh|deg|exp|floor|fmod|frexp|ldexp|log|log10|max|min|modf|pi|pow|rad|random|randomseed|sin|sinh|sqrt|tan|tanh)|module|next|os\.(?:clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)|package\.(?:cpath|loaded|loadlib|path|preload|seeall)|pairs|pcall|print|rawequal|rawget|rawset|require|select|setfenv|setmetatable|string\.(?:byte|char|dump|find|format|gmatch|gsub|len|lower|match|rep|reverse|sub|upper)|table\.(?:concat|insert|maxn|remove|sort)|tonumber|tostring|type|unpack|xpcall)\b/,
+ inside: { punctuation: /\./ },
+ },
+ boolean: /\b(?:false|true)\b/,
+ number:
+ /(?:\B\.\d+|\b\d+\.\d+|\b\d+(?=[eE]))(?:[eE][-+]?\d+)?\b|\b(?:0x[a-fA-F\d]+|\d+)(?:U?LL)?\b/,
+ operator:
+ /\.{3}|[-=]>|~=|(?:[-+*/%<>!=]|\.\.)=?|[:#^]|\b(?:and|or)\b=?|\b(?:not)\b/,
+ punctuation: /[.,()[\]{}\\]/,
+}),
+ (Prism.languages.moonscript.string[1].inside.interpolation.inside.moonscript.inside =
+ Prism.languages.moonscript),
+ (Prism.languages.moon = Prism.languages.moonscript);