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:
1000 bytes
|
Line | |
---|
1 | Prism.languages['firestore-security-rules'] = Prism.languages.extend('clike', {
|
---|
2 | 'comment': /\/\/.*/,
|
---|
3 | 'keyword': /\b(?:allow|function|if|match|null|return|rules_version|service)\b/,
|
---|
4 | 'operator': /&&|\|\||[<>!=]=?|[-+*/%]|\b(?:in|is)\b/,
|
---|
5 | });
|
---|
6 |
|
---|
7 | delete Prism.languages['firestore-security-rules']['class-name'];
|
---|
8 |
|
---|
9 | Prism.languages.insertBefore('firestore-security-rules', 'keyword', {
|
---|
10 | 'path': {
|
---|
11 | pattern: /(^|[\s(),])(?:\/(?:[\w\xA0-\uFFFF]+|\{[\w\xA0-\uFFFF]+(?:=\*\*)?\}|\$\([\w\xA0-\uFFFF.]+\)))+/,
|
---|
12 | lookbehind: true,
|
---|
13 | greedy: true,
|
---|
14 | inside: {
|
---|
15 | 'variable': {
|
---|
16 | pattern: /\{[\w\xA0-\uFFFF]+(?:=\*\*)?\}|\$\([\w\xA0-\uFFFF.]+\)/,
|
---|
17 | inside: {
|
---|
18 | 'operator': /=/,
|
---|
19 | 'keyword': /\*\*/,
|
---|
20 | 'punctuation': /[.$(){}]/
|
---|
21 | }
|
---|
22 | },
|
---|
23 | 'punctuation': /\//
|
---|
24 | }
|
---|
25 | },
|
---|
26 | 'method': {
|
---|
27 | // to make the pattern shorter, the actual method names are omitted
|
---|
28 | pattern: /(\ballow\s+)[a-z]+(?:\s*,\s*[a-z]+)*(?=\s*[:;])/,
|
---|
29 | lookbehind: true,
|
---|
30 | alias: 'builtin',
|
---|
31 | inside: {
|
---|
32 | 'punctuation': /,/
|
---|
33 | }
|
---|
34 | },
|
---|
35 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.