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-maxscript.min.js | 55 +++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 public/prism/prism-maxscript.min.js (limited to 'public/prism/prism-maxscript.min.js') diff --git a/public/prism/prism-maxscript.min.js b/public/prism/prism-maxscript.min.js new file mode 100644 index 0000000..22af7d9 --- /dev/null +++ b/public/prism/prism-maxscript.min.js @@ -0,0 +1,55 @@ +!(function (t) { + var e = + /\b(?:about|and|animate|as|at|attributes|by|case|catch|collect|continue|coordsys|do|else|exit|fn|for|from|function|global|if|in|local|macroscript|mapped|max|not|of|off|on|or|parameters|persistent|plugin|rcmenu|return|rollout|set|struct|then|throw|to|tool|try|undo|utility|when|where|while|with)\b/i; + Prism.languages.maxscript = { + comment: { pattern: /\/\*[\s\S]*?(?:\*\/|$)|--.*/, greedy: !0 }, + string: { + pattern: /(^|[^"\\@])(?:"(?:[^"\\]|\\[\s\S])*"|@"[^"]*")/, + lookbehind: !0, + greedy: !0, + }, + path: { pattern: /\$(?:[\w/\\.*?]|'[^']*')*/, greedy: !0, alias: 'string' }, + 'function-call': { + pattern: RegExp( + '((?:^|[;=<>+\\-*/^({\\[]|\\b(?:and|by|case|catch|collect|do|else|if|in|not|or|return|then|to|try|where|while|with)\\b)[ \t]*)(?!' + + e.source + + ')[a-z_]\\w*\\b(?=[ \t]*(?:(?!' + + e.source + + ')[a-z_]|\\d|-\\.?\\d|[({\'"$@#?]))', + 'im' + ), + lookbehind: !0, + greedy: !0, + alias: 'function', + }, + 'function-definition': { + pattern: /(\b(?:fn|function)\s+)\w+\b/i, + lookbehind: !0, + alias: 'function', + }, + argument: { pattern: /\b[a-z_]\w*(?=:)/i, alias: 'attr-name' }, + keyword: e, + boolean: /\b(?:false|true)\b/, + time: { + pattern: + /(^|[^\w.])(?:(?:(?:\d+(?:\.\d*)?|\.\d+)(?:[eEdD][+-]\d+|[LP])?[msft])+|\d+:\d+(?:\.\d*)?)(?![\w.:])/, + lookbehind: !0, + alias: 'number', + }, + number: [ + { + pattern: + /(^|[^\w.])(?:(?:\d+(?:\.\d*)?|\.\d+)(?:[eEdD][+-]\d+|[LP])?|0x[a-fA-F0-9]+)(?![\w.:])/, + lookbehind: !0, + }, + /\b(?:e|pi)\b/, + ], + constant: /\b(?:dontcollect|ok|silentValue|undefined|unsupplied)\b/, + color: { + pattern: /\b(?:black|blue|brown|gray|green|orange|red|white|yellow)\b/i, + alias: 'constant', + }, + operator: /[-+*/<>=!]=?|[&^?]|#(?!\()/, + punctuation: /[()\[\]{}.:,;]|#(?=\()|\\$/m, + }; +})(); -- cgit v1.2.3