a
    Df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-2024 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.ZPortugolportugolz*.algz
*.portugolz>https://www.apoioinformatica.inf.br/produtos/visualg/linguagem c                 K   s.   t j| fi | tf i |ddi| _d S )Nr   T)r   __init__r   lexer)selfoptions r   c/nfs/NAS7/SABIOD/METHODE/ermites/ermites_venv/lib/python3.9/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.
    ZDelphi)delphiZpaspascalZobjectpascalz*.pasz*.dprztext/x-pascalz+https://www.embarcadero.com/products/delphir   )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repeatr   setshlshrstringZthentotypeunitZuntilusesvarwhilewithxor)asclassexceptexportsfinalizationfinallyinitializationislibraryrB   propertyraise	threadvartry)disposeexitfalsenewtrue>   r,   r=   r:   r\   rO   rZ   rR   rC   r7   rH   r1   r4   rP   r.   r_   rF   ra   rQ   rG   r^   r/   rW   >   aliasZstdcallZexternalZnostackframeZ	interruptoverrideZsafecallr'   r    varargsr<   ZvirtualexportZcdeclZdynamicZnear	assemblerregisterZ	softfloat>   r(   Z	protectedZabstractZcppdeclZforwardprivateZfarindexZ	publishedrl   publicZfar16Z
oldfpccalldefault>G   ZlongwordZpansistringZpbytedoubleZplongintZpdwordZ	pshortintZtclassvariantZ
widestringZbyteboolintegerpointerZpint64ZttimeZ	pcurrencyZthandleZpwidestringZ	pansicharZshortintZ	psmallintZpstringZtextfileZansicharZwidecharZ	pwordboolZpvariantZ
pbytearrayZ	pdatetimecompZcardinalbyteZpdateZ	pextendedZpwordbooleanZppointerZ
pwordarrayZ	tdatetimeZpcharZpsinglesingleZsmallintZpcompZ
ansistringZpbooleanZ	pwidecharwordZlongboolZshortstringZphandleZreal48ZwordboolcharrM   extendedZtobjectZlongintZtdateboolint64ZpboolZiunknownZdwordcurrencyZ	pcardinalZpshortstringrealZpintegerZ	plongwordZpdouble)absZacquireexceptionobjectaddrZ
ansitoutf8appendarctanassertassignedZ
assignfileZbeginthreadZ	blockreadZ
blockwriter-   chdirchrcloseZ	closefileZcomptocurrencyZcomptodoubleconcatr0   copycosdecdeleterc   ZdoubletocompZ	endthreadZenummodulesZenumresourcemoduleseofZeolnZeraseZ
exceptaddrZexceptobjectexcluderd   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moverf   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)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   csZmm2Zdr3axZecxZespfsZmm6spbxZmm0ZahZcr4Zdr7Zdr5Zmm3Zxmm3Zxmm6Zxmm7Zxmm2Zst1Zst3Zst4ZediZcr1Zdr1Zdr2ZbhZedxZcr0Zmm7Zxmm1Zst0Zxmm4ssZebxalZdxdlesZesiZgsZst2Zst7Zmm5chZmm1Zdr6Zxmm0Zxmm5blZclZbpZdr0ZebpZcxZdhZeaxsiZdr4Zcr3Zst6Zst5Zmm4Zcr2ZdiZds>  ZloadallZicebpZmovsbZscasdZoutsbZmovzxZsetlZsetngZsetaZjsaddZcmovaeZcmovcxzoutZcmovnaeZmovdZoutswZsetnbZjneZjngZsetbeZint3ZjngeZaamZljmpZlodsbpushZaadZloopZcmoveZsetpoZsysretrK   ZsticwdZjleZcmovnlZ	cmpxchg8bZjbr2   ZloopzZcmovbeZbtrr   ZjmpZjzZoutsdZud2ZsvldtZdasZcmovsZjbeZjnaeZhltZsalZaasZcltsZstdZjnbeZjnbZrcrZcmovnleZlodsdZsarZumovZnopZlidtZpopfZverrZcmovzZjcxzZjoZlahfZidivZsysexitZmovqZcmovnaZlldtZsetnoZcmovaZpushaZsalcZsetaeZrepeZsetgeZloopneZpushadZarplZaaaZcbwZjgZrsldtZenterZjecxzZbsfZcmovgZsetnpZcmovneZ
loadall286ZsetcZsetbZiretwZshrdZcmovpoZlslZjnsnegZcmovcZrdpmcZrsmZsetneZcmovnbZsmintoldZcmovnzZjpoZcmovngeboundZjlZlgdtZmovsxZlesZinvdZcmovoZloopnzZbtsZcmovnpZcmovncr   ZsetprU   r   ZsvtsZlfsZrclZscasbZjncr;   ZinswZjcZwrmsrZsbbr)   ZibtsZbtcZsyscallZbsrlockZjnlZpushawZsetnbeZinsbZintoZmovsdZleaveZsetzjnaZlgsZpopawZcmovleZpushfdZrdmsrZjaepopZpopadZrepneZwrshrZmovZbtZsysenterZretnZverwZsmswZpopaZjgeZsetncZrsdcZrdtscZwbinvdZiretdjaZint03ZjeZjpZpopfdZsetnzZshldZcmovpcmpZsetnaZxlatbZcmovlZcmpxchgtestr@   ZlmswZcmpsbr   ZldsZstosdZsidtZsldtimulZstoswZxchgZjnpZcmpsdZrepzZxaddZltrZsmintZcmovpeZemmsZsetnaeZrolZjnoZretfZsetnlZcmovnoZjpeZint01ZcmovnbeZcmovbZsmiZpushfsubZcmovnsZmovswZsetsZstcZrepnzcallrL   ZlarZrdshrZ
cmpxchg486ZcmovngZinsdZloopeZpushfwZjnzZsetpeZud1ZlcallZlssZint1ZjnleZsetoZcmpswZleaZsetngeZrorZsetgZcldZlodswretZcmcZdaaZcwdeZsetleZadcZsetnleZxbtsZsvdcrD   cliZstosbZinvlpgmulZiretZscaswZcpuidZsetcxzZseteZcdqZsahfZclcZbswapZsetnsZsgdtwaitZxlatrepZcmovgeZpopfw)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	limpatelar>   ZnaoZouZ	outrocasoparaZpassoZpausaprocedimentoZrepitaZretorneseZsenaoZtimerrR   ZvetorZ
verdadeiroZxour2   r>   r   r   Zarcsenr   r   r   ZExpZgraupradr   logr   r   ZquadZradpgrauZraizqZrandZrandiZsenZTanZascZcaracZ	caracpnumZcomprZcopiaZmaiuscZminuscZ	numpcaracr   >   Z	caractereZinteiror   Zlogicoc                 K   s   t j| fi | t | _t | _t|ddrR| j| j | j| j d| _	n~d| _	t|ddrr| j| j
 t|ddr| j| j t|ddr| j| j t|dt| jD ]}| j| j|  qd S )Nr   FTZturbopascalr&   Z
freepascalZunits)r   r   rJ   keywordsbuiltinsr   updatePORTUGOL_KEYWORDSPORTUGOL_BUILTIN_TYPESis_portugolTURBO_PASCAL_KEYWORDSDELPHI_KEYWORDSFREE_PASCAL_KEYWORDSr   listBUILTIN_UNITS)r   r   rP   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s t}|d dkr|drpt	}q| j
s|dr|jdrtj}ntj}q|drtj}q| j
r|d	rt}q| j
s|d
rt}|	r|jdkrd}	q|drt}d}|s|r|jdkr2|d  d7  < nX|jdkrP|d  d8  < n:|jdkrn|d  d7  < n|jdkr|d  d8  < q|dr|j }|dkrtjj}q|| jv rt}| j
r|dv r|d}d}n|s|r0|| jv r0|d dkr0|d dkr0d}d}ddg}t }
|dv r@d}	n<|dkrV|d n&|dkrjd}d}n|dv rd}d}q| j
s|r|| jv rtj}q| j
s|r|dv rtj}d}q|r| j
s|drtj}n"tj}d}| j
r|
|j  n| j
s*|r*tj }d}n| j
sP|	rPtj!}|
|j  n||
v rbtj!}nz| j
r~|| j"v r~tj#}n^| j
s|| j$v rtj#}nB| j
s|| j%v rtj}n&| j
s|s|| j&v rtj}nt}n| j
r|drt'}|d n| j
s&|dr&t'}|d n~| j
sB|drBt'j(}nb| j
s^|d r^t)j*}nF|d!rrt)j+}n2|d"rt)j,}nt-|dkr|.  |/  n"|d dkrd| j
r|d#rt'j0}n<|drt'}|.  n"|d$rt'}n|/  |.  nP|d#r$t'j0}n<|dr>t'}|.  n"|d%rPt'}n|/  |.  nf| j
s|d dkr|drt	}n<|d&rt}|.  n |dr|jdrtj}ntj}n|drtj}n|drt'}|d n|d'rtj!}n|drZ|j }|| j1v r@t}n|| j2v rTtj}nt}np|d(rlt}n^|dr~t}nL|d rt)j*}n8|d!rt)j+}n$|d"rt)j,}n|/  |.  | j
s|j3 r|jd)k}|j4||jpd*fV  qDd S )+NinitialFr   z\s+z\{.*?\}|\(\*.*?\*\)$z//.*?$z/(<\-)|(>=)|(<=)|%|<|>|-|\+|\*|\=|(<>)|\/|\.|:|,z[-+*\/=<>:;,.@\^];z[\(\)\[\]]+(   )[]z[A-Za-z_][A-Za-z_0-9]*result)r   r   T)r=   r8   r+   r_   )rF   rC   r7   r/   r1   )r   r   z\s*\.\s*z\"rM   'z\#(\d+|\$[0-9A-Fa-f]+)z\$[0-9A-Fa-f]+z\d+(?![eE]|\.[^.])z&\d+(\.\d+([eE][+-]?\d+)?|[eE][+-]?\d+)z''z[^\"]*z[^']*r4   z@@[A-Za-z_][A-Za-z_0-9]*z[-+*\/=<>:;,.@\^]+.r   )5r   reDOTALL	MULTILINE
IGNORECASErJ   Zeosr   scanr   r  match
startswithr   ZPreprocZ	MultilineSingler   r   lowerr   ZBuiltinZPseudor  r   BLOCK_KEYWORDSr   FUNCTION_MODIFIERSr   ZClassZFunctionr   ZPropertyZLabelr  TypeBUILTIN_TYPES
DIRECTIVESr  r	   Charr
   ZHexZIntegerZFloatlenr   Zget_charZEscapeASM_INSTRUCTIONSASM_REGISTERSstripZ	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     sf   



















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   *   s4   	!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   
,