1 | Prism.languages.yaml = {
|
2 | 'scalar': {
|
3 | pattern: /([\-:]\s*(?:![^\s]+)?[ \t]*[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)[^\r\n]+(?:\2[^\r\n]+)*)/,
|
4 | lookbehind: true,
|
5 | alias: 'string'
|
6 | },
|
7 | 'comment': /#.*/,
|
8 | 'key': {
|
9 | pattern: /(\s*(?:^|[:\-,[{\r\n?])[ \t]*(?:![^\s]+)?[ \t]*)[^\r\n{[\]},#\s]+?(?=\s*:\s)/,
|
10 | lookbehind: true,
|
11 | alias: 'atrule'
|
12 | },
|
13 | 'directive': {
|
14 | pattern: /(^[ \t]*)%.+/m,
|
15 | lookbehind: true,
|
16 | alias: 'important'
|
17 | },
|
18 | 'datetime': {
|
19 | pattern: /([:\-,[{]\s*(?:![^\s]+)?[ \t]*)(?:\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?)?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?)(?=[ \t]*(?:$|,|]|}))/m,
|
20 | lookbehind: true,
|
21 | alias: 'number'
|
22 | },
|
23 | 'boolean': {
|
24 | pattern: /([:\-,[{]\s*(?:![^\s]+)?[ \t]*)(?:true|false)[ \t]*(?=$|,|]|})/im,
|
25 | lookbehind: true,
|
26 | alias: 'important'
|
27 | },
|
28 | 'null': {
|
29 | pattern: /([:\-,[{]\s*(?:![^\s]+)?[ \t]*)(?:null|~)[ \t]*(?=$|,|]|})/im,
|
30 | lookbehind: true,
|
31 | alias: 'important'
|
32 | },
|
33 | 'string': {
|
34 | pattern: /([:\-,[{]\s*(?:![^\s]+)?[ \t]*)("|')(?:(?!\2)[^\\\r\n]|\\.)*\2(?=[ \t]*(?:$|,|]|}))/m,
|
35 | lookbehind: true,
|
36 | greedy: true
|
37 | },
|
38 | 'number': {
|
39 | pattern: /([:\-,[{]\s*(?:![^\s]+)?[ \t]*)[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+\.?\d*|\.?\d+)(?:e[+-]?\d+)?|\.inf|\.nan)[ \t]*(?=$|,|]|})/im,
|
40 | lookbehind: true
|
41 | },
|
42 | 'tag': /![^\s]+/,
|
43 | 'important': /[&*][\w]+/,
|
44 | 'punctuation': /---|[:[\]{}\-,|>?]|\.\.\./
|
45 | };
|