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

changeset 7547
21b0534faebc
parent 6942
2602857055c5
child 7701
25f42e208e08
equal deleted inserted replaced
7546:bf5f777260a6 7547:21b0534faebc
3 pygments.lexers.bibtex 3 pygments.lexers.bibtex
4 ~~~~~~~~~~~~~~~~~~~~~~ 4 ~~~~~~~~~~~~~~~~~~~~~~
5 5
6 Lexers for BibTeX bibliography data and styles 6 Lexers for BibTeX bibliography data and styles
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
31 filenames = ['*.bib'] 31 filenames = ['*.bib']
32 mimetypes = ["text/x-bibtex"] 32 mimetypes = ["text/x-bibtex"]
33 flags = re.IGNORECASE 33 flags = re.IGNORECASE
34 34
35 ALLOWED_CHARS = r'@!$&*+\-./:;<>?\[\\\]^`|~' 35 ALLOWED_CHARS = r'@!$&*+\-./:;<>?\[\\\]^`|~'
36 IDENTIFIER = '[{0}][{1}]*'.format('a-z_' + ALLOWED_CHARS, r'\w' + ALLOWED_CHARS) 36 IDENTIFIER = '[{}][{}]*'.format('a-z_' + ALLOWED_CHARS, r'\w' + ALLOWED_CHARS)
37 37
38 def open_brace_callback(self, match, ctx): 38 def open_brace_callback(self, match, ctx):
39 opening_brace = match.group() 39 opening_brace = match.group()
40 ctx.opening_brace = opening_brace 40 ctx.opening_brace = opening_brace
41 yield match.start(), Punctuation, opening_brace 41 yield match.start(), Punctuation, opening_brace

eric ide

mercurial