o
    xi)                     @   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-2017 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ErrorCLexerCppLexerc                   @   s  e Zd ZdZdZ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fdefdefdejfdejfdejfg
deejedfdeejejejejfdejfdejfdejfdejfdejfdefdefdefedddefdejfed ddejfd!ejfed"d#dd$ejfd%ejfd&eejeefd'efge d(d)ee	e
ej!e	e
e	e
ed*fd+ee	e
ej!e	e
e	e
efe"d,ge d(e d-d.efd/ed0fge d(e d-d/efd1ed2fd3ed0fgd4ed0fd5ej#fd6efdefd7efgd8e d9 eejeej$fd:ejfd;ejfd<ejd0fd=ejfd>ejfdejd0fgd?ejd2fd@ejd0fdAejd0fdBefgdCZ%e&dDZ'e&dEZ(e&dFZ)dGdH Z*dIdJ Z+dKS )LCFamilyLexerzg
    For C family source code.  This is used as a base class to avoid repetitious
    definitions.
    z(?:\s|//.*?\n|/[*].*?[*]/)+z\s*(?:/[*].*?[*]/\s*)?z^#if\s+0if0z^#macroz^(z
)(#if\s+0)z)(#)z\nz\s+z\\\nz//(\n|[\w\W]*?[^\\]\n)z/(\\\n)?[*][\w\W]*?[*](\\\n)?/z/(\\\n)?[*][\w\W]*z(L?)(")stringz:(L?)(')(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])(')z'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*z(\d+\.\d*|\.\d+|\d+[fF])[fF]?z0x[0-9a-fA-F]+[LlUu]*z0[0-7]+[LlUu]*z
\d+[LlUu]*z\*/z[~!%^&*+=|?:<>/-]z
[()\[\],.])asmautobreakcaseconstcontinuer   doelseenumexternforgotoifregister
restrictedreturnsizeofstaticstructswitchtypedefunionvolatilewhile\bsuffixz>(bool|int|long|float|short|double|char|unsigned|signed|void)\b)inline_inline__inlinenakedrestrictthreadtypenamez(__m(128i|128d|128|64))\b)r   int8basedexceptint16stdcallcdeclfastcallint32declspecfinallyint64tryleavewchar_tw64	unalignedraisenoop
identifierforceinlineassume__prefixr4   z(true|false|NULL)\bz([a-zA-Z_]\w*)(\s*)(:)(?!:)[a-zA-Z_]\w*
whitespacezB((?:[\w*\s])+?(?:\s|[*]))([a-zA-Z_]\w*)(\s*\([^;]*?\))([^;{]*)(\{)functionz@((?:[\w*\s])+?(?:\s|[*]))([a-zA-Z_]\w*)(\s*\([^;]*?\))([^;]*)(;)	statement
statementsz[{}];#popz\{z#pushz\}"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	(?<=\\)\nz^\s*#if.*?(?<!\\)\nz^\s*#el(?:se|if).*\nz^\s*#endif.*?(?<!\\)\nz.*?\n)rU   rX   rootrW   rV   r   r   r   )size_tssize_toff_trI   	ptrdiff_tsig_atomic_tfpos_tclock_ttime_tva_listjmp_bufFILEDIRdiv_tldiv_t	mbstate_t	wctrans_twint_twctype_t)_Bool_Complexint8_tint16_tint32_tint64_tuint8_tuint16_tuint32_tuint64_tint_least8_tint_least16_tint_least32_tint_least64_tuint_least8_tuint_least16_tuint_least32_tuint_least64_tint_fast8_tint_fast16_tint_fast32_tint_fast64_tuint_fast8_tuint_fast16_tuint_fast32_tuint_fast64_tintptr_t	uintptr_tintmax_t	uintmax_t)	clockid_t	cpu_set_t	cpumask_tdev_tgid_tid_tino_tkey_tmode_tnfds_tpid_trlim_tsig_tsighandler_t	siginfo_tsigset_tsigval_t	socklen_ttimer_tuid_tc                 K   s@   t |dd| _t |dd| _t |dd| _tj| fi | d S )NstdlibhighlightingTc99highlightingplatformhighlighting)r
   r   r   r   r   __init__)selfoptions r   V/home/ubuntu/.local/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/c_cpp.pyr      s   zCFamilyLexer.__init__c                 c   sx    t | |D ]2\}}}|tu r3| jr|| jv rtj}n| jr(|| jv r(tj}n| j	r3|| j
v r3tj}|||fV  qd S )N)r   get_tokens_unprocessedr   r   stdlib_typesr   Typer   	c99_typesr   linux_types)r   textindextokenvaluer   r   r   r      s   
z#CFamilyLexer.get_tokens_unprocessedN),__name__
__module____qualname____doc___ws_ws1r   Preprocr   r   r   r   Single	Multiliner   AffixCharr   FloatHexOctIntegerr   r   r   r	   r   r   Reservedr   BuiltinLabelr   Functionr   EscapePreprocFiletokenssetr   r   r   r   r   r   r   r   r   r      s    



$
	




or   c                   @   s6   e Zd ZdZdZdgZg dZddgZdZdd	 Z	d
S )r   z9
    For C source code with preprocessor directives.
    Cc)z*.cz*.hz*.idcztext/x-chdrztext/x-csrc皙?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r   r   r   r   analyse_text   s
   zCLexer.analyse_textN)
r   r   r   r   namealiases	filenames	mimetypespriorityr   r   r   r   r   r      s    c                   @   s   e Zd ZdZdZddgZg dZddgZdZe	d	d
de
fde
jfdee
edfdeejeejejeejefdeejedfegee	ddd
de
jfde
jfgdejdfdedfgdZdd ZdS )r   z;
    For C++ source code with preprocessor directives.
    zC++cppzc++)z*.cppz*.hppz*.c++z*.h++z*.ccz*.hhz*.cxxz*.hxxz*.Cz*.Hz*.cpz*.CPPztext/x-c++hdrztext/x-c++srcr   )$catch
const_castdeletedynamic_castexplicitexportfriendmutable	namespacenewoperatorprivate	protectedpublicreinterpret_castr9   static_casttemplater   throwthrowsrG   typeidr;   r   virtual	constexprnullptrdecltypethread_localalignasalignofstatic_assertnoexceptoverridefinalr2   r3   zchar(16_t|32_t)\bz(class)(\s+)	classnamez/(R)(")([^\\()\s]{,16})(\()((?:.|\n)*?)(\)\3)(")z(u8|u|U)(")r   )virtual_inheritanceuuidofsupersingle_inheritancemultiple_inheritance	interfaceeventrQ   rR   z#__(offload|blockingoffload|outer)\brT   rZ   z\s*(?=>))rX   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)r   r   r   r   r   r   r   r   r   r	   r   r   r   r   r   r   	Delimiterr   r   Pseudor   Classr   r   r   r   r   r   r      sF    	

%)r   r   pygments.lexerr   r   r   r   r   r   r   r	   pygments.utilr
   pygments.tokenr   r   r   r   r   r   r   r   r   __all__r   r   r   r   r   r   r   <module>   s   
(,  