eric6/ThirdParty/Pygments/pygments/lexers/data.py

changeset 7547
21b0534faebc
parent 6942
2602857055c5
child 7701
25f42e208e08
equal deleted inserted replaced
7546:bf5f777260a6 7547:21b0534faebc
3 pygments.lexers.data 3 pygments.lexers.data
4 ~~~~~~~~~~~~~~~~~~~~ 4 ~~~~~~~~~~~~~~~~~~~~
5 5
6 Lexers for data file format. 6 Lexers for data file format.
7 7
8 :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. 8 :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
9 :license: BSD, see LICENSE for details. 9 :license: BSD, see LICENSE for details.
10 """ 10 """
11 11
12 import re 12 import re
13 13
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'),
443 .. versionadded:: 1.5 443 .. versionadded:: 1.5
444 """ 444 """
445 445
446 name = 'JSON' 446 name = 'JSON'
447 aliases = ['json'] 447 aliases = ['json']
448 filenames = ['*.json'] 448 filenames = ['*.json', 'Pipfile.lock']
449 mimetypes = ['application/json'] 449 mimetypes = ['application/json']
450 450
451 flags = re.DOTALL 451 flags = re.DOTALL
452 452
453 # integer part of a number 453 # integer part of a number

eric ide

mercurial