a
    ñ»jMR  ã                   @   s¨   d Z ddlZddlmZmZmZmZmZmZm	Z	m
Z
 ddl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G dd„ deƒZdS )zÍ
    pygments.lexers.c_cpp
    ~~~~~~~~~~~~~~~~~~~~~

    Lexers for C/C++ languages.

    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
é    N)Ú
RegexLexerÚincludeÚbygroupsÚusingÚthisÚinheritÚdefaultÚwords)Úget_bool_opt)	ÚTextÚCommentÚOperatorÚKeywordÚNameÚStringÚNumberÚPunctuationÚ
WhitespaceÚCLexerÚCppLexerc                   @   s.  e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
e
› de› d�Zdejdfdejdfde d eeeƒejƒdfde d eeeƒejƒdfde d eeejeeƒfdefdefdefe
ejfeejfdejfgedƒedƒdeejeƒdfdeejejejejƒfde d  e d! e d" e d# e d$ ejfd%e d  e d! e d" e d& e d' ejfd(e d) e d* e d+ e d, ejfd-e e ejfd.e ej fd/e ej!fd0e e ej"fd1e#fd2efd3ej$feefge%d4d5d6d7�e&j'fe%d8d6d9�e&j(fgd:ee&eƒd;fd<e&d=fe%d>d6d9�e&fe%d?d6d9�e&j'fd@e&j'fe%dAd5d6d7�e&j'fgedBƒedƒdCe	 dD e dE e	 dE e dF e dG eeeƒeedBdH�ej)eedBdH�eeƒeedBdH�eeƒeƒdIfdCe	 dD e dE e	 dE e dF e dJ eeeƒeedBdH�ej)eedBdH�eeƒeedBdH�eeƒeƒfedƒe*dKƒgedBƒedLƒdMefdNedOfgedBƒedLƒdPefdQedRfdMedOfgdSedOfdTej+fdUefdefdVefgdCe dW e dX eeeƒejeeƒej,eeƒejƒfdCe dW e dY eeeƒejeeƒej,eeƒejƒfdZejfd[ejfd\ejdOfd]ejfd^ejfdejdOfgd_ejdRfd`ejdOfdaejdOfdbefgedBƒdceddfeej-dOfdeedOfe*dOƒgdfedOfeej.fedBƒedLƒgdgedOfeej/fdhedifdjefdkefedBƒgdledOfdhedRfedLƒgdmœZ0h dn£Z1h do£Z2h dp£Z3h dq£Z4drds„ Z5dxdudv„Z6dwS )yÚCFamilyLexerzg
    For C family source code.  This is used as a base class to avoid repetitious
    definitions.
    z\s*(?:/[*].*?[*]/\s*)?z[0-9a-fA-F](\'?[0-9a-fA-F])*z
\d(\'?\d)*z:(([uU]?[zZ])|([zZ][uU])|([uU][lL]{0,2})|([lL]{1,2}[uU]?))?z4(?!\d)(?:[\w$]|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8})+z7(?!\d)(?:[\w$]|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|::)+z//(?:.|(?<=\\)\n)*\nz5/(?:\\\n)?[*](?:[^*]|[*](?!(?:\\\n)?/))*[*](?:\\\n)?/z\s*(?:(?:(?:z)|(?:z))\s*)*z^#if\s+0Úif0z^#Úmacroz^(z
)(#if\s+0)z)(#)z4(^[ \t]*)(?!(?:public|private|protected|default)\b)(z)(\s*)(:)(?!:)z\nz[^\S\n]+z\\\nz/(\\\n)?[*][\w\W]*ÚkeywordsÚtypesz([LuU]|u8)?(")ÚstringzA([LuU]|u8)?(')(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])(')z0[xX](z\.z|\.ú|z
)[pP][+-]?z[lL]?z(-)?(z
)[eE][+-]?z[fFlL]?z(-)?((z\.(z)?|\.z)[fFlL]?)|(z[fFlL])z	(-)?0[xX]z(-)?0[bB][01](\'?[01])*z(-)?0(\'?[0-7])+z(-)?z[~!%^&*+=|?:<>/-]z
[()\[\],.]z(true|false|NULL|nullptr)\b)Zint8Zint16Zint32Zint64Úwchar_tÚ__ú\b©ÚprefixÚsuffix)ÚboolÚintÚlongÚfloatÚshortÚdoubleÚcharZunsignedÚsignedZvoidZ_BitIntZ__int128©r"   z(struct|union)(\s+)Ú	classnamezcase\bú
case-value)#ÚasmÚautoÚbreakÚconstZ	constexprÚcontinueZcountofr   ZdeferÚdoÚelseÚenumZexternÚforZgotoÚifÚregisterZ
restrictedÚreturnÚsizeofÚstructZstaticÚswitchZtypedefZtypeofZtypeof_unqualZvolatileÚwhileÚunionZthread_localZalignasZalignofZstatic_assertZ_PragmaÚfortran)ÚinlineZ_inlineZ__inlineZnakedZrestrictÚthreadz(__m(128i|128d|128|64))\b)r.   ZbasedÚexceptZstdcallZcdeclZfastcallZdeclspecÚfinallyÚtryZleaveZw64Z	unalignedÚraiseZnoopÚ
identifierZforceinlineZassumeÚnullÚ
whitespaceú(z(?:[&*\s])+)(z)(z)(\([^;"\')]*?\))(z)([^;{/"\']*)(\{))ÚstateÚfunctionz)([^;/"\']*)(;)Ú	statementÚ
statementsú\}z[{;]ú#popú;ú\{ú#pushú"zO\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|[0-7]{1,3})z	[^\\"\n]+z\\z)(include)(z5)("[^"]+"|<[^>]+>)([^\S\n]*)([^/\n]*/[*][\s\S]*?[*]/)z$)("[^"]+"|<[^>]+>)([^\S\n]*)([^\n]*)z[^/\n]+z/[*][\s\S]*?[*]/z//.*?\nú/z	(?<=\\)\nz^\s*#if.*?(?<!\\)\nz^\s*#el(?:se|if).*\nz^\s*#endif.*?(?<!\\)\nz.*?\nú\[\[(?=[^\[\]]*\]\])Ú	attributeú\s*(?=>)z(?<!:)(:)(?!:)ú\]\]ú\(úattribute-argsú::ú,ú\))rH   rM   r   r   ÚrootrL   rK   r   r   r   r,   r-   rV   rZ   >   Zssize_tZwint_tZ	mbstate_tZwctype_tZdiv_tZsig_atomic_tZldiv_tZoff_tZfpos_tr   Z	ptrdiff_tZclock_tZjmp_bufZtime_tÚFILEZsize_tZ	wctrans_tZva_listÚDIRÚbyte>   Zuint_least32_tZint_fast64_tZuint_least8_tZuint_fast64_tZint32_tZint_least16_tZintptr_tZ	uintmax_tZuint32_tZuint_fast8_tZint_least32_tZint_least8_tZuint_least16_tZint8_tZuint_fast32_tZint_fast32_tZint_fast8_tZuint16_tZuint_least64_tZint_least64_tZuint64_tZint64_tZuint_fast16_tZint16_tZintmax_tZint_fast16_tZuint8_tZ	uintptr_t>   Z	cpu_set_tZtimer_tZ	socklen_tZid_tZsighandler_tZkey_tZmode_tZgid_tZ	siginfo_tZino_tZ	cpumask_tZsigset_tZ	clockid_tZsigval_tZdev_tZnfds_tZuid_tZsig_tZrlim_tZpid_t>%   Zatomic_uint_least8_tZatomic_shortZ
atomic_intZatomic_uint_least32_tZatomic_int_fast32_tZatomic_int_least32_tZatomic_uintptr_tZatomic_intptr_tZatomic_uintZatomic_ptrdiff_tZatomic_int_least8_tZatomic_boolZatomic_ucharZatomic_uint_fast8_tZatomic_size_tZatomic_char16_tZatomic_int_fast16_tZatomic_scharZatomic_uint_least64_tZatomic_int_least16_tZatomic_int_fast64_tZatomic_wchar_tZatomic_llongZatomic_uintmax_tZatomic_charZatomic_ushortZatomic_uint_fast32_tZatomic_ulongZatomic_char32_tZatomic_uint_least16_tZatomic_int_least64_tZatomic_ullongZatomic_uint_fast64_tZatomic_longZatomic_uint_fast16_tZatomic_int_fast8_tZatomic_intmax_tc                 K   sN   t |ddƒ| _t |ddƒ| _t |ddƒ| _t |ddƒ| _tj| fi |¤Ž d S )NÚstdlibhighlightingTÚc99highlightingÚc11highlightingÚplatformhighlighting)r
   rb   rc   rd   re   r   Ú__init__)ÚselfÚoptions© ri   ú;E:\soccer\ml_env\Lib\site-packages\pygments/lexers/c_cpp.pyrf     s
    zCFamilyLexer.__init__©r^   c                 c   s�   t  | ||¡D ]|\}}}|tu r~| jr8|| jv r8tj}nF| jrP|| jv rPtj}n.| j	rh|| j
v rhtj}n| jr~|| jv r~tj}|||fV  qd S )N)r   Úget_tokens_unprocessedr   rb   Ústdlib_typesr   ÚTyperc   Ú	c99_typesrd   Úc11_atomic_typesre   Úlinux_types)rg   ÚtextÚstackÚindexÚtokenÚvalueri   ri   rj   rl     s    ÿz#CFamilyLexer.get_tokens_unprocessedN)rk   )7Ú__name__Ú
__module__Ú__qualname__Ú__doc__Z_ws1Z_hexpartZ_decpartZ
_intsuffixÚ_identZ_namespaced_identZ_comment_singleZ_comment_multilineZ_possible_commentsr   ÚPreprocr   r   r   r   r   ÚLabelr   r   ÚSingleÚ	Multiliner   r   ÚAffixÚCharr   ÚFloatÚHexÚBinÚOctÚIntegerr   ÚBuiltinr	   r   ÚReservedrn   ÚFunctionr   ÚEscapeÚPreprocFileÚClassÚConstantÚ	AttributeÚtokensrm   ro   rq   rp   rf   rl   ri   ri   ri   rj   r      sØ  


ÿ
ÿüüûéÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿêÿÿþþýûûÿÿûûò
ÿÿþþýýûûýõ
ÿÿþþýýûûýùã üûÿú	ÿÿÿÿ

ô


ü
ùüú	ý€ Ò 6r   c                   @   sv   e Zd ZdZdZdgZg d¢Zg d¢ZdZdZ	dZ
d	ed
fegeddd�efegeddd�ejfegdœZdd„ ZdS )r   aÍ  
    For C source code with preprocessor directives.

    Additional options accepted:

    `stdlibhighlighting`
        Highlight common types found in the C/C++ standard library (e.g. `size_t`).
        (default: ``True``).

    `c99highlighting`
        Highlight common types found in the C99 standard library (e.g. `int8_t`).
        Actually, this includes all fixed-width integer types.
        (default: ``True``).

    `c11highlighting`
        Highlight atomic types found in the C11 standard library (e.g. `atomic_bool`).
        (default: ``True``).

    `platformhighlighting`
        Highlight common types found in the platform SDK headers (e.g. `clockid_t` on Linux).
        (default: ``True``).
    ÚCÚc)z*.cz*.hz*.idcz*.x[bp]m)ztext/x-chdrztext/x-csrczimage/x-xbitmapzimage/x-xpixmapz6https://en.wikipedia.org/wiki/C_(programming_language)Ú çš™™™™™¹?rU   rV   )Z_AlignasZ_AlignofZ	_NoreturnZ_CountofZ_GenericZ_Thread_localZ_Static_assertZ
_ImaginaryZnoreturnZ	imaginaryÚcomplexr   r+   )Z_BoolZ_ComplexZ_AtomicZ
_Decimal32Z
_Decimal64Z_Decimal128)rM   r   r   c                 C   s,   t  d| t j¡rdS t  d| t j¡r(dS d S )Nz^\s*#include [<"]r“   z^\s*#ifn?def )ÚreÚsearchÚ	MULTILINE©rr   ri   ri   rj   Úanalyse_textP  s    zCLexer.analyse_textN)rw   rx   ry   rz   ÚnameÚaliasesÚ	filenamesÚ	mimetypesÚurlÚversion_addedÚpriorityr   r   r	   r   rn   r�   r™   ri   ri   ri   rj   r     s.   ýýýûþóc                   @   s  e Zd ZdZdZdZddgZg d¢ZddgZd	Z	d
Z
deejeejejeejeƒfdej d eeeejƒdfdedfegeedddd�ejfdejfgedƒdej d eeeejƒdfdedfejejdfdedfedƒgedƒeddd�efdej d eeeejƒdfdedfejejdfdedfedƒgdefdefegdeeeƒdfeddd�efd ed!fd"eeeƒd#fegd$ejfegd%ed&fd'ed(fd)ejfejejfed*ƒgd+edfed,ƒgd-edfd.ed/fd0efd1efejejfedƒgd2edfd.ed3fed4ƒgd5œZ d6d7„ Z!d8S )9r   aÏ  
    For C++ source code with preprocessor directives.

    Additional options accepted:

    `stdlibhighlighting`
        Highlight common types found in the C/C++ standard library (e.g. `size_t`).
        (default: ``True``).

    `c99highlighting`
        Highlight common types found in the C99 standard library (e.g. `int8_t`).
        Actually, this includes all fixed-width integer types.
        (default: ``True``).

    `c11highlighting`
        Highlight atomic types found in the C11 standard library (e.g. `atomic_bool`).
        (default: ``True``).

    `platformhighlighting`
        Highlight common types found in the platform SDK headers (e.g. `clockid_t` on Linux).
        (default: ``True``).
    zC++zhttps://isocpp.org/Úcppzc++)z*.cppz*.hppz*.c++z*.h++z*.ccz*.hhz*.cxxz*.hxxz*.Cz*.Hz*.cpz*.CPPz*.tppz*.cppmz*.ixxz*.mxxz*.ippztext/x-c++hdrztext/x-c++srcr’   r“   z:((?:[LuU]|u8)?R)(")([^\\()\s]{,16})(\()([\s\S]*?)(\)\3)(")z
(\[\[)(=)(ú)Ú
annotationrU   rV   )Zvirtual_inheritanceZuuidofÚsuperZextendsZsingle_inheritanceZmultiple_inheritanceZ	interfaceZ
implementsÚeventrC   rG   r   r   r    z#__(offload|blockingoffload|outer)\brH   rO   rW   )Úclassr;   r+   zusing\bú:z(class|concept|typename)(\s+)r,   )5ZcatchZ
const_castÚdeleteZdynamic_castÚexplicitZexportZfriendZmutableÚnewÚoperatorÚprivateZ	protectedÚpublicZreinterpret_castr¦   Z
__restrictZstatic_castÚtemplater   ÚthrowZthrowsrD   Ztypeidr   ZvirtualZconceptÚdecltypeZnoexceptÚoverrideÚfinalZ	constinitZ	constevalZco_awaitZ	co_returnZco_yieldÚrequiresÚimportÚmoduleÚtypenameÚandZand_eqZbitandZbitorZcomplÚnotZnot_eqÚorZor_eqÚxorZxor_eqZcontract_assertÚpreÚpostznamespace\bÚ	namespacez(enum)(\s+)Úenumnamezchar(16_t|32_t|8_t)\brP   )rO   r^   rQ   )rO   únamespace-bodyzinline\brL   rN   r^   rX   rY   úannotation-argsr[   r\   r]   rR   rM   )rM   r^   r,   r¾   rV   r   r   r½   r¿   r£   rÀ   c                 C   s$   t  d| ¡rdS t  d| ¡r dS d S )Nz#include <[a-z_]+>gš™™™™™É?zusing namespace gš™™™™™Ù?)r•   r–   r˜   ri   ri   rj   r™   Ý  s    zCppLexer.analyse_textN)"rw   rx   ry   rz   rš   rž   r›   rœ   r�   rŸ   r    r   r   r€   Ú	Delimiterr   r{   r   r   Ú	Decoratorr   r	   r   rˆ   ÚPseudor   rŒ   r   r   r   rn   Ú	Namespacer�   r™   ri   ri   ri   rj   r   W  sª   ÿÿÿöþþù
ÿöÿôý
ö
öñþ
ûþ
ú	ý£d)rz   r•   Zpygments.lexerr   r   r   r   r   r   r   r	   Zpygments.utilr
   Zpygments.tokenr   r   r   r   r   r   r   r   r   Ú__all__r   r   r   ri   ri   ri   rj   Ú<module>   s   
(,  
9