3

V'ícü‰ã@s¶dZddlZddlmZmZmZmZmZddlm	Z	m
Z
mZmZm
Z
mZmZmZmZddddd	gZGd
d„deƒZGdd„deƒZGdd„deƒZGd
d„deƒZGdd	„d	eƒZdS)zÈ
    pygments.lexers.ml
    ~~~~~~~~~~~~~~~~~~

    Lexers for ML family languages.

    :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
éN)Ú
RegexLexerÚincludeÚbygroupsÚdefaultÚwords)	ÚTextÚCommentÚOperatorÚKeywordÚNameÚStringÚNumberÚPunctuationÚErrorÚSMLLexerÚ
OcamlLexerÚOpaLexerÚReasonLexerÚ
FStarLexerc)@s˜eZdZdZdZdgZdddgZddgZd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1h)Zd2d3d4d5d6d7d8hZ	d9d:d;d<d=d>d?d@dAdBh
Z
dCZdDZdEdF„Z
dGdH„ZdIdJ„ZdKdL„ZdMefdNejdOfgdPedQfdRedSfdTejdšfdUejdQfdVejdSfgdWdXjdYdZ„e
Dƒƒefd[ejd\fd]ejd^fd_ejfd`ejfdaejfdbejfdcejfddejfdeejfdfej fdgeej fdheej fdiejdjfdkejdlfdmejdnfdoejdpfdqej!fdreedsfdWeefdWeefgdreefdWeedSfdWeedSfdMe"fdte"fge#dQƒge$duƒdvejdwfdxejd›fe$d{ƒe$d|ƒdte"fge$duƒd}efdNejdOfd~ejdzfdejdœfd3edzfd€ejdfe$d{ƒe$d|ƒdte"fg
e
ejƒe
ejƒddXjeƒedSfge$duƒe$d‚ƒdWeej%fe#dSƒge$duƒdqej!fdƒed„fdWeej&dSfdWeej&dSfe#dSƒge$duƒdqej!fdƒed„fd…eefe'ej(eeƒdSfd…eefe'ej(eeƒdSfdWeej(dSfdWeej(dSfe#dSƒge$duƒe$d‚ƒdqej!fdƒed„fd†eedžfdWeej)fdWeej)fdte"dSfge$duƒdˆejdŸfe$d‚ƒe$d|ƒdte"dSfge$duƒe$d‚ƒdqej!fdƒed„fd‰e'eeejƒdSfd†eed fdWeej)fdWeej)fdte"dSfg	e$duƒdˆejd¡fdŒejd¢fdejfdŽee'eeej*ƒfdee'eeej*ƒfe$d‚ƒe$d|ƒdte"fg	e$duƒdee'ejeej*ƒfd‘ee'ejeej*ƒfdejfd’eefej*fe#dSƒge$duƒdWeej*dSfdWeej*dSfdte"dSfgd}efdNejdOfdqej!feefd?efd“edSfeefgd”ejfdNejd•fd–ejdSfd—ejfgd˜œZ+d™S)£rzB
    For the Standard ML language.

    .. versionadded:: 1.5
    zStandard MLZsmlz*.smlz*.sigz*.funztext/x-standardmlzapplication/x-standardmlZabstypeÚandZandalsoÚasÚcaseÚdatatypeÚdoÚelseÚendÚ	exceptionÚfnÚfunÚhandleÚifÚinZinfixZinfixrÚletÚlocalZnonfixÚofÚopÚopenZorelseÚraiseÚrecÚthenÚtypeÚvalÚwithZwithtypeÚwhileZeqtypeÚfunctorrZsharingÚsigÚ	signatureÚstructZ	structureÚwhereú:z\|ú=z=>z->ú#z:>ú(ú)ú[ú]Ú{Ú}ú,ú;z...Ú_z[a-zA-Z][\w']*z[!%&$#+\-/:<=>?@\\~`^|*]+c	Cs:d|fdtjfdtjfdtjfdtjfdtjfd|dfgS)	Nz[^"\\]z\\[\\"abtnvfr]z\\\^[\x40-\x5e]z
\\[0-9]{3}z\\u[0-9a-fA-F]{4}z\\\s+\\ú"z#pop)rÚEscapeZInterpol)Zwhatkind©rAú6/tmp/pip-build-gk9425m9/Pygments/pygments/lexers/ml.pyÚstringy<szSMLLexer.stringyccsP|jdƒ|jkrt}ntj}|jdƒ||jdƒfV|jdƒt|jdƒfVdS)Néé)ÚgroupÚalphanumid_reservedrrÚ	NamespaceÚstartr)ÚselfÚmatchÚtokenrArArBÚlong_id_callbackKs
zSMLLexer.long_id_callbackccsL|jdƒ|jkrt}n|jdƒ|jkr,t}nt}|jdƒ||jdƒfVdS)NrD)rFrGrÚsymbolicid_reservedrrI)rJrKrLrArArBÚend_id_callbackSszSMLLexer.end_id_callbackccsF|jdƒ}||jkrtj}n||jkr,t}nt}|jdƒ||fVdS)NrD)rFrGr
ÚReservedrNrrrI)rJrKÚstrrLrArArBÚid_callback\s


zSMLLexer.id_callbackz\s+z\(\*Úcommentz\(|\[|\{Úmainz\)|\]|\}ú#popz\b(let|if|local)\b(?!\')z\b(struct|sig|while)\b(?!\')z\b(do|else|end|in|then)\b(?!\')z(%s)ú|ccs|]}tj|ƒVqdS)N)ÚreÚescape)Ú.0ÚzrArArBú	<genexpr>|szSMLLexer.<genexpr>z#"Úcharr?Ústringz~?0x[0-9a-fA-F]+z0wx[0-9a-fA-F]+z0w\d+z~?\d+\.\d+[eE]~?\d+z
~?\d+\.\d+z~?\d+[eE]~?\d+z~?\d+z#\s*[1-9][0-9]*z#\s*(%s)z#\s+(%s)z\b(datatype|abstype)\b(?!\')Údnamez\b(exception)\b(?!\')Úenamez4\b(functor|include|open|signature|structure)\b(?!\')Úsnamez\b(type|eqtype)\b(?!\')Útnamez	\'[\w\']*z(%s)(\.)Údottedz\S+Ú
whitespacez\b(val|and)\b(?!\')Úvnamez\b(fun)\b(?!\')úmain-funÚfnameÚ
delimitersÚcorez\sz\b(fun|and)\b(?!\')z\b(val)\b(?!\')z\b(case|handle)\b(?!\')z(?=\b(%s)\b(?!\'))Úbreakoutz\(Útyvarseqz(%s)(\s*)(=(?!%s))z=(?!%s)Útypbindz\b(and)\b(?!\')z(=)(\s*)(datatype)ÚdatbindÚdatconz\b(withtype)\b(?!\')z\b(of)\b(?!\')z
(\|)(\s*)(%s)z
(\|)(\s+)(%s)z(and\b)(\s+)(%s)z(and\b)(\s*)(%s)z	(%s)|(%s)z\)z[^(*)]z#pushz\*\)z[(*)])rcrgrhrbÚrootrTzmain-funr\r]rir`rfrdrarkr^rlr_rmrjrSN)rTrT)rUrerf)rUrTrd)rUrT)rUrk)rUra)rUrlrm)rUr^)rUra),Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚaliasesÚ	filenamesÚ	mimetypesrGrNZnonid_reservedZ
alphanumid_reZ
symbolicid_rerCrMrOrRrrÚ	Multilinerr
rPÚjoinrÚCharÚDoubler
ÚHexÚIntegerÚFloatrZLabelZ	DecoratorrrrrHZFunctionrÚVariableÚTypeÚClassÚtokensrArArArBrs8

	
	























c0@sºeZdZdZdZdZdgZddddgZd	gZdžZ	dŸZ
dcZd ZdlZ
dmZd¡Zdvejfdwejfdxejfgdyefdzejjfd{ejd|fd}ejfd~edfd€dje	ƒefd‚dje
dƒdƒd¢…ƒefd…ee
efefd€djeƒejfd€djeƒejfd†efd‡ejfdˆej fd‰ej!fdŠej"fd‹ej#fdŒej$fdej$fdŽefdej%drfdej&fgd‘efd’ed“fd”ed•fd–efgd—ej%fe'd˜ƒd™ej%fdej%d•fgdyefdFe(fdšejfd›ejd•fdœed•fe)d•ƒgdœZ*dƒS)£rz<
    For the OCaml language.

    .. versionadded:: 0.7
    ZOCamlzhttps://ocaml.org/Zocamlz*.mlz*.mliz*.mllz*.mlyztext/x-ocamlrÚassertÚbeginÚclassÚ
constraintrÚdoneÚdowntorrrÚexternalÚfalseÚforrÚfunctionr.r r!rÚinheritÚinitializerÚlazyr"rKÚmethodÚmoduleÚmutableÚnewÚobjectr$r&Úprivater'r(r/r1r)ÚtoÚtrueÚtryr*Úvaluer+ÚvirtualÚwhenr-r,ú!=r5ú&ú&&ú\(ú\)ú\*ú\+r<ú-ú-\.ú->ú\.ú\.\.r3ú::ú:=ú:>r=ú;;ú<ú<-r4ú>ú>]ú>\}ú\?ú\?\?ú\[ú\[<ú\[>ú\[\|r9r>ú`ú\{ú\{<ú\|ú\|]ú\}ú~z[!$%&*+\./:<=>?@^|~-]rÚasrÚlandÚlorÚlslÚlxorÚmodÚorz[!?~]z[=<>@^|&+\*/$%-]ÚunitÚintÚfloatÚboolr]r\ÚlistÚarrayz
\\[\\"\'ntbr]z
\\[0-9]{3}z\\x[0-9a-fA-F]{2}z\s+zfalse|true|\(\)|\[\]z\b([A-Z][\w\']*)(?=\s*\.)rbz\b([A-Z][\w\']*)z\(\*(?![)])rSz\b(%s)\brVz(%s)NrDz
(%s|%s)?%sz
[^\W\d][\w']*z(-?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)z0[xX][\da-fA-F][\da-fA-F_]*z0[oO][0-7][0-7_]*z0[bB][01][01_]*z\d[\d_]*z7'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2}))'z'.'ú'r?z[~?][a-z][\w\']*:z[^(*)]+z\(\*z#pushz\*\)z#popz[(*)]z[^\\"]+zescape-sequencez\\\nz[A-Z][\w\']*(?=\s*\.)z[A-Z][\w\']*z
[a-z_][\w\']*)zescape-sequencernrSr]rb)0rr‚rƒr„r…rr†r‡rrrrˆr‰rŠrr‹r.r r!rrŒrrŽr"rKrrr‘r’r“r$r&r”r'r(r/r1r)r•r–r—r*r˜r+r™ršr-r,))r›r5rœrržrŸr r¡r<r¢r£r¤r¥r¦r3r§r¨r©r=rªr«r¬r4r­r®r¯r°r±r²r³r´rµr9r>r¶r·r¸r¹rºr»r¼)rr½r¾r¿rÀrÁrÂrÃ)rÄrÅrÆrÇr]r\rÈrÉéÿÿÿÿ)+rorprqrrrsÚurlrtrurvÚkeywordsÚkeyoptsÚ	operatorsÚword_operatorsÚprefix_symsÚ
infix_symsÚ
primitivesrr@rrÚBuiltinÚPseudorHr€rrxr
r	ÚWordrr
r}r{ÚOctÚBinr|ryrzr~rrrrrArArArBrcsz





c@sÀeZdZdZdZdgZdgZdgZdxZd"Z	d#Z
d$Zd%ej
fd&ej
fd'ej
fgd(ed)fd*efged+ƒd,efged-ƒeed.d.d/efd0e	d.ejjfd1ejfd2ejfd3ejfd4ejfd5ejfd6ejfd7ejfd8ejfd9ejd:fd;ejfd<ed=fd>ed?fd@ejdAfdBej fdCe
dDej fdEej!fdFe
dDefdGe
efdGeefdHedfdIe	ej"fdJe	ejfdKejfe	efged-ƒdLej"fe#dyƒged-ƒdOej"dzfdQej"d{fe	dOej"d|fe	ej"d?fdIe	ej"fe#d?ƒged-ƒe#d}ƒged-ƒdUej"d~fe#d?ƒged-ƒdLej"dfdVej"d€fe#d?ƒged-ƒdXej"dNfdLej"dfe#d?ƒged-ƒdYej"fdZej"fdOej"d=fd[ej"d?fged-ƒd\ej"fdZej"fd<ej"d=fd>ej"d?fgd]efd(ed=fd^ed?fdZefgd_ejfd9ejd?fd<ed`fedaƒgdbejfdcejd?fd<ed`fedaƒgddejd‚fdfejdƒfgdhejd?fgd,efdiejdjfdkejd?fdfejd„fgdIejd…fd9ejd†fdJe	ejd?fdKejd‡fdmejd?fd<edˆfgdnedofdpejd‰fdrejdAfd<ed`fdsejfgdted?fduefgdvœZ$dwS)Šrz@
    Lexer for the Opa language.

    .. versionadded:: 1.5
    ZOpaZopaz*.opaz
text/x-oparrrƒrÚclientÚcssÚdatabaseÚdbrrrrˆÚforallr‹r ÚimportrKrrÃÚpackageÚparserr(Úserverr)r*r+r,Ú
xml_parserz(([a-zA-Z_]\w*)|(`[^`]*`))z[.=\-<>,@~%/+?*&^!]z[()\[\],;|]z
\\[\\"\'ntr}]z
\\[0-9]{3}z\\x[0-9a-fA-F]{2}z/\*znested-commentz//.*?$Úcommentsz\s+zcomments-and-spacesz\b)ÚprefixÚsuffixú@z-?.[\d]+([eE][+\-]?\d+)z-?\d+.\d*([eE][+\-]?\d+)z-?\d+[eE][+\-]?\d+z0[xX][\da-fA-F]+z0[oO][0-7]+z
0[bB][01]+z\d+z#[\da-fA-F]{3,6}r?r]z9'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2})|.)'z\{z#pushz\}ú#popz<(?=[a-zA-Z>])z
html-open-tagz[@?!]?(/\w+)+(\[_\])?z<-(?!r7z\b([A-Z]\w*)(?=\.)z=(?!z(%s)+r3rÊr5z#(?=\{)z->ú
type-lhs-1útype-with-slashz\(ú
type-tuplez~?\{útype-recordúslash-type-1útype-1ú/z(?=,)ú
type-arrowz
,(?=[^:]*?->)z[^()/*]+z[/*]z\)z[^{}/*]+z[^/*]+z\*/z[^\\"{]+rnzescape-sequencez	[^\\\'{]+z\'z[\w\-:]+ú	html-attrr­úhtml-contentz	[\w\-:]*>z	[\w\-:]+=zhtml-attr-valuez/>ú
single-stringz[^"\'{`=<>]+z<!--zhtml-commentz</úhtml-end-tagr«z[^<{]+z-->z[^\-]+|-)zescape-sequencerãzcomments-and-spacesrnr*ztype-1ztype-with-slashzslash-type-1z
type-lhs-1z
type-arrowz
type-tupleztype-recordznested-commentr]z
single-stringz
html-open-tagzhtml-end-tagz	html-attrzhtml-attr-valuezhtml-contentzhtml-commentN)rrrƒrrÙrÚrÛrÜrrrrˆrÝr‹r rÞrKr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çr*)rçrð)rçrñ)rçrñ)rçrò)rçr])rçrn)rçrn)rçró)%rorprqrrrsrtrurvrÍZident_reZop_reZpunc_rerr@rrrrr
rrÔrÕr
r}r{r×rØr|rzryr	ÚSingler~rHrrrrArArArBrÀsà








	




















c0@sÌeZdZdZdZdZddgZddgZdgZd Z	d¡Z
ddZd¢ZdnZ
doZd£Zdxejfdyejfdzejfgd{efd|ejjfd}ejd~fdejfd€ejfdejd‚fdƒd„je	ƒefd…d„je
d†d†d¤…ƒejfdˆee
efefdƒd„jeƒejfdƒd„jeƒejfd‰efdŠe j!fd‹e j"fdŒe j#fde j$fdŽe j%fdej&fdej&fd‘efd’ej'dtfd“ej(fgd”ejfd•ejd–fd—ejd˜fd?ejfgd™ej'fe)dšƒd›ej'fd’ej'd˜fgd{efdEe*fdœejfdejd˜fdžed˜fe+d˜ƒgdŸœZ,d†S)¥rz?
    For the ReasonML language.

    .. versionadded:: 2.6
    ZReasonMLzhttps://reasonml.github.io/ZreasonmlÚreasonz*.rez*.reiztext/x-reasonmlrr‚rƒr„r…rr†r‡rrrrˆr‰rŠrÚesfunr‹r.r r!rrŒrrŽr"ÚswitchrÚpubr‘r’Únonrecr“r$r&Úprir(r/r1r)r•r–r—r*r+r™ršr-r,ú!=r5rœú&&ú\(ú\)ú\*ú\+r<r¢ú-\.ú=>ú\.ú\.\.ú\.\.\.r3ú::ú:=ú:>r=ú;;r«ú<-r4r­ú>]ú>\}ú\?ú\?\?ú\[ú\[<ú\[>ú\[\|r9r>r¶ú\{ú\{<ú\|ú\|\|ú\|]ú\}r¼z[!$%&*+\./:<=>?@^|~-]rr½r¾r¿rÀÚlsrrÁrÂrÃz[!?~]z[=<>@^|&+\*/$%-]rÄrÅrÆrÇr]r\rÈrÉz
\\[\\"\'ntbr]z
\\[0-9]{3}z\\x[0-9a-fA-F]{2}z\s+zfalse|true|\(\)|\[\]z\b([A-Z][\w\']*)(?=\s*\.)rbz\b([A-Z][\w\']*)z//.*?\nz	\/\*(?!/)rSz\b(%s)\brVz(%s)NrDz
(%s|%s)?%sz
[^\W\d][\w']*z(-?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)z0[xX][\da-fA-F][\da-fA-F_]*z0[oO][0-7][0-7_]*z0[bB][01][01_]*z\d[\d_]*z7'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2}))'z'.'rÊr?z[~?][a-z][\w\']*:z[^/*]+z\/\*z#pushz\*\/z#popz[^\\"]+zescape-sequencez\\\nz[A-Z][\w\']*(?=\s*\.)z[A-Z][\w\']*z
[a-z_][\w\']*)zescape-sequencernrSr]rb)0rr‚rƒr„r…rr†r‡rrrrˆr‰rŠrrör‹r.r r!rrŒrrŽr"r÷rrør‘r’rùr“r$r&rúr(r/r1r)r•r–r—r*r+r™ršr-r,)+rûr5rœrürýrþrÿrr<r¢rrrrrr3rrrr=r	r«r
r4r­rrr
rrrrrr9r>r¶rrrrrrr¼)	rr½r¾r¿rÀrrÁrÂrÃ)rÄrÅrÆrÇr]r\rÈrÉrË)-rorprqrrrsrÌrtrurvrÍrÎrÏrÐrÑrÒrÓrr@rrrÔrÕrHr€rrôrwrxr
r	rÖrr
r}r{r×rØr|ryrzr~rrrrrArArArBrsz









c5@sàeZdZdZdZdZdgZddgZdgZd¨Z	d©Z
dªZd«ZdrZ
dsZdtZd¬Zd}ejfd~ejfdejfgd€efdejjfd‚ejdƒfd„ejfd…ed†fd‡efdˆd‰je	ƒefdˆd‰jeƒejfdˆd‰je
ƒejfdŠd‰jed‹d‹d­…ƒefdeee
fefdˆd‰jeƒejfdŽefde j!fde j"fd‘e j#fd’e j$fd“e j%fd”ej&fd•ej&fd–efd—ej'fd˜efd™ej(dyfdšej)fgd›efdœedfdžedŸfd efgd¡ej(fe*d¢ƒd£ej(fd™ej(dŸfgd€efdXe+fd¤ejfd¥ejdŸfd¦edŸfe,dŸƒgd§œZ-d‹S)®rz8
    For the F* language.
    .. versionadded:: 2.7
    ZFStarzhttps://www.fstar-lang.org/Zfstarz*.fstz*.fstiztext/x-fstarÚabstractÚ
attributesÚnoeqÚunopteqÚandbeginÚbyrÚeffectrrÚensuresrÚexistsr‰rÝrr‹r r!rÚinlineÚinline_for_extractionÚirreducibleÚlogicrKrr‘r’Ú
new_effectÚ	noextractr$r&Úopaquer”Úrange_ofÚ	reifiableÚreifyÚreflectableÚrequiresÚset_range_ofÚ
sub_effectÚsynthr)Útotalr–r—r*ÚunfoldÚ
unfoldabler+ršr,Únotr"r(ÚassumeÚadmitr‚Úcalcr¼r¢ú/\\ú\\/ú<:ú<@ú\(\|ú\|\)r5úu#rœú\(ú\)ú\(\)r<ú~>ú->ú<-ú<--ú<==>ú==>ú\.ú\?ú\?\.ú\.\[ú\.\(ú\.\(\|ú\.\[\|ú
\{:patternr3ú::ú:=r=ú;;r4ú%\[ú!\{ú\[ú\[@ú\[\|ú\|>ú\]ú\|\]ú\{ú\|ú\}ú\$z[!$%&*+\./:<=>?@^|~-]z[!?~]z[=<>@^|&+\*/$%-]rÄrÅrÆrÇr]r\rÈrÉz
\\[\\"\'ntbr]z
\\[0-9]{3}z\\x[0-9a-fA-F]{2}z\s+zfalse|true|False|True|\(\)|\[\]z\b([A-Z][\w\']*)(?=\s*\.)rbz\b([A-Z][\w\']*)z\(\*(?![)])rSz\/\/.+$z\b(%s)\brVz(%s)NrDz
(%s|%s)?%sz
[^\W\d][\w']*z(-?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)z0[xX][\da-fA-F][\da-fA-F_]*z0[oO][0-7][0-7_]*z0[bB][01][01_]*z\d[\d_]*z7'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2}))'z'.'rÊz\`([\w\'.]+)\`z\`r?z[~?][a-z][\w\']*:z[^(*)]+z\(\*z#pushz\*\)z#popz[(*)]z[^\\"]+zescape-sequencez\\\nz[A-Z][\w\']*(?=\s*\.)z[A-Z][\w\']*z
[a-z_][\w\']*)zescape-sequencernrSr]rb)5rrrrrrrr rrr!rr"r‰rÝrr‹r r!rr#r$r%r&rKrr‘r’r'r(r$r&r)r”r*r+r,r-r.r/r0r1r)r2r–r—r*r3r4r+ršr,r5)r"r()r6r7r‚r8)/r¼r¢r9r:r;r<r=r>r5r?rœr@rArBr<rCrDrErFrGrHrIrJrKrLrMrNrOrPr3rQrRr=rSr4rTrUrVrWrXrYrZr[r\r]r^r_)rÄrÅrÆrÇr]r\rÈrÉrË).rorprqrrrsrÌrtrurvrÍZ
decl_keywordsZassume_keywordsrÎrÏrÑrÒrÓrr@rrrÔrÕrHr€rrxr
Ú	ExceptionZDeclarationr	rr
r}r{r×rØr|ryrÖrzr~rrrrrArArArBr`sŠ





)rrrWZpygments.lexerrrrrrZpygments.tokenrrr	r
rrr
rrÚ__all__rrrrrrArArArBÚ<module>	s,Q]E]