U
    ç¥¡cy  ã                   @   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   ú:/tmp/pip-unpacked-wheel-6wad6tea/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)úclosing-braceÚvalueúopening-bracez@string)r#   Úfieldr%   ú@)r#   úcommand-bodyr%   z.+z[{(]ú#popz[})]z
[^\s\,\}]+)r)   Úfieldsú,r&   )r$   ú=r,   ú"úquoted-stringú\{úbraced-stringz[\d]+ú#z[^\{\"]+z#pushú\}z[^\{\}]+ú\s+)Úrootr%   r#   r(   r*   r&   r,   r$   r.   r0   r"   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚaliasesÚ	filenamesÚ	mimetypesÚreÚ
IGNORECASEÚflagsZALLOWED_CHARSÚformatÚ
IDENTIFIERr   r!   r   r   r   ZClassZLabelr   r   Ú	AttributeÚVariabler	   r   r   Útokensr   r   r   r   r      st   


ÿù
þþ
þý
ýþù
ýýÿÉ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ÚsortÚexecuteZintegersZiterateÚreverseÚstringsr   ÚfunctionÚmacro)r   r   Úentry)r   r   r   r/   )r)   ú	group-endÚbodyr2   r)   z\'[^#\"\{\}\s]+z[^#\"\{\}\s]+\$z[^#\"\{\}\s]+z"[^\"]*"z#-?\d+)rM   rN   r3   z%.*?$)r4   r   rM   rN   r"   N)r5   r6   r7   r8   r9   r:   r;   r=   r>   Ú	MULTILINEr?   r   r   r   r   r   ZFunctionZBuiltinrC   r	   r   r   r   r   ÚSinglerD   r   r   r   r   r   t   sB    ÿú	þþøþå)r8   r=   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   
,_