summaryrefslogtreecommitdiffstats
path: root/public/prism/prism-wren.min.js
blob: 253f45223e0d1fe6f9f74bfa846501b8bc02c467 (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
56
(Prism.languages.wren = {
  comment: [
    {
      pattern:
        /\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|\/\*(?:[^*/]|\*(?!\/)|\/(?!\*))*\*\/)*\*\/)*\*\//,
      greedy: !0,
    },
    { pattern: /(^|[^\\:])\/\/.*/, lookbehind: !0, greedy: !0 },
  ],
  'triple-quoted-string': {
    pattern: /"""[\s\S]*?"""/,
    greedy: !0,
    alias: 'string',
  },
  'string-literal': null,
  hashbang: { pattern: /^#!\/.+/, greedy: !0, alias: 'comment' },
  attribute: { pattern: /#!?[ \t\u3000]*\w+/, alias: 'keyword' },
  'class-name': [
    { pattern: /(\bclass\s+)\w+/, lookbehind: !0 },
    /\b[A-Z][a-z\d_]*\b/,
  ],
  constant: /\b[A-Z][A-Z\d_]*\b/,
  null: { pattern: /\bnull\b/, alias: 'keyword' },
  keyword:
    /\b(?:as|break|class|construct|continue|else|for|foreign|if|import|in|is|return|static|super|this|var|while)\b/,
  boolean: /\b(?:false|true)\b/,
  number: /\b(?:0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/i,
  function: /\b[a-z_]\w*(?=\s*[({])/i,
  operator: /<<|>>|[=!<>]=?|&&|\|\||[-+*/%~^&|?:]|\.{2,3}/,
  punctuation: /[\[\](){}.,;]/,
}),
  (Prism.languages.wren['string-literal'] = {
    pattern:
      /(^|[^\\"])"(?:[^\\"%]|\\[\s\S]|%(?!\()|%\((?:[^()]|\((?:[^()]|\([^)]*\))*\))*\))*"/,
    lookbehind: !0,
    greedy: !0,
    inside: {
      interpolation: {
        pattern:
          /((?:^|[^\\])(?:\\{2})*)%\((?:[^()]|\((?:[^()]|\([^)]*\))*\))*\)/,
        lookbehind: !0,
        inside: {
          expression: {
            pattern: /^(%\()[\s\S]+(?=\)$)/,
            lookbehind: !0,
            inside: Prism.languages.wren,
          },
          'interpolation-punctuation': {
            pattern: /^%\(|\)$/,
            alias: 'punctuation',
          },
        },
      },
      string: /[\s\S]+/,
    },
  });