aboutsummaryrefslogtreecommitdiffstats
path: root/public/prism/prism-maxscript.min.js
blob: 9e9dbf95123e17c039fd4ddc625f917a1772736a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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;
  t.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,
  };
})(Prism);