a
    ¨ˆcÂh  ã                   @   s¢   d Z ddl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mZmZmZmZmZmZmZmZ ddlmZ ddlmZ dgZG d	d„ deƒZdS )
zÔ
    pygments.lexers.pascal
    ~~~~~~~~~~~~~~~~~~~~~~

    Lexers for Pascal family languages.

    :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
é    N)ÚLexerÚ
RegexLexerÚincludeÚbygroupsÚwordsÚusingÚthisÚdefault)Úget_bool_optÚget_list_opt)	ÚTextÚCommentÚOperatorÚKeywordÚNameÚStringÚNumberÚPunctuationÚError)ÚScanner)ÚModula2LexerÚDelphiLexerc                   @   s„   e Zd ZdZdZg d¢ZddgZdgZdZdZ	d	Z
h d
£Zh d£Zh d£Zh d£ZdddddœZh d£Zh d£Zdd„ Zdd„ ZdS )r   aF  
    For Delphi (Borland Object Pascal),
    Turbo Pascal and Free Pascal source code.

    Additional options accepted:

    `turbopascal`
        Highlight Turbo Pascal specific keywords (default: ``True``).
    `delphi`
        Highlight Borland Delphi specific keywords (default: ``True``).
    `freepascal`
        Highlight Free Pascal specific keywords (default: ``True``).
    `units`
        A list of units that should be considered builtin, supported are
        ``System``, ``SysUtils``, ``Classes`` and ``Math``.
        Default is to consider all of them builtin.
    ZDelphi)ÚdelphiZpasÚpascalZobjectpascalz*.pasz*.dprztext/x-pascal)8ÚabsoluteÚandÚarrayÚasmÚbeginÚbreakZcaseÚconstÚconstructorÚcontinueÚ
destructorÚdivZdoZdowntoÚelseÚendÚfileÚforÚfunctionÚgotoÚifÚimplementationÚinZ	inheritedÚinlineZ	interfaceÚlabelÚmodÚnilÚnotÚobjectZofÚonÚoperatorÚorÚpackedÚ	procedureÚprogramÚrecordZreintroduceÚrepeatÚselfÚsetÚshlÚshrÚstringZthenÚtoÚtypeÚunitZuntilÚusesÚvarÚwhileÚwithÚxor)ÚasÚclassÚexceptÚexportsÚfinalizationÚfinallyÚinitializationÚisÚlibraryr4   ÚpropertyÚraiseÚ	threadvarÚtry)ÚdisposeÚexitÚfalseÚnewÚtrue>   rE   r!   r,   r:   r   rJ   r&   r    r8   rR   r/   r)   r9   rQ   rB   r5   rD   rT   r#   rO   rC   rM   >   ZnearÚregisterÚnameZdynamicZ	softfloatZnostackframeÚvarargsr.   ZstdcallZ	interruptÚ	assemblerÚexportÚoverrideZvirtualÚaliasZexternalZcdeclr   Zsafecall>   r   ZabstractZ
oldfpccallZ	protectedZfarÚindexZcppdeclr^   Zfar16Z	publishedÚprivater	   ZforwardÚpublic>G   Z	psmallintZwidecharZtobjectZ
pbytearrayÚpointerÚint64ZpstringZpwordZpcompZtdateÚintegerZshortstringZtclassZpint64ÚvariantZreal48ZthandleZpintegerÚrealZpvariantÚwordZwordboolZpdwordZ	pcardinalZpcharZpansistringZ	pdatetimeZphandleÚsingleZlongboolZpboolZshortintr@   ÚcompZcardinalZlongintZpbooleanÚextendedÚdoubleZ	pansicharZ	plongwordZ
pwordarrayZsmallintZpshortstringZ	tdatetimeÚbooleanZbyteboolZttimeZpwidestringZtextfileZansicharZpdoubleÚcurrencyÚbyteZpdateZ	pextendedZppointerZdwordZlongwordZiunknownZ	pshortintZplongintZpsingleÚcharZpbyteZ
widestringZ	pwidecharZ	pcurrencyZ
ansistringZ	pwordboolÚbool)ŠÚabsZacquireexceptionobjectÚaddrZ
ansitoutf8ÚappendZarctanÚassertÚassignedZ
assignfileZbeginthreadZ	blockreadZ
blockwriter   ÚchdirÚchrÚcloseZ	closefileZcomptocurrencyZcomptodoubleÚconcatr"   ÚcopyÚcosÚdecÚdeleterV   ZdoubletocompZ	endthreadZenummodulesZenumresourcemodulesÚeofZeolnZeraseZ
exceptaddrZexceptobjectÚexcluderW   ÚexpÚfileposÚfilesizeZfillcharÚfinalizeZfindclasshinstanceZfindhinstanceZfindresourcehinstanceÚflushÚfracZfreememZ	get8087cwZgetdirZgetlasterrorZgetmemZgetmemorymanagerZgetmodulefilenameZgetvariantmanagerZhaltÚhiÚhighÚincr   Z
initializeÚinsertÚintZioresultZismemorymanagersetZisvariantmanagersetÚlengthÚlnÚloÚlowÚmkdirÚmoverY   ZoddZolestrtostringZolestrtostrvarÚordZ
paramcountZparamstrÚpiÚposÚpredÚptrZ
pucs4charsÚrandomZ	randomizeÚreadZreadlnZ
reallocmemZreleaseexceptionobjectÚrenameÚresetZrewriteÚrmdirÚroundZrunerrorÚseekZseekeofZseekeolnZ	set8087cwZ	setlengthZsetlinebreakstyleZsetmemorymanagerZ	setstringZ
settextbufZsetvariantmanagerÚsinÚsizeofÚsliceZsqrÚsqrtÚstrZstringofcharZstringtoolestrZstringtowidecharÚsuccZswapÚtruncÚtruncateZtypeinfoZucs4stringtowidestringZunicodetoutf8ZuniquestringZupcaseZ
utf8decodeZ
utf8encodeZ
utf8toansiZutf8tounicodeÚvalZvararrayredimZvarclearZwidecharlentostringZwidecharlentostrvarZwidechartostringZwidechartostrvarZwidestringtoucs4stringÚwriteÚwriteln)ùÚabortZaddexitprocZaddterminateprocZadjustlinebreaksZallocmemZansicomparefilenameZansicomparestrZansicomparetextZansidequotedstrZansiextractquotedstrZansilastcharZansilowercaseZansilowercasefilenameZansiposZansiquotedstrZansisamestrZansisametextZansistrcompZansistricompZansistrlastcharZansistrlcompZansistrlicompZansistrlowerZ
ansistrposZansistrrscanZansistrscanZansistrupperZansiuppercaseZansiuppercasefilenameZ	appendstrZ	assignstrZbeepZ	booltostrZbytetocharindexZbytetocharlenZbytetypeZcallterminateprocsZchangefileextZ
charlengthZchartobyteindexZchartobytelenZ
comparememZ
comparestrZcomparetextZ	createdirZ
createguidZcurrentyearZ	currtostrZ
currtostrfÚdateZdatetimetofiledateZdatetimetostrZdatetimetostringZdatetimetosystemtimeZdatetimetotimestampZ	datetostrZ	dayofweekZ
decodedateZdecodedatefullyZ
decodetimeZ
deletefileZdirectoryexistsZdiskfreeZdisksizeZ
disposestrZ
encodedateZ
encodetimeZexceptionerrormessageZexcludetrailingbackslashZexcludetrailingpathdelimiterZexpandfilenameZexpandfilenamecaseZexpanduncfilenameZextractfiledirZextractfiledriveZextractfileextZextractfilenameZextractfilepathZextractrelativepathZextractshortpathnameZfileageZ	filecloseZ
filecreateZfiledatetodatetimeZ
fileexistsZfilegetattrZfilegetdateZfileisreadonlyZfileopenZfilereadZ
filesearchZfileseekZfilesetattrZfilesetdateZfilesetreadonlyZ	filewriteZfinalizepackageZ	findcloseZfindcmdlineswitchZ	findfirstZfindnextZfloattocurrZfloattodatetimeZfloattodecimalZ
floattostrZfloattostrfZfloattotextZfloattotextfmtZ
fmtloadstrZfmtstrZforcedirectoriesÚformatZ	formatbufZ
formatcurrZformatdatetimeZformatfloatZ
freeandnilZgetcurrentdirZgetenvironmentvariableZgetfileversionZgetformatsettingsZgetlocaleformatsettingsÚgetmodulenameZgetpackagedescriptionZgetpackageinfoZgettimeZguidtostringZ	incamonthZincludetrailingbackslashZincludetrailingpathdelimiterZincmonthZinitializepackageZinterlockeddecrementZinterlockedexchangeZinterlockedexchangeaddZinterlockedincrementZinttohexZinttostrZisdelimiterZisequalguidZ
isleapyearZispathdelimiterZisvalididentÚ	languagesZlastdelimiterZloadpackageZloadstrZ	lowercaseZmsecstotimestampZnewstrZnextcharindexÚnowZoutofmemoryerrorZ	quotedstrZraiselastoserrorZraiselastwin32errorZ	removedirZ
renamefileZreplacedateZreplacetimeZsafeloadlibraryZsamefilenameZsametextZsetcurrentdirZshowexceptionÚsleepZstrallocZ
strbufsizeZstrbytetypeZstrcatZstrcharlengthZstrcompZstrcopyZ
strdisposeZstrecopyZstrendZstrfmtZstricompZstringreplaceZstringtoguidZstrlcatZstrlcompZstrlcopyZstrlenZstrlfmtZ	strlicompZstrlowerZstrmoveZstrnewZstrnextcharZstrpasZstrpcopyZ	strplcopyZstrposZstrrscanZstrscanÚ	strtoboolZstrtobooldefZ	strtocurrZstrtocurrdefZ	strtodateZstrtodatedefZstrtodatetimeZstrtodatetimedefZ
strtofloatZstrtofloatdefZstrtointZ
strtoint64Zstrtoint64defZstrtointdefZ	strtotimeZstrtotimedefZstrupperZsupportsZsyserrormessageZsystemtimetodatetimeZtexttofloatÚtimeZtimestamptodatetimeZtimestamptomsecsZ	timetostrZtrimZtrimleftZ	trimrightZtryencodedateZtryencodetimeZtryfloattocurrZtryfloattodatetimeZtrystrtoboolZtrystrtocurrZtrystrtodateZtrystrtodatetimeZtrystrtofloatZtrystrtointZtrystrtoint64ZtrystrtotimeZunloadpackageZ	uppercaseZwidecomparestrZwidecomparetextZ
widefmtstrZ
wideformatZwideformatbufZwidelowercaseZwidesamestrZwidesametextZwideuppercaseZ
win32checkZwraptext),ZactivateclassgroupZallocatehwndZbintohexZchecksynchronizeZcollectionsequalZcountgenerationsZdeallocatehwndZ	equalrectZextractstringsZ	findclassZfindglobalcomponentZgetclassZgroupdescendantswithZhextobinZ
identtointZinitinheritedcomponentZ
inttoidentZinvalidpointZisuniqueglobalcomponentnameZ	linestartZobjectbinarytotextZobjectresourcetotextZobjecttexttobinaryZobjecttexttoresourceZpointsequalZreadcomponentresZreadcomponentresexZreadcomponentresfileZrectZregisterclassZregisterclassaliasZregisterclassesZregistercomponentsZregisterintegerconstsZregisternoiconZregisternonactivexZ
smallpointZstartclassgroupZteststreamformatZunregisterclassZunregisterclassesZunregisterintegerconstsZunregistermoduleclassesZwritecomponentresfile)dZarccosZarccoshZarccotZarccothZarccscZarccschZarcsecZarcsechZarcsinZarcsinhZarctan2ZarctanhÚceilZcomparevalueZcosecantÚcoshZcotZcotanZcothZcscZcschZ
cycletodegZcycletogradZ
cycletoradZ
degtocycleZ	degtogradZdegtoradÚdivmodZdoubledecliningbalanceZensurerangeÚfloorÚfrexpZfuturevalueZgetexceptionmaskZgetprecisionmodeZgetroundmodeZgradtocycleZ	gradtodegZ	gradtoradÚhypotZinrangeZinterestpaymentZinterestrateZinternalrateofreturnZintpowerZ
isinfiniteÚisnanZiszeroÚldexpZlnxp1Úlog10Úlog2ZlognÚmaxZmaxintvalueZmaxvalueÚmeanZmeanandstddevÚminZminintvalueZminvalueZmomentskewkurtosisZnetpresentvalueZnormZnumberofperiodsÚpaymentZperiodpaymentZpolyZ
popnstddevZpopnvarianceÚpowerZpresentvalueZ
radtocycleZradtodegZ	radtogradZrandgZrandomrangeZroundtoZ	samevalueÚsecZsecantZsechZsetexceptionmaskZsetprecisionmodeZsetroundmodeÚsignZsimpleroundtoZsincosÚsinhZslndepreciationZstddevÚsumZsumintZsumofsquaresZsumsandsquaresZsyddepreciationÚtanÚtanhZtotalvarianceZvariance)ÚSystemZSysUtilsZClassesZMath>C   Zcr3Zxmm6ÚalÚspÚssZmm4Zmm6Zdr4Zdr6ÚbxZdhZdr3ZeaxÚesZmm1Zmm7ÚsiZst4Zdr1ZdiZmm2Zxmm7ZbpZdxZdr7Zst5Zdr2ZespZebpZecxZcr1ZcxZst7ÚfsZmm3Zdr0ZedxZclZesiZst2Zmm0Zst3Zst6ÚaxZxmm0Zxmm2Zxmm3Zxmm1ÚcsZxmm5ZahZcr0ZebxZediZdr5ÚchZbhZmm5ZdsZcr2ZgsZcr4ÚdlZxmm4ÚblZst0Zst1>  ZcmovlZcmovgZsysenterZsetnoZrclZsbbZpopawZjnoZpushaZxbtsZcmovncZjeZlfsZrdtscr?   ZcmovpoZstosdZsetbeZverrrH   ZenterZjnaeZlahfZmovswZsvdcZjpeZsetnbeZxlatbZmovzxZcmovnaZcmovleZibtsZbswapZcmovcZrsmZloopZdasZscasbZwbinvdZcmovzZjpoZloopneZmovsxZmovqÚpushZloopzZcmovsZsetnpZcmpsdZiretwZjnlr6   Zwrshrr$   ZbtZjmpZcmovnaeZjnsZjnleZsahfZltrZstosbZcmovpeÚjaZsetcxzÚimulZcmovnpZsetpZsetngeZcltsZjnpZiretZjecxzZjngeZoutsdZpopadÚsubZsyscallZdaaZjpZsetneZinvdZjnbZsetnsZsetngZbtrZjleZjoÚlockZstoswÚjnaÚretZlesZstiZint1ZjcZud2ÚpopZjsZcmpsbÚoutr-   ZsetoZlgsZxaddZ
cmpxchg486Z	cmpxchg8bZlodsdZrepneZjgeZsarZemmsZbsfZsetnaZsvldtZcmovngeZlidtZrorZwrmsrr   ZcpuidZlssZxchgZsetbZcmcZpushfwZjzZcldZcmpxchgZicebpZmovZmovdZrdpmcZbtsZseteZhltZjneZcmovnlZpushfÚboundZsetleZnopZclcZsmiZumovZpopfdr‹   ZcwdeZlodswZcbwZrdmsrZcmovpÚrepZinvlpgZjaeZscasdZshrdZsysexitZjncr2   ZsetncZrepeZxlatZcmovnbeZloadallr¤   ZpushadZcmovaeZ
loadall286ZcmovoZcmpswZleaveZbtcZlcallr�   ZcmovnsZiretdZcdqZsetnzZcmovnoZsetlr   ZcmovngZjngZverwZrsdcZcmovbeÚmulZcmovnbZinsdZsetzZrsldtZsetnleZsysretÚwaitZsidtZsetgZadcZpushawZjcxzZinsbZsalcZrcrÚaddZpopfwZcmovaZshldZlldtZpopfZsldtZsmswZcmovgeZaaaZleaZcmovbZscaswZaadZsetaZsetcZaasZcmovnzZlgdtÚcliZsetnbZjlZsetsZlodsbZretfZcmovneÚtestZloopnzZmovsdZstcZsetpeZbsrÚcwdZmovsbZretnZinswZrolZjgZsetgeZsmintoldZaamZint03ZjnbeZcmoveZpopaZsmintZstdZjbeZrdshrZud1ZjnzZrepnzZlarZsvtsZsgdtÚcmpZjbZsetaeZcmovcxzZrepzZint01Zint3ZldsZloopeZidivZoutswZpushfdZlmswZcmovnleZarplZsalZsetnaeZintoÚcallÚnegr>   ZljmpZlslZsetnlZsetpoZoutsbc                 K   sž   t j| fi |¤Ž tƒ | _t|ddƒr4| j | j¡ t|ddƒrN| j | j¡ t|ddƒrh| j | j¡ tƒ | _	t
|dt| jƒƒD ]}| j	 | j| ¡ q‚d S )NZturbopascalTr   Z
freepascalZunits)r   Ú__init__r=   Úkeywordsr
   ÚupdateÚTURBO_PASCAL_KEYWORDSÚDELPHI_KEYWORDSÚFREE_PASCAL_KEYWORDSÚbuiltinsr   ÚlistÚBUILTIN_UNITS)r<   ÚoptionsrC   © rô   úY/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/pygments/lexers/pascal.pyrê   ,  s    zDelphiLexer.__init__c                 c   s¢  t |tjtjB tjB ƒ}dg}d}d}d}d}d}d}	tƒ }
ddg}|j�sžt}|d dk�r°| d¡rpt	}�qp| d¡r˜|j
 d¡rŽtj}ntj}�qp| d¡r¬tj}�qp| d	¡rÐt}|	rÌ|j
d
krÌd}	�qp| d¡�rht}d}|sî|�r¬|j
dk�r|d  d7  < nX|j
dk�r*|d  d8  < n:|j
dk�rH|d  d7  < n|j
dk�r¬|d  d8  < �qp| d¡�r"|j
 ¡ }|dk�r”tjj}�q¬|| jv �r<t}|�s°|�rî|| jv �rî|d dk�rî|d dk�rîd}d}ddg}tƒ }
|dv �rþd}	n<|dk�r| d¡ n&|dk�r(d}d}n|dv �r d}d}nä|�rV|| jv �rVtj}nÊ|�rr|dv �rrtj}d}n®|�r˜| d¡�rŒtj}n
tj}d}nˆ|�rªtj}d}nv|	�rÈtj}|
  |j
 ¡ ¡ nX||
v �rÚtj}nF|| j!v �rîtj"}n2|| j#v �rtj}n|�s|| j$v �rtj}nt}nŠ| d¡�r>t%}| d¡ nn| d¡�rRt%j&}nZ| d¡�rft'j(}nF| d¡�rzt'j)}n2| d¡�rŽt'j*}nt+|ƒdk�r¤| ,¡  | -¡  �nÀ|d dk�r| d ¡�rÒt%j.}n<| d¡�rìt%}| ,¡  n"| d!¡�rþt%}n| -¡  | ,¡  �n^|d dk�rp| d¡�r4t	}�n<| d"¡�rPt}| ,¡  �n | d¡�rz|j
 d¡�rrtj}ntj}nö| d¡�rŽtj}nâ| d¡�rªt%}| d¡ nÆ| d#¡�r¾tj}n²| d¡�r |j
 ¡ }|| j/v �ræt}n|| j0v �rútj}nt}np| d$¡�rt}n^| d¡�r$t}nL| d¡�r8t'j(}n8| d¡�rLt'j)}n$| d¡�r`t'j*}n| -¡  | ,¡  |j
 1¡ �r†|j
d%k}|j2||j
�p–d&fV  qDd S )'NÚinitialFr   éÿÿÿÿz\s+z\{.*?\}|\(\*.*?\*\)ú$z//.*?$z[-+*\/=<>:;,.@\^]ú;z[\(\)\[\]]+ú(é   ú)ú[ú]z[A-Za-z_][A-Za-z_0-9]*Úresult)r/   r*   Tr   rR   )r8   r5   r)   r!   r#   )rš   r©   z\s*\.\s*ú'r@   z\#(\d+|\$[0-9A-Fa-f]+)z\$[0-9A-Fa-f]+z\d+(?![eE]|\.[^.])z&\d+(\.\d+([eE][+-]?\d+)?|[eE][+-]?\d+)z''z[^']*r&   z@@[A-Za-z_][A-Za-z_0-9]*z[-+*\/=<>:;,.@\^]+Ú.Ú )3r   ÚreÚDOTALLÚ	MULTILINEÚ
IGNORECASEr=   Zeosr   Úscanr   ÚmatchÚ
startswithr   ZPreprocZ	MultilineÚSingler   r   Úlowerr   ZBuiltinZPseudorë   r   ÚBLOCK_KEYWORDSrv   ÚFUNCTION_MODIFIERSrå   ZClassZFunctionZPropertyZLabelrã   ÚBUILTIN_TYPESÚTypeÚ
DIRECTIVESrð   r   ÚCharr   ZHexZIntegerZFloatÚlenrÝ   Zget_charZEscapeÚASM_INSTRUCTIONSÚASM_REGISTERSÚstripZ	start_pos)r<   ÚtextÚscannerÚstackZin_function_blockZin_property_blockZwas_dotZnext_token_is_functionZnext_token_is_propertyZcollect_labelsZblock_labelsZbrace_balanceÚtokenZlowercase_namerô   rô   rõ   Úget_tokens_unprocessed9  s8   








ÿ
þ
ý



ÿÿ



z"DelphiLexer.get_tokens_unprocessedN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r\   ÚaliasesÚ	filenamesÚ	mimetypesrí   rî   rï   r  r  r  r  rò   r  r  rê   r  rô   rô   rô   rõ   r      s,   	!C‹ ))r  r  Zpygments.lexerr   r   r   r   r   r   r   r	   Zpygments.utilr
   r   Zpygments.tokenr   r   r   r   r   r   r   r   r   Zpygments.scannerr   Zpygments.lexers.modula2r   Ú__all__r   rô   rô   rô   rõ   Ú<module>   s   
(,