|eFdZddlZddlmZmZmZmZmZmZm Z m Z ddl m Z ddl mZmZmZmZmZmZmZmZmZddgZGdd eZGd deZGd deZy) z pygments.lexers.c_cpp ~~~~~~~~~~~~~~~~~~~~~ Lexers for C/C++ languages. :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. N) RegexLexerincludebygroupsusingthisinheritdefaultwords) get_bool_opt) TextCommentOperatorKeywordNameStringNumber Punctuation WhitespaceCLexerCppLexerc eZdZdZdZdZdZdZdZdZ dZ d Z d e d e d Z d e jdfde jdfdezdzeeee jdfdezdzeeee jdfdezdzeeej(eefdefdefdefe e j.fe e j0fde j0fg ededdeej6edfdeej6ej8ej8ej8fdezd zezd!zezd"zezd#zezd$zej<fd%ezd zezd!zezd"zezd&zezd'zej<fd(ezd)zezd*zezd+zezd,zej<fd-ezezej>fd.ezej@fd/ezejBfd0ezezejDfd1e#fd2efd3ejHfeefge%d4d5d67e&jNfe%d8d69e&jPfgd:ee&ed;fdd69e&fe%d?d69e&jNfd@e&jNfe%dAd5d67e&jNfgedBeddCe zdDze zdEze zdEze zdFze zdGzeeeeedBHejReedBHeeeedBHeeedIfdCe zdDze zdEze zdEze zdFze zdJzeeeeedBHejReedBHeeeedBHeeefede*dKgedBedLdMefdNedOfgedBedLdPefdQedRfdMedOfgdSedOfdTejVfdUefdefdVefgdCezdWzezdXzeeee jeee jXe j.fdCezdWzezdYzeeee jeee jXe j.fdZe jfd[e j0fd\e j.dOfd]e jfd^e jfde jdOfgd_e jdRfd`e jdOfdae jdOfdbe fgeejZdOfdcedOfe*dOgddedOfeej\fedBedLgde Z/hdfZ0hdgZ1hdhZ2hdiZ3djZ4dmdkZ5yl)n 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][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+0if0z^#macroz^(z )(#if\s+0)z)(#)z4(^[ \t]*)(?!(?:public|private|protected|default)\b)(z)(\s*)(:)(?!:)z\nz[^\S\n]+z\\\nz/(\\\n)?[*][\w\W]*keywordstypesz([LuU]|u8)?(")stringzA([LuU]|u8)?(')(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])(')z0[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)\b)int8int16int32int64wchar_t__\bprefixsuffix) boolintlongfloatshortdoublecharunsignedsignedvoid_BitInt__int128r(z(struct|union)(\s+) classnamezcase\b case-value)asmautobreakconstcontinuer doelseenumexternforgotoifregister restrictedreturnsizeofstructstaticswitchtypedefvolatilewhileunion thread_localalignasalignof static_assert_Pragma)inline_inline__inlinenakedrestrictthreadz(__m(128i|128d|128|64))\b)r8basedexceptstdcallcdeclfastcalldeclspecfinallytryleavew64 unalignedraisenoop identifier forceinlineassume whitespace(z (?:[&*\s])+)(z)(z)(\([^;"\')]*?\))(z)([^;{/"\']*)(\{))statefunctionz)([^;/"\']*)(;) 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.*?(?)z(?DIRFILEdiv_toff_tfpos_tldiv_tsize_ttime_twint_tclock_tjmp_bufssize_tva_listr#wctype_t mbstate_t ptrdiff_t wctrans_t sig_atomic_t>int8_tint16_tint32_tint64_tuint8_tintmax_tintptr_tuint16_tuint32_tuint64_t uintmax_t uintptr_t int_fast8_t int_fast16_t int_fast32_t int_fast64_t int_least8_t uint_fast8_t int_least16_t int_least32_t int_least64_t uint_fast16_t uint_fast32_t uint_fast64_t uint_least8_tuint_least16_tuint_least32_tuint_least64_t>id_tdev_tgid_tino_tkey_tpid_tsig_tuid_tmode_tnfds_trlim_ttimer_tsigset_tsigval_t clockid_t cpu_set_t cpumask_t siginfo_t socklen_t sighandler_t>% atomic_int atomic_bool atomic_char atomic_long atomic_uint atomic_llong atomic_schar atomic_short atomic_uchar atomic_ulong atomic_size_t atomic_ullong atomic_ushortatomic_wchar_tatomic_char16_tatomic_char32_tatomic_intmax_tatomic_intptr_tatomic_ptrdiff_tatomic_uintmax_tatomic_uintptr_tatomic_int_fast8_tatomic_int_fast16_tatomic_int_fast32_tatomic_int_fast64_tatomic_int_least8_tatomic_uint_fast8_tatomic_int_least16_tatomic_int_least32_tatomic_int_least64_tatomic_uint_fast16_tatomic_uint_fast32_tatomic_uint_fast64_tatomic_uint_least8_tatomic_uint_least16_tatomic_uint_least32_tatomic_uint_least64_tc t|dd|_t|dd|_t|dd|_t|dd|_t j |fi|y)NstdlibhighlightingTc99highlightingc11highlightingplatformhighlighting)r rrrrr__init__)selfoptionss 7/usr/lib/python3/dist-packages/pygments/lexers/c_cpp.pyrzCFamilyLexer.__init__s^".w8Ld"S+G5FM+G5FM$0:PRV$W!D,G,c#Ktj|||D]\}}}|tur|jr||jvrt j }n|jr||jvrt j }nU|jr||jvrt j }n*|jr||jvrt j }|||fyw)N) rget_tokens_unprocessedrr stdlib_typesrTyper c99_typesrc11_atomic_typesr linux_types)rtextstackindextokenvalues rrz#CFamilyLexer.get_tokens_unprocesseds11$eD & E5%}**u8I8I/I#LLE))et~~.E#LLE))et7L7L.L#LLE..5DRRYZ '//5 1 7??G , D[= ( eDk7?? 3U < D[6 ! eDk7?? 3W > / / j$**j+ F  H J  * % dO gnn - !2!2 3 "G$5$5 6/ 4 J  G  v > I Q fllFKKfkk J L !E )H 4v = H ,-/78:BCDJLL R 5 (8 3f ?E|| M  !F *X 5 @ &')124>?@F  N H $z 16:: > '* 4fjj A : -vzz : x * ,fnn = !8 , K ( #T\\ 2 TN- 2A% "#*#3#3 5  (-/07  > $Xgz%BK P  . V  ! #*  + &+-.5.>.> @*7+;+; < 7 U , .5-=-=  ? , L ! J  % %)&'*%&)''* ' ' *! !eDk5\#BmmU4|%DDk5\#BDk;0 % %)&'*%&)''* ' ' * eDk5\#BmmU4|%DDk5\#BDk;0 1 G  K ; @ L ! L ! K k6 *   L ! L ! +  K ) K (  66 "<=C]] L 6 " f  FO  $Y~ %d *+@ @tgoouT{ ,,gnn> ?$Y~ %d *+@ @tgoouT{ ,,gnn> ? ) '"3"3 4  0 7?? # 7?? + GOOV ,  $W__g > $goov > & @ w   TZZ ( $ ' FO   V 4 T]] # L ! L !  {cFJ8L:IAK C- &rrceZdZdZdZdgZgdZgdZdZe dd e fe ge d d e jfe gd Z d Zy )ra 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``). Cc)z*.cz*.hz*.idcz*.x[bp]m)z text/x-chdrz text/x-csrczimage/x-xbitmapzimage/x-xpixmap皙?) _Alignas_Alignof _Noreturn_Generic _Thread_local_Static_assert _Imaginarynoreturn imaginarycomplexr%r5)_Bool_Complex_Atomic)rrctjd|tjrytjd|tjryy)Nz^\s*#include [<"]rz ^\s*#ifn?def )research MULTILINErs r analyse_textzCLexer.analyse_text9s7 99)4 > 99%tR\\ : ;rN)rrrrnamealiases filenames mimetypespriorityr rrrrr*rrrrrsw, DeG3ITIHT ' (   3E BGLL Q   Frc 4eZdZdZdZdZddgZgdZddgZd Z d e e je e je je e je fegeed d d ej"fdej$fgededd efej*ej.dfdedfedgde eedfedd efdedfde eedfegdej6fegdedfdej"fej*ej:fed gd!Zd"Zy#)$ra 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``). zC++zhttps://isocpp.org/cppzc++) z*.cppz*.hppz*.c++z*.h++z*.ccz*.hhz*.cxxz*.hxxz*.Cz*.Hz*.cpz*.CPPz*.tppz text/x-c++hdrz text/x-c++srcrz<((?:[LuU]|u8)?R)(")([^\\()\s]{,16})(\()((?:.|\n)*?)(\)\3)("))virtual_inheritanceuuidofsupersingle_inheritancemultiple_inheritance interfaceeventr$r%r&z#__(offload|blockingoffload|outer)\brj)classrHr5rprtz(class|concept|typename)(\s+)r6)4catch const_castdelete dynamic_castexplicitexportfriendmutablenewoperatorprivate protectedpublicreinterpret_castr9 __restrict static_casttemplaterthrowthrowsratypeidrvirtual constexprnullptrconceptdecltypenoexceptoverridefinal constinit constevalco_await co_returnco_yieldrequiresimportmoduletypenameandand_eqbitandbitorcomplnotnot_eqoror_eqxorxor_eqz namespace\b namespacez (enum)(\s+)enumnamezchar(16_t|32_t|8_t)\bz[;{])rpruzinline\brn)rorurkrrrjc`tjd|rytjd|ryy)Nz#include <[a-z_]+>g?zusing namespace g?)r&r'r)s rr*zCppLexer.analyse_texts+ 99)4 0 99' . /rN) rrrrr+urlr,r-r.r/rrr Delimiterrr rr Pseudorrrrrr r rrr Namespacerr*rrrrr@s, D CenG9I!/2IH M fllFF,<,N>Nf..8 9     B/070@0@ B4W^^ D  L ! &u 5w ?  $**f 5 $ ' FO .x/Lk Z  : & 'Wk 2 Xgz:J G  $&w|| 4  k#3 4 '** +  $.. 1 K  _5Fnr)rr&pygments.lexerrrrrrrr r pygments.utilr pygments.tokenr r rrrrrrr__all__rrrrrrrusf """&$$$ Z u&:u&p/\/d[|[r