File: //opt/alt/python37/lib/python3.7/site-packages/pygments/lexers/__pycache__/c_cpp.cpython-37.pyc
B
��fF � @ s� d Z ddlZddlmZmZmZmZmZmZm Z m
Z
ddlmZ ddl
mZmZmZmZmZmZmZmZmZ ddgZG dd � d e�ZG d
d� de�ZG dd� de�ZdS )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)�
RegexLexer�include�bygroups�using�this�inherit�default�words)�get_bool_opt) �Text�Comment�Operator�Keyword�Name�String�Number�Punctuation�
Whitespace�CLexer�CppLexerc % @ s� e Zd ZdZdZdZdZdZdZdZ dZ
d Zd
e
� de� d�Zd
e
jdfde
jdfde d eee�e
j�dfde d eee�e
j�dfde d eeejee�fdefdefdefe
e
jfee
jfde
jfged�ed�deeje�dfdeejejejej�fde d e d! e d" e d# e d$ ejfd%e d e d! e d" e d& e d' ejfd(e d) e d* e d+ e d, ejfd-e e ejfd.e ej fd/e ej!fd0e e ej"fd1e#fd2efd3ej$feefge%d4d5d6d7�e&j'fe%d8d6d9�e&j(fgd:ee&e�d;fd<e&d=fe%d>d6d9�e&fe%d?d6d9�e&j'fd@e&j'fe%dAd5d6d7�e&j'fgedB�ed�dCe dD e dE e dE e dF e dG eee�eedBdH�ej)eedBdH�ee�eedBdH�ee�e�dIfdCe dD e dE e dE e dF e dJ eee�eedBdH�ej)eedBdH�ee�eedBdH�ee�e�fed�e*dK�gedB�edL�dMefdNedOfgedB�edL�dPefdQedRfdMedOfgdSedOfdTej+fdUefdefdVefgdCe dW e dX eee�e
jee�e
j,e
j�fdCe dW e dY eee�e
jee�e
j,e
j�fdZe
jfd[e
jfd\e
jdOfd]e
jfd^e
jfde
jdOfgd_e
jdRfd`e
jdOfdae
jdOfdbe
fgeej-dOfdcedOfe*dO�gddedOfeej.fedB�edL�gde�Z/dfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxhZ0dydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�hZ1d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�hZ2d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�h%Z3d�dτ Z4d�d�d҄Z5d�S )��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+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])(')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)Zint8�int16�int32�int64�wchar_t�__z\b)�prefix�suffix)�bool�int�long�float�short�double�charZunsigned�signed�voidZ_BitIntZ__int128)r# z(struct|union)(\s+)� classnamezcase\bz
case-value)�asm�auto�break�const�continuer Zdo�else�enumZextern�for�goto�if�registerZ
restricted�return�sizeof�structZstatic�switchZtypedefZvolatile�while�unionZthread_localZalignasZalignofZ
static_assertZ_Pragma)�inlineZ_inlineZ__inlineZnakedZrestrict�threadz(__m(128i|128d|128|64))\b)r. Zbased�exceptZstdcallZcdeclZfastcallZdeclspec�finally�tryZleaveZw64Z unaligned�raiseZnoop�
identifierZforceinlineZassume�
whitespace�(z
(?:[&*\s])+)(z)(z)(\([^;"\')]*?\))(z)([^;{/"\']*)(\{))�state�functionz)([^;/"\']*)(;)� statement�
statementsz\}z[{;]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.*?\nz\s*(?=>)z(?<!:)(:)(?!:))rF rK r r �rootrJ rI r r r r- z
case-valueZsize_tZssize_tZoff_tr Z ptrdiff_tZsig_atomic_tZfpos_tZclock_tZtime_tZva_listZjmp_buf�FILEZDIRZdiv_tZldiv_tZ mbstate_tZ wctrans_tZwint_tZwctype_tZint8_tZint16_tZint32_tZint64_tZuint8_tZuint16_tZuint32_tZuint64_tZint_least8_tZ
int_least16_tZ
int_least32_tZ
int_least64_tZ
uint_least8_tZuint_least16_tZuint_least32_tZuint_least64_tZint_fast8_tZint_fast16_tZint_fast32_tZint_fast64_tZuint_fast8_tZ
uint_fast16_tZ
uint_fast32_tZ
uint_fast64_tZintptr_tZ uintptr_tZintmax_tZ uintmax_tZ clockid_tZ cpu_set_tZ cpumask_tZdev_tZgid_tZid_tZino_tZkey_tZmode_tZnfds_tZpid_tZrlim_tZsig_tZsighandler_tZ siginfo_tZsigset_tZsigval_tZ socklen_tZtimer_tZuid_tZatomic_boolZatomic_charZatomic_scharZatomic_ucharZatomic_shortZ
atomic_ushortZ
atomic_intZatomic_uintZatomic_longZatomic_ulongZatomic_llongZ
atomic_ullongZatomic_char16_tZatomic_char32_tZatomic_wchar_tZatomic_int_least8_tZatomic_uint_least8_tZatomic_int_least16_tZatomic_uint_least16_tZatomic_int_least32_tZatomic_uint_least32_tZatomic_int_least64_tZatomic_uint_least64_tZatomic_int_fast8_tZatomic_uint_fast8_tZatomic_int_fast16_tZatomic_uint_fast16_tZatomic_int_fast32_tZatomic_uint_fast32_tZatomic_int_fast64_tZatomic_uint_fast64_tZatomic_intptr_tZatomic_uintptr_tZ
atomic_size_tZatomic_ptrdiff_tZatomic_intmax_tZatomic_uintmax_tc K sJ t |dd�| _t |dd�| _t |dd�| _t |dd�| _tj| f|� d S )N�stdlibhighlightingT�c99highlighting�c11highlighting�platformhighlighting)r
rQ rR rS rT r �__init__)�self�options� rX �F/opt/alt/python37/lib/python3.7/site-packages/pygments/lexers/c_cpp.pyrU � s
zCFamilyLexer.__init__�rO c c s� x�t �| ||�D ]|\}}}|tkr�| jr:|| jkr:tj}nF| jrR|| jkrRtj}n.| j rj|| j
krjtj}n| jr�|| jkr�tj}|||fV qW d S )N)
r �get_tokens_unprocessedr rQ �stdlib_typesr �TyperR � c99_typesrS �c11_atomic_typesrT �linux_types)rV �text�stack�index�token�valuerX rX rY r[ � s z#CFamilyLexer.get_tokens_unprocessedN)rZ )6�__name__�
__module__�__qualname__�__doc__Z_ws1Z_hexpartZ_decpartZ
_intsuffix�_identZ_namespaced_identZ_comment_singleZ_comment_multilineZ_possible_commentsr ZPreprocr r r r r ZLabelr r �SingleZ Multiliner r �Affix�Charr ZFloatZHexZBin�OctZIntegerr
ZBuiltinr r �Reservedr] ZFunctionr ZEscapeZPreprocFile�ClassZConstant�tokensr\ r^ r` r_ rU r[ rX rX rX rY r s
00(
*
*
r c @ sj e Zd ZdZdZdgZddddgZdd d
dgZdZe d
dd�e
fege ddd�e
jfegd�Z
dd� ZdS )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�cz*.cz*.hz*.idcz*.x[bp]mztext/x-chdrztext/x-csrczimage/x-xbitmapzimage/x-xpixmapg�������?)
Z_AlignasZ_AlignofZ _NoreturnZ_GenericZ
_Thread_localZ_Static_assertZ
_ImaginaryZnoreturnZ imaginary�complexz\b)r# )Z_BoolZ_ComplexZ_Atomic)r r c C s, t �d| t j�rdS t �d| t j�r(dS d S )Nz^\s*#include [<"]g�������?z
^\s*#ifn?def )�re�search� MULTILINE)ra rX rX rY �analyse_text9 s zCLexer.analyse_textN)rf rg rh ri �name�aliases� filenames� mimetypes�priorityr r r r] rq rx rX rX rX rY r s
c
@ s, e Zd ZdZdZdZddgZdddd d
ddd
dddddg
ZddgZdZ de
ejeej
ej
eej
e�fegeedddd�ejfdejfged�eddd�efejejdfd edfed�gd!e
ee�d"fed#dd�efd$ed%fd&e
ee�d'fegd(ejfegd)ed*fd+ejfejejfed,�gd-�Zd.d/� Zd0S )1r 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``).
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++srcg�������?z<((?:[LuU]|u8)?R)(")([^\\()\s]{,16})(\()((?:.|\n)*?)(\)\3)("))Zvirtual_inheritanceZuuidof�superZsingle_inheritanceZmultiple_inheritanceZ interface�eventr! z\b)r"