1 | Prism.languages.maxscript = {
|
2 | 'comment': {
|
3 | pattern: /\/\*[\s\S]*?(?:\*\/|$)|--.*/,
|
4 | greedy: true
|
5 | },
|
6 | 'string': {
|
7 | pattern: /(^|[^"\\@])(?:"(?:[^"\\]|\\[\s\S])*"|@"[^"]*")/,
|
8 | lookbehind: true,
|
9 | greedy: true
|
10 | },
|
11 | 'path': {
|
12 | pattern: /\$(?:[\w/\\.*?]|'[^']*')*/,
|
13 | greedy: true,
|
14 | alias: 'string'
|
15 | },
|
16 |
|
17 | 'function-definition': {
|
18 | pattern: /(\b(?:function|fn)\s+)\w+\b/,
|
19 | lookbehind: true,
|
20 | alias: 'function'
|
21 | },
|
22 |
|
23 | 'argument': {
|
24 | pattern: /\b[a-z_]\w*(?=:)/i,
|
25 | alias: 'attr-name'
|
26 | },
|
27 |
|
28 | 'keyword': /\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,
|
29 | 'boolean': /\b(?:true|false|on|off)\b/,
|
30 |
|
31 | 'time': {
|
32 | pattern: /(^|[^\w.])(?:(?:(?:\d+(?:\.\d*)?|\.\d+)(?:[eEdD][+-]\d+|[LP])?[msft])+|\d+:\d+(?:\.\d*)?)(?![\w.:])/,
|
33 | lookbehind: true,
|
34 | alias: 'number'
|
35 | },
|
36 | 'number': [
|
37 | {
|
38 | pattern: /(^|[^\w.])(?:(?:\d+(?:\.\d*)?|\.\d+)(?:[eEdD][+-]\d+|[LP])?|0x[a-fA-F0-9]+)(?![\w.:])/,
|
39 | lookbehind: true
|
40 | },
|
41 | /\b(?:e|pi)\b/
|
42 | ],
|
43 |
|
44 | 'constant': /\b(?:black|blue|brown|gray|green|orange|red|white|yellow)\b/,
|
45 | 'color': {
|
46 | pattern: /\b(?:dontcollect|ok|silentValue|undefined|unsupplied)\b/i,
|
47 | alias: 'constant'
|
48 | },
|
49 |
|
50 | 'operator': /[-+*/<>=!]=?|[&^]|#(?!\()/,
|
51 | 'punctuation': /[()\[\]{}.:,;]|#(?=\()|\\$/m
|
52 | };
|