-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyaml.tmLanguage.json
109 lines (109 loc) · 3.79 KB
/
yaml.tmLanguage.json
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
{
"$schema": "https://raw.githubusercontent.com/RedCMD/TmLanguage-Syntax-Highlighter/main/vscode.tmLanguage.schema.json",
"scopeName": "source.yaml",
"name": "YAML Ain't Markup Language",
"patterns": [
{
"comment": "Support legacy FrontMatter integration",
"//": "https://github.com/microsoft/vscode-markdown-tm-grammar/pull/162",
"begin": "(?<=^-{3,}\\s*+)\\G$",
"while": "^(?! {3,0}-{3,}[ \t]*+$|[ \t]*+\\.{3}$)",
"patterns": [ { "include": "source.yaml.1.2" } ]
},
{
"comment": "Default to YAML version 1.2",
"include": "source.yaml.1.2"
}
],
"repository": {
"parity": {
"comment": "Yes... That is right. Due to the changes with \\x2028, \\x2029, \\x85 and 'tags'. This is all the code I was able to reuse between all YAML versions 1.3, 1.2, 1.1 and 1.0"
},
"block-map-key-single": {
"comment": "https://yaml.org/spec/1.2.2/#rule-c-single-quoted (BLOCK-KEY)",
"begin": "\\G'",
"end": "'(?!')",
"beginCaptures": { "0": { "name": "punctuation.definition.string.begin.yaml" } },
"endCaptures": { "0": { "name": "punctuation.definition.string.end.yaml" } },
"name": "meta.map.key.yaml string.quoted.single.yaml entity.name.tag.yaml",
"patterns": [
{
"match": ".[\t ]*+$",
"name": "invalid.illegal.multiline-key.yaml"
},
{
"match": "[^\t -\\x{10FFFF}]++",
"name": "invalid.illegal.character.yaml"
},
{
"match": "''",
"name": "constant.character.escape.single-quote.yaml"
}
]
},
"key-single": {
"comment": "https://yaml.org/spec/1.2.2/#rule-c-single-quoted (FLOW-OUT)",
"begin": "'",
"end": "'(?!')",
"beginCaptures": { "0": { "name": "punctuation.definition.string.begin.yaml" } },
"endCaptures": { "0": { "name": "punctuation.definition.string.end.yaml" } },
"name": "meta.map.key.yaml string.quoted.single.yaml entity.name.tag.yaml",
"patterns": [
{
"match": "[^\t -\\x{10FFFF}]++",
"name": "invalid.illegal.character.yaml"
},
{
"match": "''",
"name": "constant.character.escape.single-quote.yaml"
}
]
},
"non-printable": {
"//": [
"To ensure readability, YAML streams use only the printable subset of the Unicode character set",
"The allowed character range explicitly excludes",
"The C0 control block x00-x1F (except for TAB x09, LF x0A and CR x0D which are allowed)",
"DEL x7F",
"The C1 control block x80-x9F (except for NEL x85 which is allowed)",
"The surrogate block xD800-xDFFF",
"xFFFE and xFFFF"
],
"//match": "[\\p{Cntrl}\\p{Surrogate}\\x{FFFE FFFF}&&[^\t\n\r\\x{85}]]++",
"//": [
"c-printable ::=",
" # 8 bit",
"x09 # Tab (\t)",
"x0A # Line feed (LF \n)",
"x0D # Carriage Return (CR \r)",
"[x20-x7E] # Printable ASCII",
" # 16 bit",
"x85 # Next Line (NEL)",
"[xA0-xD7FF] # Basic Multilingual Plane (BMP)",
"[xE000-xFFFD] # Additional Unicode Areas",
"[x010000-x10FFFF] # 32 bit"
],
"match": "[^\t\n\r -~\\x{85}\\x{A0}-\\x{D7FF}\\x{E000}-\\x{FFFD}\\x{010000}-\\x{10FFFF}]++",
"name": "invalid.illegal.non-printable.yaml",
"//": {
"c-printable": "[\t\n\r -~\\x{85}\\x{A0}-\\x{D7FF}\\x{E000}-\\x{FFFD}\\x{010000}-\\x{10FFFF}]",
"nb-char": "[\t -~\\x{85}\\x{A0}-\\x{D7FF}\\x{E000}-\\x{FFFD}\\x{010000}-\\x{10FFFF}&&[^\\x{FEFF}]]",
"ns-char": "[!-~\\x{85}\\x{A0}-\\x{D7FF}\\x{E000}-\\x{FFFD}\\x{010000}-\\x{10FFFF}&&[^\\x{FEFF}]]",
"ns-char_i": "[\\x{85}[^ \\p{Cntrl}\\p{Surrogate}\\x{FEFF FFFE FFFF}]]"
},
"//": {
"85": "
",
"A0": " ",
"2028": "",
"2029": "",
"D7FF": "",
"E000": "",
"FFFD": "�",
"FEFF": "",
"FFFF": "",
"10000": "𐀀",
"10FFFF": ""
}
}
}
}