a
    lch                     @   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.
    Delphi)delphipaspascalobjectpascalz*.pasz*.dprztext/x-pascal)8absoluteandarrayasmbeginbreakcaseconstconstructorcontinue
destructordiv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libraryr9   propertyraise	threadvartry)disposeexitfalsenewtrue>   rO   r=   rY   r%   rJ   r>   r!   r:   r'   r$   r?   rR   rG   rI   rT   rH   r4   r+   rW   rV   r1   r.   >   Zexportaliasnamer   ZexternalZnearZstdcallr3   Z	softfloatZsafecallZvirtualoverrideZcdeclregisterZdynamicZ	interruptZnostackframe	assemblervarargs>   forwardr	   publicZfar16rd   r   indexZ
oldfpccallprivateZ	publishedZfarZabstractZcppdeclZ	protected>G   extendedZ	plongwordZdwordZwordboolbooleanZ	pcurrencyZreal48Z
ansistringZpint64ZpshortstringwordZint64integerZ	pdatetimeZ
widestringdoubleZpbooleanZphandleZpintegerZpsingleZ	pcardinalZpwidestringZtobjectcharZshortstringZttimeZ	pextendedZtextfileZpointercompZpcompZ	psmallintZ	pshortintZsmallintZ	pwidecharZtclassZlongboolZwidecharZpboolrealZbyteboolZ
pwordarrayZpansistringZ	pwordboolZtdatecurrencysingleZpwordZlongwordZ
pbytearrayZplongintZpstringZ	tdatetimevariantZppointerZcardinalZshortintbyteZiunknownZpdoubleZpdwordrE   ZlongintZthandleZpdateZpcharZpvariantZ	pansicharZansicharZpbytebool)absZacquireexceptionobjectaddrZ
ansitoutf8appendZarctanassertassignedZ
assignfileZbeginthreadZ	blockreadZ
blockwriter"   chdirchrcloseZ	closefileZcomptocurrencyZcomptodoubleconcatr&   copycosdecdeleter[   ZdoubletocompZ	endthreadZenummodulesZenumresourcemoduleseofZeolnZeraseZ
exceptaddrZexceptobjectexcluder\   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mover^   ZoddZolestrtostringZolestrtostrvarordZ
paramcountZparamstrpipospredZptrZ
pucs4charsrandomZ	randomizereadZreadlnZ
reallocmemZreleaseexceptionobjectrenameresetZrewritermdirroundZrunerrorseekZseekeofZseekeolnZ	set8087cwZ	setlengthZsetlinebreakstyleZsetmemorymanagerZ	setstringZ
settextbufZsetvariantmanagersinZ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readcomponentresfile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   clblZdr4spfsaxcsZcr0Zdr7gsZdr6Zdr0Zcr3ZecxZmm5Zdr1Zdr3Zmm6ZahZmm7ZeaxZst6Zst1ssZedxZdr5ZdhZebxZmm4Zmm1Zxmm5ZcxZst0Zmm3Zst5Zxmm7albpchZmm2siZst3Zcr1ZespdlZxmm6ZbhZxmm1bxZdr2ZebpZxmm0ZdsZxmm3Zxmm4Zst4Zst7Zst2esZediZxmm2Zmm0Zcr4ZdxZesiZcr2Zdi>  Z	cmpxchg8bZidivZsetpoZsetgZrepeZjbeZmovzxZsldtZint3ZpushfdZsetleZsetnoZsetzZsetnlZmovqZlcallZsysretZwrmsrZinswmulZbtrZaaaZcmovnleZjeZlodsbZcmovlZlssZaadZiretr7   ZpopawZpopfZibtsZsetcxzZverwZmovdZjgeZcmovpeZcmpxchgr2   ZsetncZsysexitZlarZlidtZsbbZumovZrsldtZmovsdZsidtZpopfdZretnZpushawZxaddZldsZbtcZstoswZcmoveZrclZsmintZcmcZsetpeZcmovnbZstosbZloopneloopZicebpZlahfZjcxzZsmswjlZaamZiretdZcpuidZcbwZint01ZrdshrZcmovnaeZjoZnoprM   ZaasZsetcZsetngeZsyscallZcmovnecliZscasdZcmovbimulZbtZwbinvdZxlatZsvldtZsetneZcmovgZcmovpoZcmovaZcltsZiretwZsetnaZdaaZpushfwZinvlpgZcmovnpjpZcmovgeZmovsxZjcZloopeZpushaZsgdtjaZcmovnsZloopnzZsetnbZjnoZsetngZint03ZleavelslZpopadZpushadZpushfr   ZsetlZjnaZemmsZleaZstcZbsfZsetbZlfsZsetnzZloopzZjgZsetbeZmovswZint1ZcmovngeZmovsbZjngZsetnaeZsetnberC   cwdZjnbZcldZoutsbZxchgZjnaeretsubZcwdeZcmovbeZrcrZsmintoldZcmovnbeZjmpZrdmsrZrdpmcZcmovngZbtsZoutswcallZcmovnlZrsmZinsbZlodswr   testZjpoZinvdZscaswZud2Zud1ZrepzZshldZsahfZjnsZrorZsetaeZcmovncZjnbeZ
loadall286Zjnpr(   ZseteZsetnleZjnleZloadallZcmovleZsysenterZrolZcmovcZoutsdZsetgeaddZinsdZcmovnaZcmovsZarplZjneZlldtZljmpr;   ZsetaZcdqZshrdpopZadcoutr   ZsetoZrsdcwaitZcmovnoZcmovaeZjpeZbsrZbswaprD   cmpZlgdtZsalr   ZjbZlgsZcmpswZretfZsetpZlmswjsZjecxzrepboundZsalcZjncZxbtsZcmovpZsetnpZlesZrepnzZclcr   ZjnlZstdZscasbpushZstiZcmpsdZdasZltrZrepneZpopaZsmiZcmovoZlodsdZwrshrZjaeZjleZcmovcxzZcmovnzZverrZjngeZcmpsbZintoZsetnsnegZstosdZpopfwZhltlockZmovZcmovzZsetsZsvdcZsarZxlatbZjnzZjzZenterZ
cmpxchg486ZsvtsZrdtscc                 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|  qd S )NZturbopascalTr   Z
freepascalZunits)r   __init__rB   keywordsr
   updateTURBO_PASCAL_KEYWORDSDELPHI_KEYWORDSFREE_PASCAL_KEYWORDSbuiltinsr   listBUILTIN_UNITS)rA   optionsrH    r   R/var/www/html/django/DPS/env/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st}|d dkr|drpt	}qp|dr|j
drtj}ntj}qp|drtj}qp|d	rt}|	r|j
d
krd}	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rtjj}q|| jv r<t}|s|r|| jv r|d dkr|d dkrd}d}ddg}t }
|dv rd}	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rtj}n
tj}d}n|rtj}d}nv|	rtj}|
 |j
  nX||
v rtj}nF|| j!v rt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rt'j*}nt+|dkr|,  |-  n|d dkr|d rt%j.}n<|drt%}|,  n"|d!rt%}n|-  |,  n^|d dkrp|dr4t	}n<|d"rPt}|,  n |drz|j
drrtj}ntj}n|drtj}n|drt%}|d n|d#rtj}n|dr |j
 }|| j/v rt}n|| j0v rt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
pd&fV  qDd S )'NinitialFr   z\s+z\{.*?\}|\(\*.*?\*\)$z//.*?$z[-+*\/=<>:;,.@\^];z[\(\)\[\]]+(   )[]z[A-Za-z_][A-Za-z_0-9]*result)r4   r/   Tr    rW   )r=   r:   r.   r%   r'   )r   r   z\s*\.\s*'rE   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
IGNORECASErB   Zeosr   scanr   match
startswithr   Preproc	MultilineSingler   r   lowerr   BuiltinPseudor   r   BLOCK_KEYWORDSry   FUNCTION_MODIFIERSr   ClassFunctionPropertyLabelr   BUILTIN_TYPESType
DIRECTIVESr   r   Charr   HexIntegerFloatlenr   Zget_charEscapeASM_INSTRUCTIONSASM_REGISTERSstrip	start_pos)rA   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__ra   aliases	filenames	mimetypesr   r   r   r  r  r!  r  r   r)  r(  r   r0  r   r   r   r   r      s,   	!C ))r4  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   
(,