-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathyaml.pgx.yaml
218 lines (218 loc) · 5.55 KB
/
yaml.pgx.yaml
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
---
+grammar: yaml
+toprule: yaml_stream
+version: 0.0.1
EOS:
.rgx: \z
__:
.rgx: (?:(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)(?:\r?\n|\z))*
any_node:
.any:
- .ref: yaml_alias
- .ref: yaml_node
block_key:
.all:
- +max: 1
.ref: yaml_props
- .ref: block_key_scalar
- .ref: pair_separator
block_key_scalar:
.any:
- .ref: double_quoted_scalar
- .ref: single_quoted_scalar
- .ref: block_plain_scalar
block_mapping_or_scalar:
.all:
- .ref: block_indent
- .all:
- .ref: block_pair
- +min: 0
-flat: 1
.all:
- .all:
- .ref: __
- .ref: block_ondent
- .ref: block_pair
- .ref: block_undent
block_node:
.any:
- .ref: block_sequence
- .ref: block_mapping_or_scalar
- .ref: block_scalar
block_pair:
.all:
- .ref: block_key
- .ref: any_node
block_plain_scalar:
.rgx: (?![&\*!\{\}\[\]%"'`\@\#])(.*?)(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)(?=:\s|\r?\n|\z)
block_scalar:
.any:
- .ref: literal_scalar
- .ref: folded_scalar
- .ref: double_quoted_scalar
- .ref: single_quoted_scalar
- .ref: block_plain_scalar
block_sequence:
.all:
- .ref: block_sequence_indent
- .all:
- .ref: block_sequence_entry
- +min: 0
-flat: 1
.all:
- .all:
- .ref: __
- .ref: block_sequence_ondent
- .ref: block_sequence_entry
- .ref: block_sequence_undent
block_sequence_entry:
.all:
- .ref: block_sequence_marker
- .ref: any_node
block_sequence_marker:
.rgx: \-(?:(?=[\ \t])(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)|(?:(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)(?:\r?\n|\z))*)
directive_tag:
.rgx: '%TAG(?=[\ \t])(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)!(.*)!(?=[\ \t])(?:[\
\t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)(\S+)(?:(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)(?:\r?\n|\z))*'
directive_yaml:
.rgx: '%YAML(?=[\ \t])(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)1\.2(?:(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)(?:\r?\n|\z))*'
document_end:
.rgx: ''
document_foot:
.rgx: \.\.\.(?:\r?\n|\z)
document_head:
.rgx: \-\-\-
document_start:
.rgx: (?=.)
double_quoted_scalar:
.rgx: '"((?:\\"|[^"])*)"'
flow_collection:
.any:
- .ref: flow_sequence
- .ref: flow_mapping
flow_mapping:
.all:
- .ref: flow_mapping_start
- +max: 1
.all:
- .ref: flow_mapping_pair
- +min: 0
-flat: 1
.all:
- .ref: list_separator
- .ref: flow_mapping_pair
- +max: 1
.ref: list_separator
- .ref: flow_mapping_end
flow_mapping_end:
.rgx: (?:(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)(?:\r?\n|\z))*(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)\}(?:[\
\t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)
flow_mapping_pair:
.all:
- .any:
- .ref: json_key
- .all:
- .ref: flow_node
- .ref: pair_separator
- .ref: flow_node
flow_mapping_start:
.rgx: \{(?:(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)(?:\r?\n|\z))*(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)
flow_node:
.any:
- .ref: yaml_alias
- .all:
- +max: 1
.ref: yaml_props
- .ref: x
- .any:
- .ref: flow_sequence
- .ref: flow_mapping
- .ref: flow_scalar
flow_plain_scalar:
.rgx: (?![&\*!\{\}\[\]%"'`\@\#])(.*?)(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)(?=[&\*!\{\}\[\]%"',]|:\
|,\ |\r?\n|\z)
flow_scalar:
.any:
- .ref: double_quoted_scalar
- .ref: single_quoted_scalar
- .ref: flow_plain_scalar
flow_sequence:
.all:
- .ref: flow_sequence_start
- +max: 1
.all:
- .ref: flow_node
- +min: 0
-flat: 1
.all:
- .ref: list_separator
- .ref: flow_node
- +max: 1
.ref: list_separator
- .ref: flow_sequence_end
flow_sequence_end:
.rgx: (?:(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)(?:\r?\n|\z))*(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)\](?:[\
\t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)
flow_sequence_start:
.rgx: \[(?:(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)(?:\r?\n|\z))*(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)
json_key:
.rgx: '"((?:\\"|[^"])*)":(?=\S)'
list_separator:
.rgx: (?:(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)(?:\r?\n|\z))*(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?),(?:(?:[\
\t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)(?:\r?\n|\z))*(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)
pair_separator:
.rgx: (?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?):(?=\s)(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)
single_quoted_scalar:
.rgx: '''((?:''''|[^''])*)'''
stream_end:
.ref: EOS
stream_start:
.rgx: (?:(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)(?:\r?\n|\z))*
x:
.rgx: (?:(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)(?:\r?\n|\z))*(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)
yaml_alias:
.rgx: \*(\w+)(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)
yaml_document:
.all:
- +max: 1
.ref: directive_yaml
- +min: 0
.ref: directive_tag
- .any:
- .all:
- .ref: document_head
- .any:
- .all:
- .rgx: '[\ \t]+'
- .ref: block_scalar
- .ref: __
- .all:
- .ref: __
- .ref: yaml_node
- .all:
- .ref: document_start
- .ref: yaml_node
- .ref: __
- .any:
- .ref: document_foot
- .ref: document_end
yaml_node:
.all:
- +max: 1
.ref: yaml_props
- .rgx: (?:(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)(?:\r?\n|\z))*
- .any:
- .all:
- .rgx: (?=[\{\[])
- .ref: flow_collection
- .ref: block_node
yaml_props:
.rgx: (?:(?:\&(\w+)(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?))(?:(\!\S*)(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?))?|(?:(\!\S*)(?:[\
\t]*(?:(?:(?<=\s)|(?<=^))\#.*)?))(?:\&(\w+)(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?))?)((?:[\
\t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)(?:(?:[\ \t]*(?:(?:(?<=\s)|(?<=^))\#.*)?)(?:\r?\n|\z))*)
yaml_stream:
.all:
- .ref: stream_start
- +min: 0
.ref: yaml_document
- .ref: stream_end