o a>@sdZddlZddlmZmZmZmZmZmZm Z m Z ddl m Z ddl mZmZmZmZmZmZmZmZmZddgZGdd d eZGd ddeZGd ddeZdS) z pygments.lexers.c_cpp ~~~~~~~~~~~~~~~~~~~~~ Lexers for C/C++ languages. :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. N) RegexLexerincludebygroupsusingthisinheritdefaultwords) get_bool_opt) TextCommentOperatorKeywordNameStringNumber Punctuation WhitespaceCLexerCppLexerc@s(eZdZdZdZdZdZdZdZdZ de j d fd e j d fd ed e e ee j d fd ede e ee j d fdede ee eejeefdefdefdefde jfde jfde jfg ededde ejedfde ejejejejfdedededed ed!ejfd"edededed#ed$ejfd%ed&ed'ed(ed)ejfd*eeejfd+eejfd,eejfd-eeejfd.e fd/efd0ej!feefge"d1d2d3d4e#j$fe"d5d3d6e#j%fgd7e e#ed8fe"d9d3d6e#fe"d:d3d6e#j$fd;e#j$fe"de d?e d@e e eej&e ee eedAfd>e d?e dBe e eej&e ee eefede'dCged=edDdEefdFedGfged=edDdHefdIedJfdEedGfgdKedGfdLej(fdMefdefdNefgd>edOedPe e ee j e ee j)e jfd>edOedQe e ee j e ee j)e jfdRe j fdSe jfdTe jdGfdUe j fdVe j fde j dGfgdWe j dJfdXe j dGfdYe j dGfdZe fgeej*dGfd[edGfe'dGgd\ Z+hd]Z,hd^Z-hd_Z.hd`Z/dadbZ0dcddZ1deS)f 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^#if\s+0if0z^#macroz^(z )(#if\s+0)z)(#)z@(^[ \t]*)(?!(?:public|private|protected|default)\b)(case\b\s+)?(z)(\s*)(:)(?!:)z\nz[^\S\n]+z\\\nz//(\n|[\w\W]*?[^\\]\n)z/(\\\n)?[*][\w\W]*?[*](\\\n)?/z/(\\\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) boolintlongfloatshortdoublecharunsignedsignedvoidr&z(struct|union)(\s+) classname)asmautobreakcaseconstcontinuerdoelseenumexternforgotoifregister restrictedreturnsizeofstructstaticswitchtypedefvolatilewhileunion thread_localalignasalignof static_assert_Pragma)inline_inline__inlinenakedrestrictthreadz(__m(128i|128d|128|64))\b)r3basedexceptstdcallcdeclfastcalldeclspecfinallytryleavew64 unalignedraisenoop identifier forceinlineassume whitespace(z (?:[&*\s])+)(z)(\s*\([^;]*?\))([^;{]*)(\{)functionz)(\s*\([^;]*?\))([^;]*)(;) 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.*?(?)) rfrjrrrootrirhrrrr2>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_tcKsNt|dd|_t|dd|_t|dd|_t|dd|_tj|fi|dS)NstdlibhighlightingTc99highlightingc11highlightingplatformhighlighting)r rrrrr__init__)selfoptionsr7/usr/lib/python3/dist-packages/pygments/lexers/c_cpp.pyrs zCFamilyLexer.__init__ccst||D]>\}}}|tur?|jr||jvrtj}n#|jr(||jvr(tj}n|j r4||j vr4tj}n |j r?||j vr?tj}|||fVqdS)N) rget_tokens_unprocessedrr stdlib_typesrTyper c99_typesrc11_atomic_typesr linux_types)rtextindextokenvaluerrrrs  z#CFamilyLexer.get_tokens_unprocessedN)2__name__ __module__ __qualname____doc___ws1_hexpart_decpart _intsuffix_ident_namespaced_identr PreprocrrrrrLabelrr Single MultilinerrAffixCharrFloatHexBinOctIntegerr Builtinr rReservedrFunctionrEscape PreprocFileClasstokensrrrrrrrrrrrs$     00(           rc@sbeZdZdZdZdgZgdZgdZdZe ddd e fe ge d dd e j fe gd Z d d ZdS)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#r1)_Bool_Complex_Atomic)rrcCs,td|tjr dStd|tjrdSdS)Nz^\s*#include [<"]r z ^\s*#ifn?def )research MULTILINErrrr analyse_texts zCLexer.analyse_textN)rrrrnamealiases filenames mimetypespriorityr rrrrrrrrrrs& c @seZdZdZdZddgZgdZddgZdZd e e j e e j e j e e j e fe ge ed d d d ejfdejfgededd defejejdfdedfedgde eedfedd defdedfde eedfe gdejfe gdedfdejfejejfedgd Zd!d"Zd#S)$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++cppzc++) z*.cppz*.hppz*.c++z*.h++z*.ccz*.hhz*.cxxz*.hxxz*.Cz*.Hz*.cpz*.CPPz text/x-c++hdrz text/x-c++srcr z<((?:[LuU]|u8)?R)(")([^\\()\s]{,16})(\()((?:.|\n)*?)(\)\3)("))virtual_inheritanceuuidofsupersingle_inheritancemultiple_inheritance interfaceeventr"r#r$z#__(offload|blockingoffload|outer)\brf)classrDr1rkroz(class|concept|typename)(\s+)r2))catch const_castdelete dynamic_castexplicitexportfriendmutablenewoperatorprivate protectedpublicreinterpret_castr)rT static_casttemplaterthrowthrowsr]typeidrvirtual constexprnullptrconceptdecltypenoexceptoverridefinal constinit constevalco_await co_returnco_yieldrequiresimportmoduletypenamez namespace\b namespacez (enum)(\s+)enumnamezchar(16_t|32_t|8_t)\bz[;{])rkrpzinline\bri)rjrprOrrrNcCs$td|rdStd|rdSdS)Nz#include <[a-z_]+>g?zusing namespace g?)rrrrrrrls  zCppLexer.analyse_textN)rrrrrrrrr rrr Delimiterrr rrPseudorrrrrr rrrr Namespacerrrrrrrs`        6)rrpygments.lexerrrrrrrrr pygments.utilr pygments.tokenr r r rrrrrr__all__rrrrrrrs ( ,P2