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

changeset 7701
25f42e208e08
parent 7547
21b0534faebc
child 7983
54c5cfbb1e29
equal deleted inserted replaced
7700:a3cf077a8db3 7701:25f42e208e08
3 pygments.lexers.rdf 3 pygments.lexers.rdf
4 ~~~~~~~~~~~~~~~~~~~ 4 ~~~~~~~~~~~~~~~~~~~
5 5
6 Lexers for semantic web and RDF query languages and markup. 6 Lexers for semantic web and RDF query languages and markup.
7 7
8 :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. 8 :copyright: Copyright 2006-2020 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
29 filenames = ['*.rq', '*.sparql'] 29 filenames = ['*.rq', '*.sparql']
30 mimetypes = ['application/sparql-query'] 30 mimetypes = ['application/sparql-query']
31 31
32 # character group definitions :: 32 # character group definitions ::
33 33
34 PN_CHARS_BASE_GRP = (u'a-zA-Z' 34 PN_CHARS_BASE_GRP = ('a-zA-Z'
35 u'\u00c0-\u00d6' 35 '\u00c0-\u00d6'
36 u'\u00d8-\u00f6' 36 '\u00d8-\u00f6'
37 u'\u00f8-\u02ff' 37 '\u00f8-\u02ff'
38 u'\u0370-\u037d' 38 '\u0370-\u037d'
39 u'\u037f-\u1fff' 39 '\u037f-\u1fff'
40 u'\u200c-\u200d' 40 '\u200c-\u200d'
41 u'\u2070-\u218f' 41 '\u2070-\u218f'
42 u'\u2c00-\u2fef' 42 '\u2c00-\u2fef'
43 u'\u3001-\ud7ff' 43 '\u3001-\ud7ff'
44 u'\uf900-\ufdcf' 44 '\uf900-\ufdcf'
45 u'\ufdf0-\ufffd') 45 '\ufdf0-\ufffd')
46 46
47 PN_CHARS_U_GRP = (PN_CHARS_BASE_GRP + '_') 47 PN_CHARS_U_GRP = (PN_CHARS_BASE_GRP + '_')
48 48
49 PN_CHARS_GRP = (PN_CHARS_U_GRP + 49 PN_CHARS_GRP = (PN_CHARS_U_GRP +
50 r'\-' + 50 r'\-' +
51 r'0-9' + 51 r'0-9' +
52 u'\u00b7' + 52 '\u00b7' +
53 u'\u0300-\u036f' + 53 '\u0300-\u036f' +
54 u'\u203f-\u2040') 54 '\u203f-\u2040')
55 55
56 HEX_GRP = '0-9A-Fa-f' 56 HEX_GRP = '0-9A-Fa-f'
57 57
58 PN_LOCAL_ESC_CHARS_GRP = r' _~.\-!$&"()*+,;=/?#@%' 58 PN_LOCAL_ESC_CHARS_GRP = r' _~.\-!$&"()*+,;=/?#@%'
59 59
74 BLANK_NODE_LABEL = '_:[0-9' + PN_CHARS_U_GRP + '](?:[' + PN_CHARS_GRP + \ 74 BLANK_NODE_LABEL = '_:[0-9' + PN_CHARS_U_GRP + '](?:[' + PN_CHARS_GRP + \
75 '.]*' + PN_CHARS + ')?' 75 '.]*' + PN_CHARS + ')?'
76 76
77 PN_PREFIX = PN_CHARS_BASE + '(?:[' + PN_CHARS_GRP + '.]*' + PN_CHARS + ')?' 77 PN_PREFIX = PN_CHARS_BASE + '(?:[' + PN_CHARS_GRP + '.]*' + PN_CHARS + ')?'
78 78
79 VARNAME = u'[0-9' + PN_CHARS_U_GRP + '][' + PN_CHARS_U_GRP + \ 79 VARNAME = '[0-9' + PN_CHARS_U_GRP + '][' + PN_CHARS_U_GRP + \
80 u'0-9\u00b7\u0300-\u036f\u203f-\u2040]*' 80 '0-9\u00b7\u0300-\u036f\u203f-\u2040]*'
81 81
82 PERCENT = '%' + HEX + HEX 82 PERCENT = '%' + HEX + HEX
83 83
84 PN_LOCAL_ESC = r'\\' + PN_LOCAL_ESC_CHARS 84 PN_LOCAL_ESC = r'\\' + PN_LOCAL_ESC_CHARS
85 85
286 filenames = ['*.shex'] 286 filenames = ['*.shex']
287 mimetypes = ['text/shex'] 287 mimetypes = ['text/shex']
288 288
289 # character group definitions :: 289 # character group definitions ::
290 290
291 PN_CHARS_BASE_GRP = (u'a-zA-Z' 291 PN_CHARS_BASE_GRP = ('a-zA-Z'
292 u'\u00c0-\u00d6' 292 '\u00c0-\u00d6'
293 u'\u00d8-\u00f6' 293 '\u00d8-\u00f6'
294 u'\u00f8-\u02ff' 294 '\u00f8-\u02ff'
295 u'\u0370-\u037d' 295 '\u0370-\u037d'
296 u'\u037f-\u1fff' 296 '\u037f-\u1fff'
297 u'\u200c-\u200d' 297 '\u200c-\u200d'
298 u'\u2070-\u218f' 298 '\u2070-\u218f'
299 u'\u2c00-\u2fef' 299 '\u2c00-\u2fef'
300 u'\u3001-\ud7ff' 300 '\u3001-\ud7ff'
301 u'\uf900-\ufdcf' 301 '\uf900-\ufdcf'
302 u'\ufdf0-\ufffd') 302 '\ufdf0-\ufffd')
303 303
304 PN_CHARS_U_GRP = (PN_CHARS_BASE_GRP + '_') 304 PN_CHARS_U_GRP = (PN_CHARS_BASE_GRP + '_')
305 305
306 PN_CHARS_GRP = (PN_CHARS_U_GRP + 306 PN_CHARS_GRP = (PN_CHARS_U_GRP +
307 r'\-' + 307 r'\-' +
308 r'0-9' + 308 r'0-9' +
309 u'\u00b7' + 309 '\u00b7' +
310 u'\u0300-\u036f' + 310 '\u0300-\u036f' +
311 u'\u203f-\u2040') 311 '\u203f-\u2040')
312 312
313 HEX_GRP = '0-9A-Fa-f' 313 HEX_GRP = '0-9A-Fa-f'
314 314
315 PN_LOCAL_ESC_CHARS_GRP = r"_~.\-!$&'()*+,;=/?#@%" 315 PN_LOCAL_ESC_CHARS_GRP = r"_~.\-!$&'()*+,;=/?#@%"
316 316

eric ide

mercurial