231 # the line end |
231 # the line end |
232 (r'[ ]*(?=#|$)', something(Text), '#pop'), |
232 (r'[ ]*(?=#|$)', something(Text), '#pop'), |
233 # whitespaces separating tokens |
233 # whitespaces separating tokens |
234 (r'[ ]+', Text), |
234 (r'[ ]+', Text), |
235 # key with colon |
235 # key with colon |
236 (r'([^,:?\[\]{}\n]+)(:)(?=[ ]|$)', |
236 (r'''([^#,:?\[\]{}"'\n]+)(:)(?=[ ]|$)''', |
237 bygroups(Name.Tag, set_indent(Punctuation, implicit=True))), |
237 bygroups(Name.Tag, set_indent(Punctuation, implicit=True))), |
238 # tags, anchors and aliases, |
238 # tags, anchors and aliases, |
239 include('descriptors'), |
239 include('descriptors'), |
240 # block collections and scalars |
240 # block collections and scalars |
241 include('block-nodes'), |
241 include('block-nodes'), |
310 ], |
310 ], |
311 |
311 |
312 # a flow mapping indicated by '{' and '}' |
312 # a flow mapping indicated by '{' and '}' |
313 'flow-mapping': [ |
313 'flow-mapping': [ |
314 # key with colon |
314 # key with colon |
315 (r'([^,:?\[\]{}\n]+)(:)(?=[ ]|$)', |
315 (r'''([^,:?\[\]{}"'\n]+)(:)(?=[ ]|$)''', |
316 bygroups(Name.Tag, Punctuation)), |
316 bygroups(Name.Tag, Punctuation)), |
317 # include flow collection rules |
317 # include flow collection rules |
318 include('flow-collection'), |
318 include('flow-collection'), |
319 # the closing indicator |
319 # the closing indicator |
320 (r'\}', Punctuation.Indicator, '#pop'), |
320 (r'\}', Punctuation.Indicator, '#pop'), |