main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
764 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | // https://www.openpolicyagent.org/docs/latest/policy-reference/
|
---|
| 2 |
|
---|
| 3 | Prism.languages.rego = {
|
---|
| 4 | 'comment': /#.*/,
|
---|
| 5 | 'property': {
|
---|
| 6 | pattern: /(^|[^\\.])(?:"(?:\\.|[^\\"\r\n])*"|`[^`]*`|\b[a-z_]\w*\b)(?=\s*:(?!=))/i,
|
---|
| 7 | lookbehind: true,
|
---|
| 8 | greedy: true
|
---|
| 9 | },
|
---|
| 10 | 'string': {
|
---|
| 11 | pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"|`[^`]*`/,
|
---|
| 12 | lookbehind: true,
|
---|
| 13 | greedy: true
|
---|
| 14 | },
|
---|
| 15 |
|
---|
| 16 | 'keyword': /\b(?:as|default|else|import|not|null|package|set(?=\s*\()|some|with)\b/,
|
---|
| 17 | 'boolean': /\b(?:false|true)\b/,
|
---|
| 18 |
|
---|
| 19 | 'function': {
|
---|
| 20 | pattern: /\b[a-z_]\w*\b(?:\s*\.\s*\b[a-z_]\w*\b)*(?=\s*\()/i,
|
---|
| 21 | inside: {
|
---|
| 22 | 'namespace': /\b\w+\b(?=\s*\.)/,
|
---|
| 23 | 'punctuation': /\./
|
---|
| 24 | }
|
---|
| 25 | },
|
---|
| 26 |
|
---|
| 27 | 'number': /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
|
---|
| 28 | 'operator': /[-+*/%|&]|[<>:=]=?|!=|\b_\b/,
|
---|
| 29 | 'punctuation': /[,;.\[\]{}()]/
|
---|
| 30 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.