
    Mhy                         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	e          Z G 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                   <    e Zd ZdZdZdgZddgZg ZdZdZ	d Z
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                 T    t          j        | fi | t          di |ddi| _        d S )Nr   T )r   __init__r   lexer)selfoptionss     V/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/pygments/lexers/pascal.pyr   zPortugolLexer.__init__"   s>    t''w''' ::7::T:::


    c                 6    | j                             |          S )N)r   get_tokens_unprocessed)r   texts     r   r    z$PortugolLexer.get_tokens_unprocessed&   s    z00666r   N)__name__
__module____qualname____doc__namealiases	filenames	mimetypesurlversion_addedr   r    r   r   r   r   r      s]        EEDlG,'II
JCM; ; ;7 7 7 7 7r   c                       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 Z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libraryrR   propertyraise	threadvartry)disposeexitfalsenewtrue>   rA   re   ra   rb   rd   r6   rj   r9   rL   rX   rq   rW   rD   rS   rr   rV   rt   r<   r:   rm   rG   ro   >   r&   nearaliascdeclexportrJ   r0   dynamicstdcallvarargsvirtualexternaloverrideregistersafecall	assembler	interrupt	softfloatnostackframe>   farfar16indexpubliccppdecldefaultforwardprivater2   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singler^   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
blockwriter7   chdirchrclose	closefilecomptocurrencycomptodoubleconcatr;   copycosdecdeleterv   doubletocomp	endthreadenummodulesenumresourcemoduleseofeolnerase
exceptaddrexceptobjectexcluderw   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movery   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>  btrH   jajbjcjejgjljojpjsjzrT   aaaaadaamaasadcaddr3   bsfbsrbtcbtrbtscbwcdqclccldclicmccmpcwddaadasr   r=   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noprO   outpoprclrcrrepretrolrorrsmsalsarsbbr\   r]   smistcstdstirG  subud1ud2rh   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	limpatelarM   naoou	outrocasoparapassopausaprocedimentorepitaretornesesenaotimerre   vetor
verdadeiroxour=   rM   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                    t          j        | fi | t                      | _        t                      | _        t          |dd          rG| j                            | j                   | j                            | j                   d| _	        d S d| _	        t          |dd          r| j                            | j
                   t          |dd          r| j                            | j                   t          |dd          r| j                            | j                   t          |dt          | j                            D ]'}| j                            | j        |                    (d S )Nr   FTturbopascalr.   
freepascalunits)r   r   r[   keywordsbuiltinsr   updatePORTUGOL_KEYWORDSPORTUGOL_BUILTIN_TYPESis_portugolTURBO_PASCAL_KEYWORDSDELPHI_KEYWORDSFREE_PASCAL_KEYWORDSr   listBUILTIN_UNITS)r   r   rb   s      r   r   zDelphiLexer.__init__  sf   t''w'''U33 	?M  !7888M  !<===#D$DG]D99 A$$T%?@@@GXt44 ;$$T%9:::G\488 @$$T%>???$WgtD<N7O7OPP ? ?$$T%7%=>>>>? ?r   c              #   F  K   t          |t          j        t          j        z  t          j        z            }dg}d}d}d}d}d}d}	t                      }
ddg}|j        	sAt          }|d         dk    rI|                    d          r	t          }n| j
        sK|                    d          r6|j                            d          rt          j        }nt          j        }nu|                    d          rt          j        }nR| j
        r|                    d	          r	t"          }n-| j
        s-|                    d
          rt"          }|	r|j        dk    rd}	n|                    d          rt$          }d}|s|rr|j        dk    r|dxx         dz  cc<   n|j        dk    r|dxx         dz  cc<   n|j        dk    r|dxx         dz  cc<   n|j        dk    r|dxx         dz  cc<   nc|                    d          rf|j                                        }|dk    rt(          j        j        }n|| j        v rt0          }| j
        r
|dv rd}d}n|s|r7|| 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| j
        s|r|| j        v rt0          j        }nd| j
        s|r|dv rt0          j        }d}nG|rm| j
        s#|                    d          rt(          j        }nt(          j        }d}| j
        r,|
                    |j                                                   n| j
        s|rt(          j         }d}n| j
        s<|	r:t(          j!        }|
                    |j                                                   n|||
v rt(          j!        }nj| j
        r|| j"        v rt0          j#        }nL| j
        s|| j$        v rt0          j#        }n.| j
        s|| j%        v rt0          j        }n| j
        s|s|| j&        v rt(          j        }nt(          }n| j
        r3|                    d          rtN          }|                    d           n| j
        s3|                    d          rtN          }|                    d           ns| j
        s#|                    d          rtN          j(        }nI| j
        s#|                    d           rtR          j*        }n|                    d!          rtR          j+        }n|                    d"          rtR          j,        }nt[          |          dk    r|.                                 |/                                 n|d         dk    rA| j
        r|                    d#          rtN          j0        }ne|                    d          rtN          }|.                                 n3|                    d$          r	tN          }n|/                                 |.                                 n|                    d#          rtN          j0        }n|                    d          rtN          }|.                                 n|                    d%          r	tN          }nx|/                                 |.                                 nN| j
        sF|d         dk    r9|                    d          r	t          }n|                    d&          rt0          }|.                                 n|                    d          r6|j                            d          rt          j        }nt          j        }n|                    d          rt          j        }n{|                    d          rtN          }|                    d           nH|                    d'          rt(          j!        }n%|                    d          rH|j                                        }|| j1        v rt0          }n|| j2        v rt(          j        }nt(          }n|                    d(          rt"          }n|                    d          rt$          }n|                    d           rtR          j*        }nl|                    d!          rtR          j+        }nJ|                    d"          rtR          j,        }n(|/                                 |.                                 | j
        s$|j        3                                r|j        d)k    }|j4        ||j        pd*fV  |j        	?d S d S )+NinitialFr   z\s+z\{.*?\}|\(\*.*?\*\)$z//.*?$z/(<\-)|(>=)|(<=)|%|<|>|-|\+|\*|\=|(<>)|\/|\.|:|,z[-+*\/=<>:;,.@\^];z[\(\)\[\]]+(   )[]z[A-Za-z_][A-Za-z_0-9]*result)rZ  re  T)rL   rE   r5   rr   )rV   rS   rD   r:   r<   )r.  r`  z\s*\.\s*z\"r^   'z\#(\d+|\$[0-9A-Fa-f]+)z\$[0-9A-Fa-f]+z\d+(?![eE]|\.[^.])z&\d+(\.\d+([eE][+-]?\d+)?|[eE][+-]?\d+)z''z[^\"]*z[^']*rA   z@@[A-Za-z_][A-Za-z_0-9]*z[-+*\/=<>:;,.@\^]+.r   )5r   reDOTALL	MULTILINE
IGNORECASEr[   eosr   scanr   r  match
startswithr   Preproc	MultilineSingler   r   lowerr	   BuiltinPseudor  r   BLOCK_KEYWORDSr   FUNCTION_MODIFIERSr  ClassFunctionrB  PropertyLabelr  TypeBUILTIN_TYPES
DIRECTIVESr  r
   Charr   HexIntegerFloatlenrr  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_names                 r   r    z"DelphiLexer.get_tokens_unprocessed  sA
     $	BL 82= HII!!!&!&uuA+ R	@ERyI%%<<'' I'&EE) G'gll;Q.R.R G'}//44 2 ' ' 1\\),, B'#NEE% @'',,7i*j*j @'$EE) ~'gll;O.P.P ~'$E% /'-3*>*>).\\.11 y''E-2* ) 2,= 2"=C//)!,,,1,,,,$]c11)!,,,1,,,,$]c11)!,,,1,,,,$]c11)!,,,1,,,\\";<< i'%,]%8%8%:%:N%11 $ 3'4=88 '  + >-1KKK48 19= 6 1 55F 5$2d6I$I$I$1!$4$9$9$1!$4$9$949 149 112A/2uu-1BBB15!/5!8!8 %U 3 3 3 3!/:!=!=48 19= 6 6!/ 4B "B "B 59 19= 6 "- 1%2C 1%*d.EEE ' "- ,%2C ,%*.??? '15.. 0 %%  $/ HGLL4M4M H$(JEE %)ME5:2#/ H , 0 01D1D1F1F G G G "- %2H % $16.. "- %. % $
$(()<)<)>)>????'<77 $
) %n@[.[.[ '!- 	%.DDV2V2V '!- %.DO2S2S ' "- %g %.TXTaBaBa $ $% '',,u*=*= '"ELL****) 'gll4.@.@ '"ELL****) 'gll;T.U.U '"KEE) 
'gll;L.M.M 
'"JEE\\"788 '"NEE\\"KLL '"LEE 5zzA~~		$$&&&&rh&&# $||E** 	$ & e,, $ &		 i00 $ &((***		||E** 	$ & d++ $ &		 h// $ &((***		% & %)u*<*<<<'' % &EE\\&)) # #EIIKKKK\\"899   }//44 2 ' ' 1\\),,  #NEE\\$''  "ELL****\\"=>>   JEE\\";<<  %,]%8%8%:%:N%)>>> ''4+=== $ $\\"788  $EE\\.11 
 'EE\\"344  "JEE\\"788  "NEE\\"KLL  "LEE$$&&&IIKKK # /(;(;(=(= /!-3.#UGM,?R????e + R	@ R	@ R	@ R	@ R	@r   N)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   *   s7        " D999G'"I !I
7CM	O  N    J  M" 
BB
F
 
kJ JMX	 	 	M' ' 'RN`  ? ? ?(^@ ^@ ^@ ^@ ^@r   )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   <module>r     sT    
			             4 4 4 4 4 4 4 4+ + + + + + + + + + + + + + + + + + + + + + $ $ $ $ $ $ 1 0 0 0 0 0/
*7 7 7 7 7E 7 7 7"Z	@ Z	@ Z	@ Z	@ Z	@% Z	@ Z	@ Z	@ Z	@ Z	@r   