aboutsummaryrefslogtreecommitdiffstats
path: root/public/prism/prism-rego.min.js
blob: f53ac19d155bf4cd707fcc3e131b23e5d1ff3049 (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
Prism.languages.rego = {
  comment: /#.*/,
  property: {
    pattern:
      /(^|[^\\.])(?:"(?:\\.|[^\\"\r\n])*"|`[^`]*`|\b[a-z_]\w*\b)(?=\s*:(?!=))/i,
    lookbehind: !0,
    greedy: !0,
  },
  string: {
    pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"|`[^`]*`/,
    lookbehind: !0,
    greedy: !0,
  },
  keyword:
    /\b(?:as|default|else|import|not|null|package|set(?=\s*\()|some|with)\b/,
  boolean: /\b(?:false|true)\b/,
  function: {
    pattern: /\b[a-z_]\w*\b(?:\s*\.\s*\b[a-z_]\w*\b)*(?=\s*\()/i,
    inside: { namespace: /\b\w+\b(?=\s*\.)/, punctuation: /\./ },
  },
  number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
  operator: /[-+*/%|&]|[<>:=]=?|!=|\b_\b/,
  punctuation: /[,;.\[\]{}()]/,
};