B
    ¿Âûby  ã               @   s€   d Z ddlZddlmZmZmZmZmZ ddlm	Z	m
Z
mZmZmZmZmZmZmZ ddgZG dd„ deƒZG dd„ deƒZdS )	zß
    pygments.lexers.bibtex
    ~~~~~~~~~~~~~~~~~~~~~~

    Lexers for BibTeX bibliography data and styles

    :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
é    N)Ú
RegexLexerÚExtendedRegexLexerÚincludeÚdefaultÚwords)	ÚNameÚCommentÚStringÚErrorÚNumberÚTextÚKeywordÚPunctuationÚ
WhitespaceÚBibTeXLexerÚBSTLexerc               @   sl  e Zd ZdZdZddgZdgZdgZej	Z
dZd d	e d
e ¡Zdd„ Zdd„ Zedƒdefdejdfdejdfde ejdfdefgedƒdedfgedƒdedfgedƒdejdfgedƒdedfedƒgedƒeejdfedƒgedƒd edfgedƒeejfd!ed"fd#ed$fd%efd&efedƒgd#ed$fd!edfd'efgd#ed(fd)edfd*efgd+efgd,œZd-S ).r   zQ
    A lexer for BibTeX bibliography data format.

    .. versionadded:: 2.2
    ZBibTeXZbibtexZbibz*.bibztext/x-bibtexz@!$&*+\-./:;<>?\[\\\]^`|~z	[{}][{}]*za-z_z\wc             c   s,   |  ¡ }||_| ¡ t|fV  | ¡ |_d S )N)ÚgroupÚopening_braceÚstartr   ÚendÚpos)ÚselfÚmatchÚctxr   © r   ú5lib/python3.7/site-packages/pygments/lexers/bibtex.pyÚopen_brace_callback%   s    zBibTeXLexer.open_brace_callbackc             c   s`   |  ¡ }|jdkr|dks,|jdkr>|dkr>| ¡ t|fV  n| ¡ t|fV  |`| ¡ |_d S )NÚ{Ú}ú(ú))r   r   r   r
   r   r   r   )r   r   r   Zclosing_bracer   r   r   Úclose_brace_callback+   s    z BibTeXLexer.close_brace_callbackÚ
whitespacez@comment(?!ary)z	@preamble)zclosing-braceÚvaluezopening-bracez@string)zclosing-braceÚfieldzopening-braceú@)zclosing-bracezcommand-bodyzopening-bracez.+z[{(]z#popz[})]z
[^\s\,\}]+)z#popÚfieldsú,r$   )r#   ú=r(   ú"zquoted-stringz\{zbraced-stringz[\d]+ú#z[^\{\"]+z#pushz\}z[^\{\}]+z\s+)Úrootzopening-bracezclosing-bracezcommand-bodyr&   r$   r(   r#   zquoted-stringzbraced-stringr"   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚaliasesÚ	filenamesZ	mimetypesÚreÚ
IGNORECASEÚflagsZALLOWED_CHARSÚformatZ
IDENTIFIERr   r!   r   r   r   ZClassZLabelr   r   Z	AttributeÚVariabler	   r   r   Útokensr   r   r   r   r      sZ   






c               @   sè   e Zd ZdZdZddgZdgZejej	B Z
edƒeddgƒefed	d
dddgƒedfeddgƒedfedgƒedfgedƒdedfgedƒdedfgedƒdejfdejfdejfdefdefdedfedƒgdefdejfgd œZd!S )"r   zL
    A lexer for BibTeX bibliography styles.

    .. versionadded:: 2.2
    ZBSTZbstz
bst-pybtexz*.bstr"   ÚreadÚsortZexecuteZintegersZiterateÚreverseÚstringsr   ZfunctionZmacro)r   r   Úentry)r   r   r   z\{)z#popz	group-endÚbodyz\}z#popz\'[^#\"\{\}\s]+z[^#\"\{\}\s]+\$z[^#\"\{\}\s]+z"[^\"]*"z#-?\d+)z	group-endr>   z\s+z%.*?$)r+   r   z	group-endr>   r"   N)r,   r-   r.   r/   r0   r1   r2   r3   r4   Ú	MULTILINEr5   r   r   r   r   r   ZFunctionZBuiltinr7   r	   r   r   r   r   ÚSingler8   r   r   r   r   r   t   s2   

)r/   r3   Zpygments.lexerr   r   r   r   r   Zpygments.tokenr   r   r	   r
   r   r   r   r   r   Ú__all__r   r   r   r   r   r   Ú<module>	   s   ,_