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   Y/home/air/segue/gemini/backup/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dodowntoelseendfileforfunctiongotoifimplementationin	inheritedinline	interfacelabelmodnilnotobjectofonoperatororpacked	procedureprogramrecordreintroducerepeatr   setshlshrstringthentotypeunituntilusesvarwhilewithxor)asclassexceptexportsfinalizationfinallyinitializationislibraryrL   propertyraise	threadvartry)disposeexitfalsenewtrue>   r;   r_   r[   r\   r^   r0   rd   r3   rF   rR   rk   rQ   r>   rM   rl   rP   rn   r6   r4   rg   rA   ri   >   r!   nearaliascdeclexportrD   r*   dynamicstdcallvarargsvirtualexternaloverrideregistersafecall	assembler	interrupt	softfloatnostackframe>   farfar16indexpubliccppdecldefaultforwardprivater,   abstractr   	protected	published
oldfpccall>G   boolbytecharcomprealworddwordint64pboolpbytepcharpcomppdatepwordtdatettimedoublepdwordpint64real48singlerX   tclassbooleanintegerlongintpdoublephandlepointerpsinglepstringthandletobjectvariantansicharbyteboolcardinalcurrencyextendediunknownlongboollongwordpbooleanpintegerplongintppointerpvariantshortintsmallinttextfilewidecharwordbool	pansichar	pcardinal	pcurrency	pdatetime	pextended	plongword	pshortint	psmallint	pwidechar	pwordbool	tdatetime
ansistring
pbytearray
pwordarray
widestringpansistringpwidestringshortstringpshortstring)absacquireexceptionobjectaddr
ansitoutf8appendarctanassertassigned
assignfilebeginthread	blockread
blockwriter1   chdirchrclose	closefilecomptocurrencycomptodoubleconcatr5   copycosdecdeleterp   doubletocomp	endthreadenummodulesenumresourcemoduleseofeolnerase
exceptaddrexceptobjectexcluderq   expfileposfilesizefillcharfinalizefindclasshinstancefindhinstancefindresourcehinstanceflushfracfreemem	get8087cwgetdirgetlasterrorgetmemgetmemorymanagergetmodulefilenamegetvariantmanagerhalthihighincinclude
initializeinsertintioresultismemorymanagersetisvariantmanagersetlengthlnlolowmkdirmovers   oddolestrtostringolestrtostrvarord
paramcountparamstrpipospredptr
pucs4charsrandom	randomizereadreadln
reallocmemreleaseexceptionobjectrenameresetrewritermdirroundrunerrorseekseekeofseekeoln	set8087cw	setlengthsetlinebreakstylesetmemorymanager	setstring
settextbufsetvariantmanagersinsizeofslicesqrsqrtstrstringofcharstringtoolestrstringtowidecharsuccswaptrunctruncatetypeinfoucs4stringtowidestringunicodetoutf8uniquestringupcase
utf8decode
utf8encode
utf8toansiutf8tounicodevalvararrayredimvarclearwidecharlentostringwidecharlentostrvarwidechartostringwidechartostrvarwidestringtoucs4stringwritewriteln)abortaddexitprocaddterminateprocadjustlinebreaksallocmemansicomparefilenameansicomparestransicomparetextansidequotedstransiextractquotedstransilastcharansilowercaseansilowercasefilenameansiposansiquotedstransisamestransisametextansistrcompansistricompansistrlastcharansistrlcompansistrlicompansistrlower
ansistrposansistrrscanansistrscanansistrupperansiuppercaseansiuppercasefilename	appendstr	assignstrbeep	booltostrbytetocharindexbytetocharlenbytetypecallterminateprocschangefileext
charlengthchartobyteindexchartobytelen
comparemem
comparestrcomparetext	createdir
createguidcurrentyear	currtostr
currtostrfdatedatetimetofiledatedatetimetostrdatetimetostringdatetimetosystemtimedatetimetotimestamp	datetostr	dayofweek
decodedatedecodedatefully
decodetime
deletefiledirectoryexistsdiskfreedisksize
disposestr
encodedate
encodetimeexceptionerrormessageexcludetrailingbackslashexcludetrailingpathdelimiterexpandfilenameexpandfilenamecaseexpanduncfilenameextractfiledirextractfiledriveextractfileextextractfilenameextractfilepathextractrelativepathextractshortpathnamefileage	fileclose
filecreatefiledatetodatetime
fileexistsfilegetattrfilegetdatefileisreadonlyfileopenfileread
filesearchfileseekfilesetattrfilesetdatefilesetreadonly	filewritefinalizepackage	findclosefindcmdlineswitch	findfirstfindnextfloattocurrfloattodatetimefloattodecimal
floattostrfloattostrffloattotextfloattotextfmt
fmtloadstrfmtstrforcedirectoriesformat	formatbuf
formatcurrformatdatetimeformatfloat
freeandnilgetcurrentdirgetenvironmentvariablegetfileversiongetformatsettingsgetlocaleformatsettingsgetmodulenamegetpackagedescriptiongetpackageinfogettimeguidtostring	incamonthincludetrailingbackslashincludetrailingpathdelimiterincmonthinitializepackageinterlockeddecrementinterlockedexchangeinterlockedexchangeaddinterlockedincrementinttohexinttostrisdelimiterisequalguid
isleapyearispathdelimiterisvalidident	languageslastdelimiterloadpackageloadstr	lowercasemsecstotimestampnewstrnextcharindexnowoutofmemoryerror	quotedstrraiselastoserrorraiselastwin32error	removedir
renamefilereplacedatereplacetimesafeloadlibrarysamefilenamesametextsetcurrentdirshowexceptionsleepstralloc
strbufsizestrbytetypestrcatstrcharlengthstrcompstrcopy
strdisposestrecopystrendstrfmtstricompstringreplacestringtoguidstrlcatstrlcompstrlcopystrlenstrlfmt	strlicompstrlowerstrmovestrnewstrnextcharstrpasstrpcopy	strplcopystrposstrrscanstrscan	strtoboolstrtobooldef	strtocurrstrtocurrdef	strtodatestrtodatedefstrtodatetimestrtodatetimedef
strtofloatstrtofloatdefstrtoint
strtoint64strtoint64defstrtointdef	strtotimestrtotimedefstruppersupportssyserrormessagesystemtimetodatetimetexttofloattimetimestamptodatetimetimestamptomsecs	timetostrtrimtrimleft	trimrighttryencodedatetryencodetimetryfloattocurrtryfloattodatetimetrystrtobooltrystrtocurrtrystrtodatetrystrtodatetimetrystrtofloattrystrtointtrystrtoint64trystrtotimeunloadpackage	uppercasewidecomparestrwidecomparetext
widefmtstr
wideformatwideformatbufwidelowercasewidesamestrwidesametextwideuppercase
win32checkwraptext),activateclassgroupallocatehwndbintohexchecksynchronizecollectionsequalcountgenerationsdeallocatehwnd	equalrectextractstrings	findclassfindglobalcomponentgetclassgroupdescendantswithhextobin
identtointinitinheritedcomponent
inttoidentinvalidpointisuniqueglobalcomponentname	linestartobjectbinarytotextobjectresourcetotextobjecttexttobinaryobjecttexttoresourcepointsequalreadcomponentresreadcomponentresexreadcomponentresfilerectregisterclassregisterclassaliasregisterclassesregistercomponentsregisterintegerconstsregisternoiconregisternonactivex
smallpointstartclassgroupteststreamformatunregisterclassunregisterclassesunregisterintegerconstsunregistermoduleclasseswritecomponentresfile)darccosarccosharccotarccotharccscarccscharcsecarcsecharcsinarcsinharctan2arctanhceilcomparevaluecosecantcoshcotcotancothcsccsch
cycletodegcycletograd
cycletorad
degtocycle	degtograddegtoraddivmoddoubledecliningbalanceensurerangefloorfrexpfuturevaluegetexceptionmaskgetprecisionmodegetroundmodegradtocycle	gradtodeg	gradtoradhypotinrangeinterestpaymentinterestrateinternalrateofreturnintpower
isinfiniteisnaniszeroldexplnxp1log10log2lognmaxmaxintvaluemaxvaluemeanmeanandstddevminminintvalueminvaluemomentskewkurtosisnetpresentvaluenormnumberofperiodspaymentperiodpaymentpoly
popnstddevpopnvariancepowerpresentvalue
radtocycleradtodeg	radtogradrandgrandomrangeroundto	samevaluesecsecantsechsetexceptionmasksetprecisionmodesetroundmodesignsimpleroundtosincossinhslndepreciationstddevsumsumintsumofsquaressumsandsquaressyddepreciationtantanhtotalvariancevariance)SystemSysUtilsClassesMath>C   ahalaxbhblbpbxchclcscxdhdidldsdxesfsgssispsscr0cr1cr2cr3cr4dr0dr1dr2dr3dr4dr5dr6dr7eaxebpebxecxediedxesiespmm0mm1mm2mm3mm4mm5mm6mm7st0st1st2st3st4st5st6st7xmm0xmm1xmm2xmm3xmm4xmm5xmm6xmm7>  btrB   jajbjcjejgjljojpjsjzrN   aaaaadaamaasadcaddr-   bsfbsrbtcbtrbtscbwcdqclccldclicmccmpcwddaadasr   r7   hltr  r  jaejbejgejlejmpjnajnbjncjnejngjnljnojnpjnsjnzjpejpolarldslealeslfslgslsllssltrmovmulnegnoprI   outpoprclrcrrepretrolrorrsmsalsarsbbrV   rW   smistcstdstirA  subud1ud2rb   arplcallcltscwdeemmsibtsidivimulinsbinsdinswint1int3intoinvdiretjcxzjnaejnbejngejnlelahflgdtlidtljmplldtlmswlockloopmovdmovqpopapopfpushreperepzretfretnrsdcsahfsalcsetasetbsetcsetesetgsetlsetosetpsetssetzsgdtshldshrdsidtsldtsmswsvdcsvtstestumovverrverwwaitxaddxbtsxchgxlatboundbswapcmovacmovbcmovccmovecmovgcmovlcmovocmovpcmovscmovzcmpsbcmpsdcmpswcpuidentericebpint01int03iretdiretwjecxzlcallleavelodsblodsdlodswloopeloopzmovsbmovsdmovswmovsxmovzxoutsboutsdoutswpopadpopawpopfdpopfwpushapushfrdmsrrdpmcrdshrrdtscrepnerepnzrsldtscasbscasdscaswsetaesetbesetgesetlesetnasetnbsetncsetnesetngsetnlsetnosetnpsetnssetnzsetpesetposmintstosbstosdstoswsvldtwrmsrwrshrxlatbcmovaecmovbecmovgecmovlecmovnacmovnbcmovnccmovnecmovngcmovnlcmovnocmovnpcmovnscmovnzcmovpecmovpoinvlpgloopneloopnzpushadpushawpushfdpushfwsetcxzsetnaesetnbesetngesetnlesysretwbinvdcmovcxzcmovnaecmovnbecmovngecmovnlecmpxchgloadallsyscallsysexitsmintoldsysenter	cmpxchg8b
cmpxchg486
loadall286)M	aleatorio	algoritmoarquivoatecaso
cronometrodebugeecoenquantoentaoescolhaescrevaescrevalfacafalsofimalgoritmofimenquanto
fimescolha	fimfuncaofimparafimprocedimento	fimrepitafimsefuncaoinicior  
interrompaleia	limpatelarG   naoou	outrocasoparapassopausaprocedimentorepitaretornesesenaotimerr_   vetor
verdadeiroxour7   rG   r   r  arcsenr   r   r  Expgraupradr  logr  r!  quadradpgrauraizqrandrandisenTanasccarac	caracpnumcomprcopiamaiuscminusc	numpcaracr"  >   r   logicointeiro	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   FTturbopascalr(   
freepascalunits)r   r   rU   keywordsbuiltinsr   updatePORTUGOL_KEYWORDSPORTUGOL_BUILTIN_TYPESis_portugolTURBO_PASCAL_KEYWORDSDELPHI_KEYWORDSFREE_PASCAL_KEYWORDSr   listBUILTIN_UNITS)r   r   r\   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)rT  r_  T)rF   r?   r/   rl   )rP   rM   r>   r4   r6   )r(  rZ  z\s*\.\s*z\"rX   '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
IGNORECASErU   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lenrl  get_charEscapeASM_INSTRUCTIONSASM_REGISTERSstrip	start_pos)r   r   scannerstackin_function_blockin_property_blockwas_dotnext_token_is_functionnext_token_is_propertycollect_labelsblock_labelsbrace_balancetokenlowercase_namer   r   r   r     sl  



































 z"DelphiLexer.get_tokens_unprocessedN)r   r   r   r    r!   r"   r#   r$   r%   r&   r  r  r  r  r  r  r  r  r  r  r  r  r   r   r   r   r   r   r   *   s6    	!C )P)r    r  pygments.lexerr   pygments.utilr   r   pygments.tokenr   r   r   r   r	   r
   r   r   r   pygments.scannerr   pygments.lexers.modula2r   __all__r   r   r   r   r   r   <module>   s    
,