o
    jG                     @   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jfdCe dW e dY eeeejeeej,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ej-dOfdcedOfe*dOgddedOfeej.fedBedLgdeZ/h dfZ0h dgZ1h dhZ2h diZ3djdk Z4dpdmdnZ5doS )q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floatZshortdoublecharZunsignedsignedvoidZ_BitIntZ__int128r"   z(struct|union)(\s+)	classnamezcase\b
case-value)!asmautobreakconstZ	constexprcontinuer   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
statementsz\}z[{;]#pop;z\{z#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)(z)("[^"]+")([^\n]*)z)(<[^>]+>)([^\n]*)z[^/\n]+z/[*](.|\n)*?[*]/z//.*?\n/z	(?<=\\)\nz^\s*#if.*?(?<!\\)\nz^\s*#el(?:se|if).*\nz^\s*#endif.*?(?<!\\)\nz.*?\n\s*(?=>)z(?<!:)(:)(?!:))rH   rM   r   r   rootrL   rK   r   r   r   r,   r-   >   Zdiv_tDIRZ	ptrdiff_tZwctype_tZoff_tZtime_tZva_listZldiv_tZclock_tZsize_tZ	mbstate_tZjmp_bufZwint_tZ	wctrans_tZsig_atomic_tZssize_tr   Zfpos_tFILE>   Zint32_tZ	uintptr_tZint_fast64_tZuint16_tZint_fast8_tZuint_fast64_tZuint8_tZuint_least32_tZint_least16_tZuint_fast8_tZintmax_tZuint32_tZint16_tZuint_fast16_tZintptr_tZuint64_tZint_fast16_tZint64_tZint_fast32_tZint8_tZint_least64_tZint_least8_tZuint_least8_tZuint_least16_tZ	uintmax_tZuint_fast32_tZuint_least64_tZint_least32_t>   Zpid_tZtimer_tZino_tZ	siginfo_tZnfds_tZdev_tZ	cpumask_tZrlim_tZmode_tZ	cpu_set_tZuid_tZ	clockid_tZgid_tZsighandler_tZkey_tZsigval_tZid_tZsigset_tZ	socklen_tZsig_t>%   Zatomic_scharZatomic_ullongZatomic_size_tZatomic_llongZatomic_uintptr_tZatomic_int_fast16_tZatomic_uint_fast32_tZatomic_intptr_tZatomic_ushortZatomic_uint_least32_tZatomic_uint_fast64_tZatomic_char32_tZatomic_shortZatomic_ulongZatomic_uintZatomic_char16_tZatomic_ptrdiff_tZatomic_int_least16_tZatomic_int_fast8_tZatomic_charZatomic_boolZatomic_uint_least16_tZatomic_uint_fast16_tZatomic_intmax_tZatomic_ucharZatomic_int_fast64_tZ
atomic_intZatomic_uint_least8_tZatomic_int_least8_tZatomic_uint_fast8_tZatomic_wchar_tZatomic_int_least64_tZatomic_uintmax_tZatomic_longZatomic_int_least32_tZatomic_uint_least64_tZatomic_int_fast32_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
   rV   rW   rX   rY   r   __init__)selfoptions r]   V/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/pygments/lexers/c_cpp.pyrZ      s
   zCFamilyLexer.__init__rS   c                 c   s    t | ||D ]>\}}}|tu r@| jr|| jv rtj}n#| jr)|| jv r)tj}n| j	r5|| j
v r5tj}n| jr@|| jv r@tj}|||fV  qd S )N)r   get_tokens_unprocessedr   rV   stdlib_typesr   TyperW   	c99_typesrX   c11_atomic_typesrY   linux_types)r[   textstackindextokenvaluer]   r]   r^   r`      s   z#CFamilyLexer.get_tokens_unprocessedN)r_   )6__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   Reservedrb   Functionr   EscapePreprocFileClassConstanttokensra   rc   re   rd   rZ   r`   r]   r]   r]   r^   r      s   





 	





  &r   c                   @   sj   e Zd ZdZdZdgZg dZg dZdZdZ	dZ
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) 皙?)Z_AlignasZ_AlignofZ	_NoreturnZ_CountofZ_GenericZ_Thread_localZ_Static_assertZ
_ImaginaryZcountofZnoreturnZ	imaginarycomplexr   r+   )Z_BoolZ_ComplexZ_AtomicZ
_Decimal32Z
_Decimal64Z_Decimal128)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rf   r]   r]   r^   analyse_text;  s
   zCLexer.analyse_textN)rk   rl   rm   rn   namealiases	filenames	mimetypesurlversion_addedpriorityr	   r   r   rb   r   r   r]   r]   r]   r^   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egeeddddejfdejfgededddefejejdfdedfed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jfejejfed!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``).
    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text/x-c++hdrztext/x-c++srcr   r   z<((?:[LuU]|u8)?R)(")([^\\()\s]{,16})(\()((?:.|\n)*?)(\)\3)("))Zvirtual_inheritanceZuuidofsuperZextendsZsingle_inheritanceZmultiple_inheritanceZ	interfaceZ
implementseventrC   rG   r   r   r    z#__(offload|blockingoffload|outer)\brH   )classr;   r+   rN   rR   z(class|concept|typename)(\s+)r,   )5ZcatchZ
const_castdeleteZdynamic_castZ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)\bz[;{])rN   rS   zinline\brL   )rM   rS   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   r]   r]   r^   r     s
   zCppLexer.analyse_textN)!rk   rl   rm   rn   r   r   r   r   r   r   r   r   r   rt   	Delimiterr   r	   r   r|   Pseudor   r   ro   r   r   r   r   r   rb   r   	Namespacer   r   r]   r]   r]   r^   r   B  sd    




7)rn   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   r]   r]   r]   r^   <module>   s    
(, y4