Lines Matching +full:rules +full:- +full:anchors
5 Lexer for YAML, a human-friendly data serialization language
27 self.indent = -1
47 context.indent = -1
163 mimetypes = ['text/x-yaml']
167 # the root rules
177 'yaml-directive'),
180 'tag-directive'),
182 (r'^(?:---|\.\.\.)(?=[ ]|$)',
183 reset_indent(Punctuation.Document), 'block-line'),
187 ('block-line', 'indentation')),
191 'ignored-line': [
201 'yaml-directive': [
203 (r'([ ]+)([0-9]+\.[0-9]+)',
204 bygroups(Text.Blank, Literal.Version), 'ignored-line'),
208 'tag-directive': [
210 (r'([ ]+)(!|![0-9A-Za-z_-]*!)'
211 r'([ ]+)(!|!?[0-9A-Za-z;/?:@&=+$,_.!~*\'()\[\]%-]+)',
213 'ignored-line'),
221 (r'[ ]+(?=[?:-](?:[ ]|$))', save_indent(Text.Indent)),
223 (r'[?:-](?=[ ]|$)', set_indent(Punctuation.Indicator)),
229 'block-line': [
234 # tags, anchors and aliases,
237 include('block-nodes'),
239 include('flow-nodes'),
241 (r'(?=[^ \t\n\r\f\v?:,\[\]{}#&*!|>\'"%@`-]|[?:-][^ \t\n\r\f\v])',
243 'plain-scalar-in-block-context'),
246 # tags, anchors, aliases
248 # a full-form tag
249 (r'!<[0-9A-Za-z;/?:@&=+$,_.!~*\'()\[\]%-]+>', Name.Type),
251 (r'!(?:[0-9A-Za-z_-]+)?'
252 r'(?:![0-9A-Za-z;/?:@&=+$,_.!~*\'()\[\]%-]+)?', Name.Type),
254 (r'&[0-9A-Za-z_-]+', Name.Anchor),
256 (r'\*[0-9A-Za-z_-]+', Name.Alias),
260 'block-nodes': [
265 ('block-scalar-content', 'block-scalar-header')),
269 'flow-nodes': [
271 (r'\[', Punctuation.Indicator, 'flow-sequence'),
273 (r'\{', Punctuation.Indicator, 'flow-mapping'),
274 # a single-quoted scalar
275 (r'\'', Literal.Scalar.Flow.Quote, 'single-quoted-scalar'),
276 # a double-quoted scalar
277 (r'\"', Literal.Scalar.Flow.Quote, 'double-quoted-scalar'),
281 'flow-collection': [
290 # tags, anchors and aliases
293 include('flow-nodes'),
297 'plain-scalar-in-flow-context'),
301 'flow-sequence': [
302 # include flow collection rules
303 include('flow-collection'),
309 'flow-mapping': [
310 # include flow collection rules
311 include('flow-collection'),
317 'block-scalar-content': [
331 'block-scalar-header': [
333 (r'([1-9])?[+-]?(?=[ ]|$)',
335 'ignored-line'),
337 (r'[+-]?([1-9])?(?=[ ]|$)',
339 'ignored-line'),
343 'quoted-scalar-whitespaces': [
352 # single-quoted scalars
353 'single-quoted-scalar': [
354 # include whitespace and line break rules
355 include('quoted-scalar-whitespaces'),
358 # regular non-whitespace characters
364 # double-quoted scalars
365 'double-quoted-scalar': [
366 # include whitespace and line break rules
367 include('quoted-scalar-whitespaces'),
371 (r'\\(?:x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})',
373 # regular non-whitespace characters
380 'plain-scalar-in-block-context-new-line': [
386 (r'^(?=---|\.\.\.)', something(Punctuation.Document), '#pop:3'),
392 'plain-scalar-in-block-context': [
400 (r'\n+', Text.Break, 'plain-scalar-in-block-context-new-line'),
403 # regular non-whitespace characters
409 'plain-scalar-in-flow-context': [
420 # regular non-whitespace characters