a
    T_Ta                     @   s  d Z ddlZddlmZmZmZmZmZm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mZ ddlmZ g dZG dd	 d	eZG d
d deZG dd deZG dd deZG dd deZG dd deZG dd de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_like
    ~~~~~~~~~~~~~~~~~~~~~~

    Lexers for other C-like languages.

    :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    N)
RegexLexerincludebygroupsinheritwordsdefault)TextCommentOperatorKeywordNameStringNumberPunctuation)CLexerCppLexer)_mql_builtins)
	PikeLexer	NesCLexer	ClayLexerECLexer	ValaLexer	CudaLexer	SwigLexerMqlLexerArduinoLexerCharmciLexerc                   @   sp   e Zd ZdZdZdgZddgZdgZeddd	e	fd
e	j
fdee	edfdefegdejdfdedfgdZdS )r   z[
    For `Pike <http://pike.lysator.liu.se/>`_ source code.

    .. versionadded:: 2.0
    ZPikeZpikez*.pikez*.pmodztext/x-pike)=catchnewprivate	protectedpublicZgaugethrowthrowsclass	interfaceZ	implementabstractextendsfromthissuperZconstantfinalstaticimportZuseexterninlineprotobreakcontinueifelseforwhiledoswitchcaseasinversionreturntruefalseZnullZ__VERSION__Z	__MAJOR__Z	__MINOR__Z	__BUILD__Z__REAL_VERSION__Z__REAL_MAJOR__Z__REAL_MINOR__Z__REAL_BUILD__Z__DATE__Z__TIME__Z__FILE__Z__DIR__Z__LINE__Z__AUTO_BIGNUM__Z__NT__Z__PIKE__Z__amigaos__Z_Pragmastatic_assertZdefinedZsscanf\bsuffixz(bool|int|long|float|short|double|char|string|object|void|mapping|array|multiset|program|function|lambda|mixed|[a-z_][a-z0-9_]*_t)\b(class)(\s+)	classnamez[~!%^&*+=|?:<>/@-][a-zA-Z_]\w*#popz\s*(?=>))
statementsrE   N)__name__
__module____qualname____doc__namealiases	filenames	mimetypesr   r   Typer   r   r
   r   r   Classtokens rT   rT   8/usr/lib/python3/dist-packages/pygments/lexers/c_like.pyr      s*   	

r   c                   @   sN   e Zd ZdZdZdgZdgZdgZdeddd	e	fed
dd	e	j
fegiZdS )r   z
    For `nesC <https://github.com/tinyos/nesc>`_ source code with preprocessor
    directives.

    .. versionadded:: 2.0
    ZnesCZnescz*.ncztext/x-nescsrcrH   )r&   r:   asyncZatomicZcallZcommandZ	componentZ
componentsZconfigurationZeventr'   ZgenericimplementationZincludesr%   moduler   ZnoraceZpostZprovidessignalZtaskZusesrA   rB   )
Z	nx_structZnx_unionZ	nx_int8_tZ
nx_int16_tZ
nx_int32_tZ
nx_int64_tZ
nx_uint8_tZnx_uint16_tZnx_uint32_tZnx_uint64_tN)rI   rJ   rK   rL   rM   rN   rO   rP   r   r   rQ   r   rS   rT   rT   rT   rU   r   B   s&   r   c                   @   s   e Zd ZdZdZdgZdgZdgZdefde	j
fde	jfd	efd
efdefdejfdejfdejfdefdedfdedfgdejfdefgdefgdedfedgdedfededgdZdS )r   zT
    For `Clay <http://claylabs.com/clay/>`_ source.

    .. versionadded:: 2.0
    ZClayz*.clayZclayztext/x-clayz\sz//.*?$/(\\\n)?[*](.|\n)*?[*](\\\n)?/aK  \b(public|private|import|as|record|variant|instance|define|overload|default|external|alias|rvalue|ref|forward|inline|noinline|forceinline|enum|var|and|or|not|if|else|goto|return|while|switch|case|break|continue|for|in|true|false|try|catch|throw|finally|onerror|staticassert|eval|when|newtype|__FILE__|__LINE__|__COLUMN__|__ARG__)\bz[~!%^&*+=|:<>/-]z[#(){}\[\],;.]z0x[0-9a-fA-F]+[LlUu]*z
\d+[LlUu]*z\b(true|false)\bz(?i)[a-z_?][\w?]*z"""tdqs"dqsz(?i)\\(x[0-9a-f]{2}|.).\nrG   stringsnl)rootr`   ra   r]   r[   N)rI   rJ   rK   rL   rM   rO   rN   rP   r   r	   Single	Multiliner   r
   r   r   HexIntegerr   Builtinr   Escaper   rS   rT   rT   rT   rU   r   _   sB   r   c                   @   sh   e Zd ZdZdZdgZddgZddgZded	d
de	fedd
de	j
fdee	edfdejfegiZdS )r   zU
    For eC source code with preprocessor directives.

    .. versionadded:: 1.5
    ZeCZecz*.ecz*.ehztext/x-echdrztext/x-ecsrcrH   )+virtualr$   r   r!   propertyr-   deleter   Znew0ZrenewZrenew0ZdefinegetsetZremoteZ	dllexportZ	dllimportZstdcallsubclassZ__on_register_module	namespaceusingZtyped_objectZ
any_objectZincrefregisterZwatchZstopwatchingZfirewatchersZ	watchableZclass_designerZclass_fixedZclass_no_expansionZissetZclass_default_propertyZproperty_categoryZ
class_dataZclass_propertyZ	thisclassZdbtableZdbindexZdatabase_openZdbfieldrA   rB   )uintuint16uint32uint64boolbyteunicharint64rD   rE   z(null|value|this)\bN)rI   rJ   rK   rL   rM   rN   rO   rP   r   r   rQ   r   r   r   rg   r   rS   rT   rT   rT   rU   r      s*   		
r   c                   @   s  e Zd ZdZdZddgZddgZdgZdej	d	fd
e
fde
fde
fdejfdejfgdedfdejfde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eejefdeeejfdefedddefedddejfd eeje
d!fd"eeje
d#fd$eeejfed%ddejfd&ejfd'efge d(e!d)ge d(e d*d+efd,ed-fgd.ed-fd/ej"fd0efdefd1efgd2ej	d3fd4ej	d-fd5ej	d-fd6efgd'ej#d-fgd7ejd-fgd8Z$d9S ):r   zW
    For Vala source code with preprocessor directives.

    .. versionadded:: 1.1
    ZValaZvalaZvapiz*.valaz*.vapiztext/x-valaz^\s*#if\s+0if0r_   z\s+z\\\nz//(\n|(.|\n)*?[^\\]\n)rZ   z[L@]?"stringz4L?'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'z(?s)""".*?"""z%(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[lL]?z(\d+\.\d*|\.\d+|\d+[fF])[fF]?z0x[0-9a-fA-F]+[Ll]?z0[0-7]+[Ll]?z\d+[Ll]?z[~!%^&*+=|?:<>/-]z2(\[)(Compact|Immutable|(?:Boolean|Simple)Type)(\])z$(\[)(CCode|(?:Integer|Floating)Type)z
[()\[\],.])!r:   baser1   r9   r   Z	constructr2   r   rk   r7   r4   enumfinallyr5   Zforeachrl   r3   r;   islockr   outparamsr=   rm   sizeofr8   r)   r"   tryZtypeofr6   yieldrA   rB   )r&   constZdelegateZdynamicZensuresr.   r/   ZinternaloverrideZownedr   r    r!   refZrequiresrY   r,   r#   Zunownedvarri   volatileZweakZyieldsz(namespace|using)(\s+)ro   z)(class|errordomain|interface|struct)(\s+)r$   z(\.)([a-zA-Z_]\w*))voidrv   chardoublefloatintZint8Zint16Zint32ry   longshortZsize_tZssize_tr{   Ztime_tZucharrr   Zuint8rs   rt   ru   Zulongrx   Zushortz(true|false|null)\brF   
whitespace	statementrH   z[{}];rG   r\   z/\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})z	[^\\"\n]+z\\z^\s*#if.*?(?<!\\)\nz#pushz^\s*#el(?:se|if).*\nz^\s*#endif.*?(?<!\\)\nz.*?\nz[a-zA-Z_][\w.]*)r   rH   rb   r   r{   rz   r$   ro   N)%rI   rJ   rK   rL   rM   rN   rO   rP   r	   Preprocr   rc   rd   r   ZCharr   ZFloatre   ZOctrf   r
   r   r   r   Z	Decoratorr   r   ZDeclarationZ	NamespaceZ	AttributerQ   rg   r   r   rh   rR   rS   rT   rT   rT   rU   r      s   
	

/




r   c                   @   sb   e Zd ZdZdZddgZddgZdgZh dZh d	Z	h d
Z
h dZh dZddhZdd ZdS )r   u|   
    For NVIDIA `CUDA™ <http://developer.nvidia.com/category/zone/cuda-zone>`_
    source.

    .. versionadded:: 1.6
    ZCUDAz*.cuz*.cuhZcudaZcuztext/x-cuda>   Z__noinline__Z__host__Z__forceinline__
__device__Z
__global__>   Z__restrict__Z
__shared__Z__constant__r   >+   Zlong3Zlong4Zshort3Zulong1Zint4Zfloat1Zuchar1Z
ulonglong2Z	longlong2Zchar3Zushort1Zushort4Zuchar2Zushort3Zdim3Zuint3Zint3Zchar2Zulong3Zfloat2Zfloat4Z	longlong1Zdouble1Zuint2Zulong2Zshort1Zushort2Zchar4Zchar1Zshort2Zuint4Zuchar3Zulong4Zuint1Zshort4Zlong2Zint1Zfloat3Zuchar4Zdouble2Zint2Z
ulonglong1Zlong1>   ZgridDimZ	threadIdxZwarpSizeZblockIdxZblockDim>   Z__threadfenceZ__threadfence_blockZ__syncthreadsZ__threadfence_systemZ__syncthreads_andZ__syncthreads_orZ__syncthreads_countz<<<z>>>c                 c   s   t | |D ]\}}}|tu r|| jv r0tj}nX|| jv rBtj}nF|| jv rTtj}n4|| j	v rftj
}n"|| jv rxtj}n|| jv rtj}|||fV  qd S N)r   get_tokens_unprocessedr   variable_qualifiersr   rQ   vector_types	variablesrg   execution_confsZPseudofunction_qualifiersReserved	functionsFunctionselftextindextokenvaluerT   rT   rU   r   3  s    





z CudaLexer.get_tokens_unprocessedN)rI   rJ   rK   rL   rM   rO   rN   rP   r   r   r   r   r   r   r   rT   rT   rT   rU   r     s   r   c                   @   s\   e Zd ZdZdZdgZddgZdgZdZdd	e	j
fd
e	fdejfegiZh dZdd ZdS )r   zT
    For `SWIG <http://www.swig.org/>`_ source code.

    .. versionadded:: 2.0
    ZSWIGZswigz*.swgz*.iz	text/swigg{Gz?rH   z(%[a-z_][a-z0-9_]*)z\$\**\&?\w+z##*[a-zA-Z_]\w*>R   z%csmethodmodifiersz%csnothrowexceptionz%pragmaz%csconstvaluez%catchesz
%fragmentsz%extend_smart_pointerz%javamethodmodifiersz	%directorz%sizeofz%varargsz
%typecheckz	%fragmentz%headerz%argz
%refobjectz%extendz%mutablez%enddefz
%immutablez%initz%applyz%implicitconvz%csenumz%includez%unrefobjectz%pythonmaybecallz	%callbackz%beginz%pythonappendz%kwargsz
%delobjectz%pythondynamicz%defaultz%shadowz%featurez%definedz%bangz%naturalvarz%ignorez%pythonprependz%importz
%newobjectz%descriptorz
%exceptionz%modulez	%javaenumz%warnfilterz
%attributez%exceptionclassz%trackobjectsz%deletez%nestedworkaroundz%inlinez%defaultdtorz%insertz
%pythonabcz%javaconstvaluez%typemapz%warnz%pythoncallbackz%exceptionvarz	%constantz	%implicitz%ignorewarnz	%perlcodez%nspacez%luacodez%defaultctorz%shared_ptrz%typesz%renamez	%copyctorz%csconstz%pythoncodez%pythonnondynamicz
%javaconstz%ifcplusplusz%definez	%templatez%clearz%javaexceptionc                 C   s:   d}t d| t j}|D ]}|tjv r0d} q6qd}q|S )Nr   z^\s*(%[a-z_][a-z0-9_]*)g\(\?gQ?)refindallMr   swig_directives)r   rvZmatchesmrT   rT   rU   analyse_texts  s    
zSwigLexer.analyse_textN)rI   rJ   rK   rL   rM   rN   rO   rP   Zpriorityr   r   r	   r   r   rS   r   r   rT   rT   rT   rU   r   E  s   r   c                
   @   s   e Zd ZdZdZg dZg dZdgZdee	j
ddefee	jddejfee	jddejfee	jddejfee	jd	dd
ejfegiZdS )r   z
    For `MQL4 <http://docs.mql4.com/>`_ and
    `MQL5 <http://www.mql5.com/en/docs>`_ source code.

    .. versionadded:: 2.0
    ZMQL)ZmqlZmq4Zmq5Zmql4Zmql5)z*.mq4z*.mq5z*.mqhz
text/x-mqlrH   rA   rB   z(clr)?)prefixrC   N)rI   rJ   rK   rL   rM   rN   rO   rP   r   r   keywordsr   Zc_typesrQ   typesr   r   Z	constantsZConstantZcolorsr   rS   rT   rT   rT   rU   r     s    r   c                   @   sV   e Zd ZdZdZdgZdgZdgZddhZh dZ	h d	Z
h d
Zh dZdd ZdS )r   u   
    For `Arduino(tm) <https://arduino.cc/>`_ source.

    This is an extension of the CppLexer, as the Arduino® Language is a superset
    of C++

    .. versionadded:: 2.1
    ZArduinoZarduinoz*.inoztext/x-arduinoZsetupZloop>   orandnotxor>Y   r   Zwordzunsigned longZHIGHr.   Zuint8_tZuint32_tZSYSTEM_RESETr,   Z
atomic_intr?   ZfriendZuint64_tZatomic_longrk   rv   r   r   r   autoZDIGITAL_MESSAGEZatomic_llongr   Zatomic_ullongr$   ZINTERNAL1V1r}   r   Zatomic_scharr   rq   r{   r/   Zint8_tZuint16_tZstatic_castZatomic_uintZbooleanZINTERNAL2V56r   ZINTERNALZ_ComplexZPROGMEMzunsigned charr!   complexZatomic_charZreinterpret_castzunsigned intZint64_tZint32_tZatomic_ulongZLOWZINPUT_PULLUPZOUTPUTrw   ZINPUTunionZunsignedZREPORT_ANALOGarrayZANALOG_MESSAGEZtypedefZexplicitr   ZsignedZatomic_boolZatomic_shortZLED_BUILTINr>   Zatomic_ucharr   r    ri   Z
_ImaginaryZREPORT_DIGITALZSYSEX_STARTZ_BoolZdynamic_castr   Z
const_castr   Zatomic_ushortZint16_tZFIRMATA_STRINGZSET_PIN_MODEZEXTERNALZstructoperator>W  ZWiFiUDPZrequestFromZnoBlinkZ
backgroundZ
releaseAllZ
RobotMotorZpositionZoverflowremoveZbeginTFTZreadMessageZ
readButtonr   Z	SchedulerZreadJoystickXZ	setCursorZprocessInputrl   Z
readSliderZSPIZisDirectoryZ
getYChangeZgetKeyZ	YunServerZ	GSMServerZhighByteZsetBandZbitWriteZconfigZnoStrokeZreadyZ
FileSystemflushZRobotControlZGSMBandZClientZshutdownZlocalIPZRSSIrmdirZbitClearZ
randomSeedZTFTZdrawBMPZsetDNSZpressZattachInterruptZ
debugPrintZ	voiceCallZ	pauseModeZ
createCharclearZopenNextFileZdisplayLogosZsendDigitalPortPairZendWriteZcountryNameReadcloseZisWhitespaceZupdateIRZreadMicrophoneZ
autoscrollbufferbitrunZlistenOnLocalhostZbeginPacketZmouseReleasedZisDigitZEthernetClientZisSpaceZ
parseFloatZSDZtransferZfillZpointZ	sendSysexZuserNameReadZreadNetworksZ	exitValuemapZremoteNumberZcheckRegZSSIDZsinZattachedZrunningopenZTaskZplayFileZmillisZbitSetZGSM_SMSZProcessZ
setTimeoutZnoInterruptsZmoveZ	writeBlueZ
motorsStopZ	noDisplayZFileZnoFillZmaintainZreadBytesUntilZreadStringUntilZgetSignalStrengthZsetBitOrderstepreadZshiftOutZ
macAddressZreadJoystickButtonZwriteMicrosecondsZ	changePINstopZrandomZrunAsynchronouslyZsetModeZanalogReferenceZpinModeZnoAutoscrollZEthernetZimageZBridgeZGPRSZWiFiZdigitalWriteZrectZ
writeGreenZ	constrainZ	getResultZ	onReceiveZsetDataModeZkeyboardReadZbeginTransmissionZdelayZisAlphaZ	IPAddressZprintlnmkdirZ
HttpClientZsetFirmwareVersionZrobotNameReadZreadJoystickYZPImageZ
answerCallZ
GSMScannerZcityNameReadZSoftwareSerialZ
tempoWriteZhangCallZ	endPacketZwaitContinueZknobReadZisListeningZisHexadecimalDigitZisPrintableZAudioZuserNameWriteZreadLightSensorZ	findUntilZ	getSocketZsqrtZ
getPINUsedZrewindDirectoryZGSMZanalogWriteZmouseDraggedZencryptionTypeZ	isPressedhomeZ
playMelodypeekZconnectZreadJoystickSwitchZkeyReleasedZ	readGreenZcityNameWritelineZreadRedZtoneZdigitalReadZ
disconnectZscrollDisplayRightZputZtanZMouseZpulseInwriteZ	loadImageZ
WiFiClientZ
remotePortZisPINZreadTemperaturereleaseZGSMModemZKeyboardZMailboxZBSSIDZ	tuneWriteZEsploraZisAsciiZMouseControllerZretrieveCallingNumberZEEPROMZ
getXChangeZ
sendAnalogZdrawCompassZpointToZmicrosZsendDigitalPortsZ
mouseMovedZprepareZwriteMessageZisValidZGSMPINendZreadAccelerometerZUSBHostZcompassReadZdetachInterruptZ	availableZprintFirmwareVersionZgetAsynchronouslyZserialEventZEthernetServerabsZisAlphaNumericZsetClockDividerZGSMVoiceCallZ	writeJSONZ	connectedZConsoleZcountryNameWriteZ	onRequestZnoToneZbeginZgetCurrentCarrierZ
interruptsZrobotNameWriteZbeepZnoListenOnLocalhostZlistenZremoteIPZblinkVersionZblinkZattachZlowByteZcursorZheightZparseCommandZ	switchPINprintZbeginSDZscrollDisplayLeftZFirmataZscanNetworkswidthZ	startLoopZServoZ	GSMClientZendTransmissionZbeginSMSZ	getButtonpowZgetVoiceCallStatusZ
readStringZSerialZprocessZdelayMicrosecondsZclearScreenZ
EsploraTFTexistssizeZbitReadZgetBandZrunShellCommandZ	getOemKeyZshiftInZdisplayZisActionDoneZsetSpeedZreadBluefindseekZstrokeZendSMSZmotorsWriteZrightToLeftZ	YunClientZlineFollowConfigZisLowerCaseZwriteRedZmousePressedZleftToRightZ
sendStringZ
beginWriteZwriteRGBZ
subnetMaskZEthernetUDPFileIOZanalogWriteResolutionZ
keyPressedZparseIntZgetIMEIZ	isControlZServerZ
setPINUsedZStreamZ
WiFiServerdetachZ	readBytesZisUpperCaseZIRreadZ
analogReadZnoBufferZ
attachGPRSr   ZisPunctZprintVersionZbeginSpeakerZanalogReadResolutionZStepperZaddParameterZsetTextSizeminZnoCursorZclickZmessageAvailableZKeyboardControllerZLiquidCrystalZcircleZgetModifiersZcheckPINZparsePacketZrunShellCommandAsynchronouslyZcosZisGraphZcheckPUKZWiremaxZ	gatewayIPZturn>   typenameZrestrictr)   Ztypeidro   ZalignofZasmZdecltypetemplateZnoexceptr@   mutableZthread_localrp   Z	constexprc                 c   s   t | |D ]\}}}|| jv r0|tj|fV  q|| jv rH|t|fV  q|| jv rb|tj	|fV  q|| j
v rz|t|fV  q|| jv r|tj|fV  q|||fV  qd S r   )r   r   	structurer   rg   	operatorsr
   r   r   r   suppress_highlightr   r   r   rT   rT   rU   r     s    




z#ArduinoLexer.get_tokens_unprocessedN)rI   rJ   rK   rL   rM   rN   rO   rP   r   r   r   r   r   r   rT   rT   rT   rU   r     s   	Ar   c                   @   sP   e Zd ZdZdZdgZdgZg Zddee	e
dfede	fed	e	fegiZd
S )r   zj
    For `Charm++ <https://charm.cs.illinois.edu>`_ interface files (.ci).

    .. versionadded:: 2.4
    ZCharmciZcharmciz*.cirH   z(module)(\s+)rE   )Z
mainmoduleZ	mainchareZcharer   groupZ	nodegroupmessageZconditional)entryZ	aggregateZthreadedsyncZ	exclusiveZnokeepZnotraceZ	immediateZ	expeditedr/   ZlocalpythonZaccelZ	readwriteZ	writeonlyZ
accelblockZmemcriticalZpackedZvarsizeZinitprocZinitnodeZinitcallZ	stacksizeZ
createhereZ
createhomeZreductiontargetZigetZnocopyr   Z
migratablereadonlyN)rI   rJ   rK   rL   rM   rN   rO   rP   r   r   r   r   r   rS   rT   rT   rT   rU   r     s    r   )"rL   r   Zpygments.lexerr   r   r   r   r   r   Zpygments.tokenr   r	   r
   r   r   r   r   r   Zpygments.lexers.c_cppr   r   Zpygments.lexersr   __all__r   r   r   r   r   r   r   r   r   r   rT   rT   rT   rU   <module>   s"   
 ((3!b0= 