o
    ;hy                     @   s   d Z ddlZddl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d	gZG d
d	 d	eZG dd deZdS )z
    pygments.lexers.pascal
    ~~~~~~~~~~~~~~~~~~~~~~

    Lexers for Pascal family languages.

    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    N)Lexer)get_bool_optget_list_opt)	CommentOperatorKeywordNameStringNumberPunctuationError
Whitespace)Scanner)Modula2LexerDelphiLexerPortugolLexerc                   @   s>   e Zd ZdZdZdgZddgZg ZdZdZ	dd	 Z
d
d ZdS )r   z;For Portugol, a Pascal dialect with keywords in Portuguese.Portugolportugolz*.algz
*.portugolz>https://www.apoioinformatica.inf.br/produtos/visualg/linguagem c                 K   s.   t j| fi | tdi |ddi| _d S )Nr   T )r   __init__r   lexer)selfoptionsr   r   I/var/www/html/venv/lib/python3.10/site-packages/pygments/lexers/pascal.pyr   "   s   zPortugolLexer.__init__c                 C   s   | j |S )N)r   get_tokens_unprocessed)r   textr   r   r   r   &   s   z$PortugolLexer.get_tokens_unprocessedN)__name__
__module____qualname____doc__namealiases	filenames	mimetypesurlversion_addedr   r   r   r   r   r   r      s    c                   @   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
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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-pascalz+https://www.embarcadero.com/products/delphir   )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repeatr   setshlshrstringZthentotypeunitZuntilusesvarwhilewithxor)asclassexceptexportsfinalizationfinallyinitializationislibraryrH   propertyraise	threadvartry)disposeexitfalsenewtrue>   rL   r@   r:   rU   r4   rW   rX   rC   rg   r]   rN   rV   r3   rM   r`   r6   r0   rd   rI   rb   re   r=   >   ZdynamicZcdeclrB   r*   Znear	assemblerregisterZstdcallaliasZexportoverrideZ	interruptZvirtualZsafecallZ	softfloatr!   ZexternalZnostackframevarargs>   Z	protectedpublicZcppdeclZfarabstractrn   Z
oldfpccallforwarddefaultZfar16privateZ	publishedr,   index>G   ZtobjectZpboolZpdwordZtdateZpsingleZ
widestringZpvariantZcardinalZtclassZ
pbytearraydoubleZpointerZpcompZiunknownZphandleextendedsingleZthandleZpstringZansicharintegerZ	plongwordbyteZ	pansicharbooleanZbyteboolZpbooleanZpdoubleZpwidestringZshortintZtextfileZ	pcurrencyZint64ZpbyteZpintegerZpdateZ
pwordarraywordZpshortstringcomprealZlongintZ	pwordboolZshortstringZ	pcardinalZppointerZwordboolrS   ZdwordZpint64Z	pshortintboolZreal48ZlongboolcurrencyZttimeZ	pwidecharcharvariantZ	tdatetimeZ
ansistringZpansistringZ	pextendedZ	psmallintZpcharZ	pdatetimeZsmallintZplongintZwidecharZlongwordZpword)absZacquireexceptionobjectaddrZ
ansitoutf8appendarctanassertassignedZ
assignfileZbeginthreadZ	blockreadZ
blockwriter1   chdirchrcloseZ	closefileZcomptocurrencyZcomptodoubleconcatr5   copycosdecdeleteri   ZdoubletocompZ	endthreadZenummodulesZenumresourcemoduleseofZeolnZeraseZ
exceptaddrZexceptobjectexcluderj   expfileposfilesizeZfillcharfinalizeZfindclasshinstanceZfindhinstanceZfindresourcehinstanceflushfracZfreememZ	get8087cwZgetdirZgetlasterrorZgetmemZgetmemorymanagerZgetmodulefilenameZgetvariantmanagerZhalthihighincincludeZ
initializeinsertintZioresultZismemorymanagersetZisvariantmanagersetlengthlnlolowmkdirmoverl   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)darccosZarccoshZarccotZarccothZarccscZarccschZarcsecZarcsechZarcsinZarcsinhZarctan2ZarctanhceilZcomparevalueZcosecantcoshZcot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log2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dxZst4Zmm0ZespZdhesblZebpZedxbxdlspZahZcr3Zst3ZeaxZmm4gsZdr4Zxmm7Zdr2Zxmm2chZdr5Zst5Zcr1Zdr6ZdiZcr4ZesialZst0Zcr2Zmm2Zxmm4ZebxcsZmm5Zmm6Zdr3Zst2Zst6Zcr0ZediZcxZxmm5Zmm3axZmm7ZecxsissZst1Zxmm3Zdr1fsZdr0Zxmm1ZbhZxmm0ZdsbpZst7Zxmm6Zdr7clZmm1>  ZcmovnpZcmovlZiretwZcmovnaZloadallZlodsbZinvdZlodsdZcmovgeZint1Zcpuidr   ZjpoZjnpZjmpsubZcmovzZibtsZjnbeZiretZsetlZcmovlecmpZsetbeZjnaZmovdZsmir-   ZsetncZcmpsdZsmswZpopfdZrdpmcr   ZrdtscZjbejsZmovqZpushfZxlatZstiZlmswZcmovngZcmpswZverwjaZmovsdZjneZsalcZsetngZud1ZcmovgZinsdZrsldtZmovswrA   ZseteZ
loadall286ZiretdZpopawZpopfwZxaddZlidtZltrZoutswZcmovnsZlcallZbswapZrepnzZcmovnbeZjaeZbtcZsetaeboundr7   ZjleZjpeZpushaZsetoZmovsbZjnler   r[   ZcmpsboutlockZretnZrcrZloopneZjgeZsvldtjlZcldZjzZpushawZbsrZjngeZsetcxzZud2ZcltsZaamcallZint3ZljmprJ   ZaadZsetcZshldZbtZxbtsZsetpoZcmovngeZcbwZsetbZsetpeimulZloopnzZlgdtZsetnlZcmovnbZcmovcxzrepZlssZrepzZrorrQ   ZstoswZsvtsZlahfZcmovbeZcwdeZjgZsetnleZsyscallr   ZleaveZsbbZsysexitZcdqZarplZoutsdZjnlZidivZretfZlldtZrdshrZscasdZsetngeZnopZpopfZsldtZrclZpushfwZstcZmovzxZdaanegZscasbZsmintoldZoutsbZsetpZcmovecliZadcZcmovneZint01ZjnsZloopzZcmovpoZpopadZsalZscaswaddZcmovnoZcmovnzZwbinvdZcmovaeZlfsZjecxzZsmintZsysretZcmovpeZsetgZbtsZsetnbrF   ZverrZldsZjnzwaitZintoZsysenterZcmovcZshrdZicebpZint03ZpushadZsetnpZsetnzZaaaZsetaZjoloopZsetnoZ
cmpxchg486ZjnoZsetzZsetsZcmovnlZcmovoZcmovaZclcZrdmsrZrolZsetnsZcmpxchgZsetnaZsgdtZenterZlodswZcmovnleZxchgZcmovbZinvlpgZjngZ	cmpxchg8bZrsmZinswpushZpushfdZsahfZjnaeZwrmsrZrsdcZsarZhltZjbZcmcZrepneZumovZbtrZleaZsetleZsetgeZcmovpZlgsmulZstosdZxlatbcwdtestZaasZemmsZjcxzretZsetneZmovsxZsidtjpZsetnaeZcmovncZjncZjeZcmovsZlooperR   ZbsfZmovZlesZsvdcZpopaZstdZwrshrZcmovnaeZjnblslZrepeZlarZsetnbeZjcZstosbZdasZinsbpop)MZ	aleatorioZ	algoritmoZarquivoZateZcasoZ
cronometrodebugeZecoZenquantoZentaoZescolhaZescrevaZescrevalZfacaZfalsoZfimalgoritmoZfimenquantoZ
fimescolhaZ	fimfuncaoZfimparaZfimprocedimentoZ	fimrepitaZfimsefuncaoZinicior   Z
interrompaZleiaZ	limpatelarD   ZnaoZouZ	outrocasoparaZpassoZpausaprocedimentoZrepitaZretorneseZsenaoZtimerrX   ZvetorZ
verdadeiroZxour7   rD   r   r   Zarcsenr   r   r   ZExpZgraupradr   logr   r   ZquadZradpgrauZraizqZrandZrandiZsenZTanascZcaracZ	caracpnumZcomprZcopiaZmaiuscZminuscZ	numpcaracr   >   Zlogicor   ZinteiroZ	caracterec                 K   s   t j| fi | t | _t | _t|ddr*| j| j | j| j d| _	d S d| _	t|ddr:| j| j
 t|ddrG| j| j t|ddrT| j| j t|dt| jD ]}| j| j|  q]d S )Nr   FTZturbopascalr(   Z
freepascalZunits)r   r   rP   keywordsbuiltinsr   updatePORTUGOL_KEYWORDSPORTUGOL_BUILTIN_TYPESis_portugolTURBO_PASCAL_KEYWORDSDELPHI_KEYWORDSFREE_PASCAL_KEYWORDSr   listBUILTIN_UNITS)r   r   rV   r   r   r   r     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rb|dr9t	}n7| j
sQ|drQ|jdrLtj}n$tj}n|dr[tj}n| j
rg|d	rgt}n	| j
s||d
r|t}|	rz|jdkrzd}	n|drt}d}|s|r|jdkr|d  d7  < n|jdkr|d  d8  < n|jdkr|d  d7  < n|jdkr|d  d8  < n|dr|j }|dkrtjj}n|| jv r>t}| j
r|dv rd}d}n|s|r|| jv r|d dkr|d dkrd}d}ddg}t }
|dv rd}	nT|dkr(|d nH|dkr3d}d}n=|dv r<d}d}n2| j
sP|rP|| jv rPtj}n | j
sc|rc|dv rctj}d}n|r| j
su|drutj}ntj}d}| j
r|
|j  n| j
s|rtj }d}n| j
s|	rtj!}|
|j  n||
v rtj!}n| j
r|| j"v rtj#}n| j
s|| j$v rtj#}n| j
s|| j%v rtj}n| j
s|s|| j&v rtj}n}t}ny| j
r
|dr
t'}|d nf| j
s|drt'}|d nS| j
s,|dr,t'j(}nD| j
s;|d r;t)j*}n5|d!rFt)j+}n*|d"rQt)j,}nt-|dkr\|.  |/  n|d dkr| j
r|d#rwt'j0}n|drt'}|.  n|d$rt'}n|/  |.  n|d#rt'j0}n|drt'}|.  n|d%rt'}n|/  |.  n| j
sp|d dkrp|drt	}n|d&rt}|.  n|dr|jdrtj}ntj}n{|drtj}nq|drt'}|d nc|d'rtj!}nY|dr8|j }|| j1v r+t}nE|| j2v r5tj}n;t}n8|d(rAt}n/|drJt}n&|d rTt)j*}n|d!r^t)j+}n|d"rht)j,}n|/  |.  | j
s|j3 r|jd)k}|j4||jpd*fV  |jr'd S d S )+NinitialFr   z\s+z\{.*?\}|\(\*.*?\*\)$z//.*?$z/(<\-)|(>=)|(<=)|%|<|>|-|\+|\*|\=|(<>)|\/|\.|:|,z[-+*\/=<>:;,.@\^];z[\(\)\[\]]+(   )[]z[A-Za-z_][A-Za-z_0-9]*result)r	  r  T)rC   r>   r/   re   )rL   rI   r=   r4   r6   )r   r   z\s*\.\s*z\"rS   'z\#(\d+|\$[0-9A-Fa-f]+)z\$[0-9A-Fa-f]+z\d+(?![eE]|\.[^.])z&\d+(\.\d+([eE][+-]?\d+)?|[eE][+-]?\d+)z''z[^\"]*z[^']*r:   z@@[A-Za-z_][A-Za-z_0-9]*z[-+*\/=<>:;,.@\^]+.r   )5r   reDOTALL	MULTILINE
IGNORECASErP   Zeosr   scanr   r  match
startswithr   Preproc	MultilineSingler   r   lowerr   BuiltinPseudor  r   BLOCK_KEYWORDSr   FUNCTION_MODIFIERSr  ClassFunctionr   PropertyLabelr  TypeBUILTIN_TYPES
DIRECTIVESr  r	   Charr
   HexIntegerFloatlenr  Zget_charEscapeASM_INSTRUCTIONSASM_REGISTERSstrip	start_pos)r   r   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   r     sl  



































 z"DelphiLexer.get_tokens_unprocessedN)r   r   r   r    r!   r"   r#   r$   r%   r&   r  r  r  r3  r4  r;  r:  r  rC  rB  r  r  r   r   r   r   r   r   r   *   s6    	!C )P)r    r&  Zpygments.lexerr   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   r   <module>   s    
,