o
    nib                     @   s8  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 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 g dZG dd	 d	eZd
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.asm
    ~~~~~~~~~~~~~~~~~~~

    Lexers for assembly languages.

    :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    N)
RegexLexerincludebygroupsusingwordsDelegatingLexer)CppLexerCLexer)DLexer)	TextNameNumberStringCommentPunctuationOtherKeywordOperator)GasLexerObjdumpLexerDObjdumpLexerCppObjdumpLexerCObjdumpLexer
HsailLexer	LlvmLexer	NasmLexerNasmObjdumpLexer	TasmLexer	Ca65Lexerc                   @   sv  e Zd ZdZdZddgZddgZdgZdZd	Z	d
e	 d e	 d Z
dZede
d ejfde
 ejdfdejfe
ejdfdefge
ejfeefde
 ejfeejfdedfededgde
 d eejeeejefde
 d e d eejeeejeejefe
ejfeejfde
 ejfde ejfdejfdedfededg
defdefd efgd!efgd"Zd#d$ Zd%S )&r   z'
    For Gas (AT&T) assembly code.
    GASgasasm*.sz*.Sz
text/x-gasz"(\\"|[^"])*"z[\w$.@-]z(?:[a-zA-Z$_]z*|\.z+)z(?:0[xX][a-zA-Z0-9]+|\d+)
whitespace:z\.directive-argszlock|rep(n?z)?|data\d+instruction-args[\r\n]+@#poppunctuationz([a-z0-9]+)( )(<)(z)(>)z)([-+])(%$z
$'(.|\\')'\n\s+z	[;#].*?\nz[-*,.()\[\]!:]+)rootr%   r&   r#   r*   c                 C   s,   t d| t jr
dS t d| t jrdS d S )Nz^\.(text|data|section)Tz^\.\w+g?)rematchM)text r4   ^/home/ubuntu/SoloSpeech/.venv/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/asm.pyanalyse_text]   s
   zGasLexer.analyse_textN)__name__
__module____qualname____doc__namealiases	filenames	mimetypesstringchar
identifiernumberr   r   Label	AttributeFunctionr   Constantr   r   Integerr   Hexr   VariableCharr   tokensr6   r4   r4   r4   r5   r      sh    
	
4r   c                 C   sR  d}ddt tjtttfdt ttjtfd| d t tjtttjttjtfd| d t tjtttjtfd| d	 | | d
 t ttjttjtt	| fd| d	 | | d t ttjttjttfd| d	 | | d t ttjttjfdtfd| d | d t ttjttj
ttjttjfd| d t ttjttj
ttjfdtfgiS )z;
    Common objdump lexer tokens to wrap an ASM lexer.
    z[0-9A-Za-z]r/   z(.*?)(:)( +file format )(.*?)$z"(Disassembly of section )(.*?)(:)$(z++)( )(<)(.*?)([-+])(0[xX][A-Za-z0-9]+)(>:)$z+)( )(<)(.*?)(>:)$z( *)(z+:)(\t)((?:z )+)( *	)([a-zA-Z].*?)$z )+)( *)(.*?)$z )+)$z	\t\.\.\.$z	(\t\t\t)(z +:)( )([^\t]+)(\t)(.*?)([-+])(0xz+)$z+:)( )([^\t]+)(\t)(.*?)$z[^\n]+\n)r   r   rC   r   r   r   r   rH   rE   r   PropertyrF   r   )	asm_lexerhex_rer4   r4   r5   _objdump_lexer_tokensd   sV   



rP   c                   @   .   e Zd ZdZdZdgZdgZdgZee	Z
dS )r   z)
    For the output of 'objdump -dr'
    objdumpz	*.objdumpztext/x-objdumpN)r7   r8   r9   r:   r;   r<   r=   r>   rP   r   rK   r4   r4   r4   r5   r      s    r   c                       6   e Zd ZdZdZdgZdgZdgZ fddZ  Z	S )r   z=
    For the output of 'objdump -Sr on compiled D files'
    z	d-objdumpz*.d-objdumpztext/x-d-objdumpc                       t t| jttfi | d S N)superr   __init__r
   r   selfoptions	__class__r4   r5   rW         zDObjdumpLexer.__init__
r7   r8   r9   r:   r;   r<   r=   r>   rW   __classcell__r4   r4   r[   r5   r          r   c                       s:   e Zd ZdZdZg dZg dZdgZ fddZ  Z	S )r   z?
    For the output of 'objdump -Sr on compiled C++ files'
    cpp-objdump)ra   zc++-objdumbzcxx-objdump)z*.cpp-objdumpz*.c++-objdumpz*.cxx-objdumpztext/x-cpp-objdumpc                    rT   rU   )rV   r   rW   r   r   rX   r[   r4   r5   rW      r]   zCppObjdumpLexer.__init__r^   r4   r4   r[   r5   r      s    r   c                       rS   )r   z=
    For the output of 'objdump -Sr on compiled C files'
    z	c-objdumpz*.c-objdumpztext/x-c-objdumpc                    rT   rU   )rV   r   rW   r	   r   rX   r[   r4   r5   rW      r]   zCObjdumpLexer.__init__r^   r4   r4   r[   r5   r      r`   r   c                   @   s\  e Zd ZdZdZddgZdgZdgZdZdZ	d	Z
d
e
 d ZdZdZdZdZdZdZdZdZededeefde	 d ejfeejjfedde	 ejjfde	 ejfeejfdejfeejfeejfdejfdefgde fgde!j"fd e!j#fgd!e e$j%fd"e$fe&d#d$d%e$fee$fee$fd&e d' e d e$fd(e$fd)e$fe&d*e$fd+e$fg
d,Z'd-S ).r   z=
    For HSAIL assembly code.

    .. versionadded:: 2.2
    HSAILhsailhsaz*.hsailztext/x-hsail"[^"]*?"z[a-zA-Z_][\w.]*[0-9]+z(\$(c|s|d|q))z(align\(\d+\))z(width\((\d+|all)\))z(alloc\(agent\))z ((_ftz)?(_up|_down|_zero|_near))z_(u8x4|s8x4|u16x2|s16x2|u8x8|s8x8|u16x4|s16x4|u32x2|s32x2|u8x16|s8x16|u16x8|s16x8|u32x4|s32x4|u64x2|s64x2|f16x2|f16x4|f16x8|f32x2|f32x4|f64x2|u8|s8|u16|s16|u32|s32|u64|s64|b128|b8|b16|b32|b64|b1|f16|f32|f64|roimg|woimg|rwimg|samp|sig32|sig64)z ((\d+\.)|(\d*\.\d+))[eE][+-]?\d+zL0[xX](([0-9a-fA-F]+\.[0-9a-fA-F]*)|([0-9a-fA-F]*\.[0-9a-fA-F]+))[pP][+-]?\d+z?0((h|H)[0-9a-fA-F]{4}|(f|F)[0-9a-fA-F]{8}|(d|D)[0-9a-fA-F]{16})r#   commentsr(   z:?keyword&r+   0[xX][a-fA-F0-9]+\d+z[=<>{}\[\]()*.,:;!]|x\b(\n|\s)+z	/\*.*?\*/z//.*?\nkernargz+\$(full|base|small|large|default|zero|near))module	extensionpragmaprogindirect	signaturedeclkernelfunctionenablebreakexceptionsenabledetectexceptionsmaxdynamicgroupsizemaxflatgridsizemaxflatworkgroupsizerequireddimrequiredgridsizerequiredworkgroupsizerequirenopartialworkgroups\bsuffixz_(|_kernargz(nop|imagefence)\b)cleardetectexceptclockcuid	debugtrapdimgetdetectexceptgroupbaseptrkernargbaseptrlaneidmaxcuid	maxwaveidpacketidsetdetectexceptwaveidworkitemflatabsidworkitemflatidnullptrabsbitrevcurrentworkgroupsizecurrentworkitemflatidfractncosnegnexp2nlog2nrcpnrsqrtnsinnsqrt
gridgroupsgridsizenotsqrtworkgroupidworkgroupsizeworkitemabsid
workitemidceilfloorrinttruncaddbitmaskborrowcarrycopysigndivremsubshlshrandorxorunpackhiunpacklomaxminfmamad
bitextract	bitselectshufflecmovbitalign	bytealignlerpnfmamulmulhimul24himul24mad24mad24hi	bitinsertcombineexpandldamovpackunpackpackcvt	unpackcvtsadsementpftosstofcmpldst_eq_ne_lt_le_gt_ge_equ_neu_ltu_leu_gtu_geu_num_nan_seq_sne_slt_sle_sgt_sge_snum_snan_sequ_sneu_sltu_sleu_sgtu_sgeuatomic_ld_st_cas_add_and_exch_max_min_or_sub_wrapdec_wrapinc_xorretcvt	_readonlyr   _globalbrcbrsbr_scacq_screl_scar_rlx_wave_wg_agent_systemldimagestimage_v2_v3_v4_1d_2d_3d_1da_2da_1db_2ddepth	_2dadepth_width_height_depth_array_channelorder_channeltypequerysampler_coord_filter_addressingbarrierwavebarrierinitfbarjoinfbarwaitfbar
arrivefbar	leavefbarreleasefbarldfactivelaneidactivelanecountactivelanemaskactivelanepermutecallscallicallallocapacketcompletionsigaddqueuewriteindexcasqueuewriteindexldqueuereadindexstqueuereadindexreadonlyglobalprivategroupspillarg_upi_downi_zeroi_neari_upi_sat
_downi_sat
_zeroi_sat
_neari_sat_supi_sdowni_szeroi_sneari	_supi_sat_sdowni_sat_szeroi_sat_sneari_sat_pp_ps_sp_ss_s_p_pp_sat_ps_sat_sp_sat_ss_sat_s_sat_p_sat	i[1-9]\d*)r/   r#   rh   ri   N)(r7   r8   r9   r:   r;   r<   r=   r>   r?   rA   register_numberregister	alignQual	widthQual	allocQualroundingModdatatypeModfloathexfloat	ieeefloatr   r   r   rC   rI   	AnonymousGlobalr   rH   FloatrG   r   r   r   	Multiline
Singleliner   Typer   rK   r4   r4   r4   r5   r      sp    
	%(
r   c                   @   s   e Zd ZdZdZdgZdgZdgZdZde d Z	e
d	e	d
 ejfe
dde	 ejfde	 ejjfdejjfdejjfdejjfde	 ejfdejjfde efdefdefdefgdefdefgedddefedejfdefgdZdS ) r   z!
    For LLVM assembly code.
    LLVMllvmz*.llztext/x-llvmre   z([-a-zA-Z$._][\w\-$.]*|rg   r#   z\s*:ri   r+   r(   z%\d+z@\d+z#\d+!z!\d+zc?rk   z,-?\d+(?:[.]\d+)?(?:[eE][-+]?\d+(?:[.]\d+)?)?z[=<>{}\[\]()*.,!]|x\brm   ;.*?\n(  beginendtruefalsedeclaredefinerH  constantrI  linker_privateinternalavailable_externallylinkoncelinkonce_odrweakweak_odr	appending	dllimport	dllexportcommondefaulthidden	protectedextern_weakexternalthread_localzeroinitializerundefnulltotailtargettriple
datalayoutvolatilenuwnswnnanninfnszarcpfastexactinboundsalign	addrspacesectionaliasro   r!   
sideeffectgcdbglinker_private_weak
attributesblockaddressinitialexeclocaldynamic	localexecprefixunnamed_addrcccfastcccoldccx86_stdcallccx86_fastcallcc
arm_apcsccarm_aapcsccarm_aapcs_vfpcc
ptx_device
ptx_kernelintel_ocl_biccmsp430_intrcc	spir_funcspir_kernelx86_64_sysvccx86_64_win64ccx86_thiscallcccccsignextzeroextinregsretnounwindnoreturnnoalias	nocapturebyvalnestreadnonerG  
inlinehintnoinlinealwaysinlineoptsizesspsspreq	noredzonenoimplicitfloatnakedbuiltincold	nobuiltinnoduplicatenonlazybindoptnonereturns_twicesanitize_addresssanitize_memorysanitize_thread	sspstronguwtablereturnedtypeopaqueeqnesltsgtslesgeultugtuleugeoeqoneoltogtoleogeordunouequnexacq_relacquire
alignstackr   catchcleanupfilterinteldialectr   r   	monotonicnandpersonalityreleaseseq_cstsinglethreadumaxumin	unorderedxchgr   faddr   fsubr   fmuludivsdivfdivuremsremfremr   lshrashrr   r   r   icmpfcmpphir>  r   zextsextfptruncfpextuitofpsitofpfptouifptosiinttoptrptrtointbitcastaddrspacecastselectva_argr  r  switchinvokeunwindunreachable
indirectbr
landingpadresumemallocrA  freeloadstoregetelementptrextractelementinsertelementshufflevector	getresultextractvalueinsertvalue	atomicrmwcmpxchgfence	allocsize	amdgpu_cs	amdgpu_gsamdgpu_kernel	amdgpu_ps	amdgpu_vsanyanyregcc
argmemonly
avr_intrccavr_signalcccallercatchpadcatchretcatchswitch
cleanuppad
cleanupretcomdat
convergentcxx_fast_tlsccdeplibsdereferenceabledereferenceable_or_nulldistinct
exactmatchexternally_initializedfromghccchhvm_ccchhvmccifuncinaccessiblemem_or_argmemonlyinaccessiblememonlyinalloca	jumptablelargestlocal_unnamed_addrminsizemusttailnoduplicatesnonenonnull	norecursenotailpreserve_allccpreserve_mostccprologue	safestacksamesizesource_filenameswiftcc
swifterror	swiftselfwebkit_jsccwithin	writeonly
x86_intrccx86_vectorcallccr   r   )
voidhalfrq  doublex86_fp80fp128	ppc_fp128labelmetadatatokenri  )r/   r#   ri   N)r7   r8   r9   r:   r;   r<   r=   r>   r?   rA   r   r   rC   rI   ru  rt  r   r   r   r   r   r   r   ry  rK   r4   r4   r4   r5   r   O  sJ    




114
r   c                   @   sz  e Zd ZdZdZdgZddgZdgZdZdZ	d	Z
d
ZdZed e ZdZdZdZdZdZdZejejB Zdejdfeded ejfde eejej ej dfeedfeej dfeej!dfde"fgee#fe	e$j%fe
e$j&fee$j'fee$j(fee$j)fedeej*feej+fde"dfedgdejfdej,dfdejdfgde"fde"fd ej,fgd!e-fd"e.fd#ejfee.j/feej0fgd$Z1d%S )&r   z)
    For Nasm (Intel) assembly code.
    NASMnasm*.asm*.ASMztext/x-nasmz[a-z$._?][\w$.?#@~]*,(?:0x[0-9a-f]+|$0[0-9a-f]*|[0-9]+[0-9a-f]*h)[0-7]+q[01]+brf   \.e?/"(\\"|[^"\n])*"|'(\\'|[^'\n])*'|`(\\`|[^`\n])*`(?:res|d)[bwdqt]|timesor[0-9][0-5]?[bwd]|[a-d][lh]|[er]?[a-d]x|[er]?[sb]p|[er]?[sd]i|[c-gs]s|st[0-7]|mm[0-7]|cr[0-4]|dr[0-367]|tr[3-7]seg|wrt|strictbyte|[dq]?wordzBITS|USE16|USE32|SECTION|SEGMENT|ABSOLUTE|EXTERN|GLOBAL|ORG|ALIGN|STRUC|ENDSTRUC|COMMON|CPU|GROUP|UPPERCASE|IMPORT|EXPORT|LIBRARY|MODULE^\s*%preprocr#   r$   z(%s)(\s+)(equ)r&   r'   r*   r)   [^;\n]+r}  r-   [ \t]+;.*[,():\[\]]+z[&|^<>+*/%~-]+[$]+r/   r&   r  r#   r*   N)2r7   r8   r9   r:   r;   r<   r=   r>   rA   hexnoctnbinndecnfloatnr?   declkwrk  wordopr  
directivesr0   
IGNORECASE	MULTILINEflagsr   Preprocr   r   rC   r   rF   r   DeclarationrE   r   r   r   rH   OctBinrv  rG   BuiltinrI   Singler   r   Wordry  rK   r4   r4   r4   r5   r     st    





r   c                   @   rQ   )r   zM
    For the output of 'objdump -d -M intel'.

    .. versionadded:: 2.0
    zobjdump-nasmz*.objdump-intelztext/x-nasm-objdumpN)r7   r8   r9   r:   r;   r<   r=   r>   rP   r   rK   r4   r4   r4   r5   r     s    r   c                   @   s  e Zd ZdZdZdgZg dZdgZdZdZ	dZ
d	Zd
Zed e ZdZdZdZdZdZdZdZejejB Zdejdfeded ejfeedfdeef eej ej!ej!dfeej!dfeej"dfde#fgee$fe	e%j&fe
e%j'fee%j(fee%j)fee%j*fedeej+feej,fdee#ej-e#fde#dfedgdejfdej-dfdejdfgd e#fd!e#fd"e#fd#ej-fgd$e.fd%e/fd&ej fee/j0feej1fgd'Z2d(S ))r   z3
    For Tasm (Turbo Assembler) assembly code.
    TASMtasm)r  r  z*.tasmztext/x-tasmz[@a-z$._?][\w$.?#@~]*r  r  r  rf   r  r  r  r  r  r  zBITS|USE16|USE32|SECTION|SEGMENT|ABSOLUTE|EXTERN|GLOBAL|ORG|ALIGN|STRUC|ENDSTRUC|ENDS|COMMON|CPU|GROUP|UPPERCASE|INCLUDE|EXPORT|LIBRARY|MODULE|PROC|ENDP|USES|ARG|DATASEG|UDATASEG|END|IDEAL|P386|MODEL|ASSUME|CODESEG|SIZEzdb|dd|dw|T[A-Z][a-z]+r  r  r#   r$   r&   z(%s)(\s+)(%s)r'   r*   z(\\\s*)(;.*)([\r\n])r)   r  r}  r-   z[\n\r]z\\[\n\r]r  r  r  z[&|^<>+*=/%~-]+r  r  N)3r7   r8   r9   r:   r;   r<   r=   r>   rA   r  r  r  r  r  r?   r  rk  r  r  r  datatyper0   r  r  r  r   r  r   r   rC   r   r   rF   r  rE   r   r   r   rH   r  r  rv  rG   r  rI   r  r   r   r  ry  rK   r4   r4   r4   r5   r     sz    






r   c                   @   s   e Zd ZdZdZdgZdgZejZ	dde
jfdefdejfd	efd
ejfdefdefdejfdejfdejfdejfdefdefgiZdd ZdS )r   z@
    For ca65 assembler sources.

    .. versionadded:: 1.6
    zca65 assemblerca65r"   r/   r  r.   z[a-z_.@$][\w.@$]*:z((ld|st)[axy]|(in|de)[cxy]|asl|lsr|ro[lr]|adc|sbc|cmp|cp[xy]|cl[cvdi]|se[cdi]|jmp|jsr|bne|beq|bpl|bmi|bvc|bvs|bcc|bcs|p[lh][ap]|rt[is]|brk|nop|ta[xy]|t[xy]a|txs|tsx|and|ora|eor|bit)\bz\.\w+z[-+~*/^&|!<>=]z	"[^"\n]*.z	'[^'\n]*.z\$[0-9a-f]+|[0-9a-f]+h\brl   z%[01]+z[#,.:()=\[\]]z[a-z_.@$][\w.@$]*c                 C   s   t d|t jr
dS d S )Nz^\s*;g?)r0   r1   r  )rY   r3   r4   r4   r5   r6   ~  s   zCa65Lexer.analyse_textN)r7   r8   r9   r:   r;   r<   r=   r0   r  r  r   r  r   r   rC   r   Pseudor   r   rJ   r   rH   rG   r  r   rK   r6   r4   r4   r4   r5   r   ]  s2    r   )%r:   r0   pygments.lexerr   r   r   r   r   r   pygments.lexers.c_cppr   r	   pygments.lexers.dr
   pygments.tokenr   r   r   r   r   r   r   r   r   __all__r   rP   r   r   r   r   r   r   r   r   r   r   r4   r4   r4   r5   <module>   s(   
 ,J1 gIP