YBFj+dZddlZddlmZmZmZmZmZmZm Z m Z ddl m Z m Z mZmZmZmZmZmZmZmZddlmZgdZGddeZGd d eZGd d eZGd deZGddeZGddeZGddeZ GddeZ!GddeZ"GddeZ#GddeZ$dS)z pygments.lexers.haskell ~~~~~~~~~~~~~~~~~~~~~~~ Lexers for Haskell and related languages. :copyright: Copyright 2006-present by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. N)Lexer RegexLexerbygroups do_insertionsdefaultincludeinheritline_re) TextCommentOperatorKeywordNameStringNumber PunctuationGeneric Whitespace) unistring) HaskellLexer HspecLexer IdrisLexer AgdaLexer CryptolLexerLiterateHaskellLexerLiterateIdrisLexerLiterateAgdaLexerLiterateCryptolLexer KokaLexerceZdZdZdZdZddgZdgZdgZdZ d Z d Z gd e fd e jfd e jdfdejdfdejdfdejfdde ejfdejfdejfdejzdzejfdejzdzefdejzdzejfdejzdzejfdejfdejfd ejfd!ejfd"ejfd#ejfd$efd%ej fd&ej fd'ej fd(ej fd)ej!fd*ej"fd+ej#fd,ej$fd-ejd.fd/ed0fd1ejfd2ej%fd3e&fd e fd/ed0fd4e&d5fd6efd7ejzd8zejzd9ze'ej(e ee ed5fd7ejzd:ze'ej(e ee e&d;fd7ejzdejzd?zej(d5fgd e fd>ejzd@zejfdAejzdBzejfd e jfd e jdfdCe&fd$efdDe&dEfd4e&dFfg dGe jfd e jdHfdIe jd5fdJe jfgdKejd5fdLej)dMfd-ejd5fgdNefdLej)dMfd/ed5fgdOej)d5fdPejzdQzej)d5fde ej)d5fdRej)d5fdSej)d5fdTej)d5fdUe'e ej)d5fgdVZ*dWS)XrzP A Haskell lexer based on the lexemes defined in the Haskell 98 Report. Haskellzhttps://www.haskell.org/haskellhsz*.hsztext/x-haskellz0.8)caseclassdatarderivingdoelsefamilyifin infix[lr]?instanceletnewtypeofthentypewhere_NULSOHz[SE]TXEOTENQACKBELBSHTLFVTFFCRzS[OI]DLEzDC[1-4]NAKSYNETBCANEMSUBESCz[FGRU]SSPDEL\s+!--(?![!#$%&*+./<=>?@^|_~:\\]).*?$\{-comment \bimport\bimport \bmodule\bmodule \berror\b\b({})(?!\')\b|z'[^\\]'z'\\.'z^[_z][\w\']*z'?[_z][\w']*z('')?[z(')[z (')\[[^\]]*\]z (')\([^)]*\)z(')[:!#$%&*+.\\/<=>?@^|~-]+\\(?![:!#$%&*+.\\/<=>?@^|~-]+)+(<-|::|->|=>|=)(?![:!#$%&*+.\\/<=>?@^|~-]+):[:!#$%&*+.\\/<=>?@^|~-]*[:!#$%&*+.\\/<=>?@^|~-]+z40[xX]_*[\da-fA-F](_*[\da-fA-F])*_*[pP][+-]?\d(_*\d)*zR0[xX]_*[\da-fA-F](_*[\da-fA-F])*\.[\da-fA-F](_*[\da-fA-F])*(_*[pP][+-]?\d(_*\d)*)?z\d(_*\d)*_*[eE][+-]?\d(_*\d)*z+\d(_*\d)*\.\d(_*\d)*(_*[eE][+-]?\d(_*\d)*)?z0[bB]_*[01](_*[01])*z0[oO]_*[0-7](_*[0-7])*z 0[xX]_*[\da-fA-F](_*[\da-fA-F])*z \d(_*\d)*' character"string\[\]\(\) [][(),;`{}]\)#pop qualified\bz([z][\w.]*)(\s+)(as)(\s+)([z][\w.]*)z][\w.]*)(\s+)(hiding)(\s+)(\()funclistz][\w.]*)(\s+)(\()[\w.]+[z][\w.]*z]\w*z (_[\w\']+|[z ][\w\']*),\(rfrf#pop:2[^-{}]+#push-\}[-{}][^\\']'\\escape[^\\"]+[abfnrtv"\'&\\]z\^[][z@^_]o[0-7]+ x[\da-fA-F]+\d+ (\s+)(\\)rootrRrTrfrPr]r_rsN)+__name__ __module__ __qualname____doc__nameurlaliases filenames mimetypes version_addedreservedasciirr Single MultilinerReservedr ExceptionformatjoinrCharuniLlFunctionLuTyper WordrFloatBinOctHexIntegerBuiltinrr NamespaceEscapetokensEC:\PYTHON\_runtimes\venv\Lib\site-packages\pygments/lexers/haskell.pyrrs D $C$GI!"IMFH 9E + Z + 27> B + W& 2 + G,h 7+ G,h 7+ 4> *+  % %chhx&8&8 9 97;K L+  %+ v{ #+ cf_{ *DM :+ sv  *D 1+  + -w| -+ . *G+ J6; ,K+ L68 $M+ Pgl #Q+ Rdl #S+ T[ )U+ \Z 68 $ K ( W % SV^9 9CF B[ P Xdnj':t L Lf VSV^? ? Xdnj':{ S SU_ aSV^2 2 Xdnj+ > >  L /# (Z SV^2 2 Xdnj+ > >  L CF]Z ' @  Z CF]W $gl 3 cf $| 3T] C 17> B W& 2 ;  (( 3 K!9 : K *  * + W& 0 W& / w( )  f - FM8 , &+v &   FM8 , && !   7   (&- @ XXe__fmV 4  / fmV 4 V]F + 88J >> G MooFFFrrc eZdZdZdZdgZdgZgZdZdde e e e j fde e e e j fd e e e e j fegiZd S) rz< A Haskell lexer with support for Hspec constructs. Hspechspecz*Spec.hsz2.4r{z(it)(\s*)("[^"]*")z(describe)(\s*)("[^"]*")z(context)(\s*)("[^"]*")N)r|r}r~rrrrrrrr rrDocr rrrrrrs DiG IIM  "HHT:vz$J$J K (((4VZ*P*P Q '$ FJ)O)O P   FFFrrcveZdZdZdZdZddgZdgZdgZdZ d Z d Z d Z d d e eeejfdeeejfdeeejfdeeejdfdeeejeejefd d e ejfdeejedfdejfdefdejfdejfdejfdejfdejfdejfde j!dfd e d!fd"efd#efgd$efd%eej"ee#d&fd'ej"d(fgd$efd)ejfd*ejfd+ejfd,ejdfd-e#fd.efd/e#d0fd1e#d2fg d3ejfd,ejd4fd5ejd(fd6ejfgd7e j!fd8e j$d9fde j!d(fgd:e fd8e j$d9fd e d(fgd;e j$d(fde j$d(fde j$d(fd?eee j$d(fgd@Z%dAS)Brzq A lexer for the dependently typed programming language Idris. Based on the Haskell and Agda Lexer. Idriszhttps://www.idris-lang.org/idrisidrz*.idrz text/x-idris2.0)3r$r%r&rusingr(r)r+r,r-r.rewriteauto namespacecodatamutualprivatepublicabstracttotalpartial interfaceimplementationexportcovering constructorr/proofr1r2staticr4r5withpatterntermsyntaxprefix postulate parametersrecorddsl impossibleimplicittacticsintrosintrocomputerefineexacttrivialr6) liblinkflagrhidefreezeaccessrloggingdynamicrerror_handlerslanguagez ^(\s*)(%({}))rWz((\s*)(--(?![!#$%&*+./<=>?@^|_~:\\]).*?)$z(\s*)(\|{3}.*?)$z (\s*)(\{-)rP^(\s*)([^\s(){}]+)(\s*)(:)(\s*)rV(import|module)(\s+)rT('')?[A-Z][\w\']*z [a-z][\w\']*z(<-|::|->|=>|=)z"([(){}\[\]:!#$%&*+.\\/<=>?@^|~-]+)\d+[eE][+-]?\d+\d+\.\d+([eE][+-]?\d+)?0[xX][\da-fA-F]+rxr\r]r^r_ [^\s(){}]+\s+?rM([A-Z][\w.]*)(\s+)(\()rf [A-Z][\w.]*rd[A-Z]\w*(_[\w\']+|[a-z][\w\']*)z--.*$rOrir[rjrkrcrlrmrnrorpz[^\\']rrrsrtru \^[][A-Z@^_]rvrwry)r{rTrfrPr]r_rsN)&r|r}r~rrrrrrrrr directivesrrrrrrr rrrrr rrr rrrrrrrrrrrrrrrsL D 'CG I IMWH 9E YJ  $ $SXXj%9%9 : : Xj'"2 3 3 5 8((:w~:^:^ _ ((:w~"F"F G HHZ1BCCY O / Xj$-X]J W W Y % %chhx&8&8 9 97;K L $hhw/?&L&Lh W !7< 0 d #  / 2HM B  . ' 6 &* - V^ $ 6; , 68 $ D ! j !7 <Z & Xdnj+ > >  L T^V 4  Z ', ' ' 7 w~ & W& 2 ;  (( 3 K!9 : K *  * + W& 0 W& / w( )   $ FM8 , &+v &   FM8 , && !   7 fmV 4 XXe__fmV 4  / fmV 4 V]F + 88J >> G IMMFFFrrczeZdZdZdZdZdgZdgZdgZdZ dZ d e e e je eje fd ejfd ejd fd ejdfdde ejfde eje dfdejfdefdejfdejfdejfdejfdejfdejdfdedfde fde fgd ejfd ejd!fd"ejd#fd$ejfgd ejd fd%e d#fd&e fge!j"d e!j"de!j"de!j"d'd(Z"d)S)*rza For the Agda dependently typed functional programming language and proof assistant. Agdaz.http://wiki.portal.chalmers.se/agda/pmwiki.phpagdaz*.agdaz text/x-agdar)+rr coinductiverr&r(z eta-equalityfieldforallhidingr, inductiveinfixinfixlinfixrr. interleavedr/macrorzno-eta-equalityopaqueopenoverlaprr primitiverquote quoteTermrrenamingrrtactic unfoldingunquote unquoteDecl unquoteDefrvariabler4rrrNrOrPz\{!holerVrWrrTz\b(Set|Prop)[\u2080-\u2089]*\bz (\(|\)|\{|\})z((\.{1,3}|\||\u03BB|\u2200|\u2192|:|=|->)rrrrxr\r]r^r_rrz[^!{}]+rnz!\}rdz[!{}]z[a-zA-Z][\w.\']*z [\W0-9_]+rs)r{rrTrPr]r_rsN)#r|r}r~rrrrrrrrrrrrr rr rr Directiverrrrrrrrrrrr rrrrrrr!s D :ChG IIMH0 Xj$-mZ11 227> B W& 2 W& / % %chhx&8&8 9 97;K L $hhw/?&L&L   . = x ( 8(- H  . ' 6 &* - V^ $ 6; , 68 $ D ! j !9 @* + W& 0 W& / w( )  W& 2 $ / 4   &y1!(5%h/%h/]//FFFrrceZdZdZdZddgZdgZdgZdZdZ d Z d Z d e fd e jfd e jdfdejdfdejdfdejfdde ejfdejfdefdejfdejfdejfdejfdefdejfdejfdejfd ejfd!ejfd"ej d#fd$ed%fd&ejfd'ej!fd(e"fgd e fd$ed%fd)e"d*fd+efd,e#ej$e ee ed*fd-e#ej$e ee e"d.fd/e#ej$e e"d.fd0ej$d*fgd e fd/e#ej$e e"d.fd1ej$d*fgd e fd2ejfd3ejfd4e"fdefd5e"d6fd)e"d7fgd8e jfd e jd9fd:e jd*fd;e jfgdfd"ej d*fgd?efd=ej%d>fd$ed*fgd@ej%d*fdAej%d*fde ej%d*fdBej%d*fdCej%d*fd!ej%d*fdDe#e ej%d*fgdEZ&hdFZ'dGZ(dHS)IrzX FIXME: A Cryptol2 lexer based on the lexemes defined in the Haskell 98 Report. Cryptolcryptolcryz*.cryztext/x-cryptolhttps://www.cryptol.netr)ArithBitCmpFalseInfTruer)rexternfinr+rRinflg2maxminrTr0pragmapropertyr2r3r4widthr6rM//.*$/\*rPrQrRrSrTrUrVrWz^[_a-z][\w\']*z'?[_a-z][\w']*rrXrYrZr[rrz 0[oO][0-7]+rrxr\r]r^r_r`rarbrcrdrez(([A-Z][\w.]*)(\s+)(as)(\s+)([A-Z][\w.]*)z#([A-Z][\w.]*)(\s+)(hiding)(\s+)(\()rfrrgrrrrirjrkrl[^/*]+rn\*/[*/]rqrrrsrtrurrvrwryrz><<>><<<>>>parregseqrtailconsterrorsplittracerASSERTlengthreverse transpose undefinedc#Kdg}tj|||D]1\}}}|tur||jvr|tj|fV*|||fV2dS)Nr{)rget_tokens_unprocessedrEXTRA_KEYWORDSr)selftextstackindextokenvalues rr-z#CryptolLexer.get_tokens_unprocesseds1$eDD * * E5%}}$*=!=!=T\500000UE)))))  * *rN))r|r}r~rrrrrrrrrrr rrrrrrrrrrr rrrrrrrrrrrrrrr.r-rrrrrjs D% G I!"I #CM2H 9EZ w~ & W& 2G,h 7 G,h 7 4> *  % %chhx&8&8 9 97;K L  .  % !7< 0 . > ;X] K )7< 8 (( 3  . ' 6 VZ ( &* - V^ $ 6; , 68 $ gl # dl # [ )A! HZ 68 $ K ( W % 8 Xdnj':t L Lf V4 Xdnj':{ S SU_ a' Xdnj+ > >  L /# (Z & Xdnj+ > >  L T^V 4  Z ', ' ' 7;  (( 3 K!9 : K *  ) * W& 0 W& / g' (  f - FM8 , &+v &   FM8 , && !   7 fmV 4 XXe__fmV 4  / fmV 4 V]F + 88J >> G wddFLN *****rrc>eZdZdZejdZdZdZdS) LiterateLexera Base class for lexers of literate file formats based on LaTeX or Bird-style (prefixing each code line with ">"). Additional options accepted: `litstyle` If given, must be ``"bird"`` or ``"latex"``. If not given, the style is autodetected: if the first non-whitespace character in the source is a backslash or percent character, LaTeX is assumed, else Bird. z(>[ \t]*)(.*\n)c 8||_tj|fi|dS)N) baselexerr__init__)r/r8optionss rr9zLiterateLexer.__init__s'" t''w'''''rc # K|jd}|"|dddvrdpd}d}g}|dkrtj|D]}|}|j|}|r^|t|dtj |dfgf||dz }|t|dt|fgfn7dd l m}|d i|j} d} d} tj|D]}|}| r5|d rd} | |z } G||z }M|d rNd} | |z } |t|t!| | fd} | |z } |t|t!| | ft%||j|Ed{VdS) Nlitstylerz%\latexbird)TexLexerz \end{code}z \begin{code}r)r:getlstripr finditergroupbird_rematchappendlenr Specialr pygments.lexers.markuprB startswithlistr-rr8) r/r0stylecode insertionsrHlinemrBlxlexer codelinesr>s rr-z$LiterateLexer.get_tokens_unprocesseds   ,, =[[]]1Q3'50=gGE F?? )$// F F{{}}L&&t,,F%%s4yy)*GOQWWQZZ(H'I'KLLLAGGAJJ&DD%%s4yyAtT?2C&DEEEE F 8 7 7 7 7 7h....GIE )$// " "{{}} "{{}}// >>%$%   [[]]--o>>" !ITME%%s4yy'+G,J,J5,Q,Q'R'R'TUUUEETMEE   s4yy#G$B$B5$I$IJJL M M M T^-R-RSW-X-XYYYYYYYYYYYrN) r|r}r~rrecompilerGr9r-rrrr6r6sU  bj+,,G(((*Z*Z*Z*Z*Zrr6c8eZdZdZdZgdZdgZdgZdZdZ dZ d S) raS For Literate Haskell (Bird-style or LaTeX) source. Additional options accepted: `litstyle` If given, must be ``"bird"`` or ``"latex"``. If not given, the style is autodetected: if the first non-whitespace character in the source is a backslash or percent character, LaTeX is assumed, else Bird. zLiterate Haskell)zliterate-haskelllhaskelllhsz*.lhsztext/x-literate-haskellz-https://wiki.haskell.org/Literate_programmingz0.9c Dtdi|}tj||fi|dSNr)rr6r9r/r:hslexers rr9zLiterateHaskellLexer.__init__Es6))))tW8888888rN r|r}r~rrrrrrrr9rrrrr3sX   D555G I*+I 9CM99999rrc8eZdZdZdZgdZdgZdgZdZdZ dZ d S) raQ For Literate Idris (Bird-style or LaTeX) source. Additional options accepted: `litstyle` If given, must be ``"bird"`` or ``"latex"``. If not given, the style is autodetected: if the first non-whitespace character in the source is a backslash or percent character, LaTeX is assumed, else Bird. zLiterate Idris)zliterate-idrislidrislidrz*.lidrztext/x-literate-idrisz?https://idris2.readthedocs.io/en/latest/reference/literate.htmlrc Dtdi|}tj||fi|dSr\)rr6r9r]s rr9zLiterateIdrisLexer.__init__\s6''w''tW8888888rNr_rrrrrJsX   D222G I()I KCM99999rrc8eZdZdZdZddgZdgZdgZdZdZ d Z d S) ra: For Literate Agda source. Additional options accepted: `litstyle` If given, must be ``"bird"`` or ``"latex"``. If not given, the style is autodetected: if the first non-whitespace character in the source is a backslash or percent character, LaTeX is assumed, else Bird. z Literate Agdaz literate-agdalagdaz*.lagdaztext/x-literate-agdazEhttps://agda.readthedocs.io/en/latest/tools/literate-programming.htmlrc Htdi|}tj||fddi|dS)Nr<r>r)rr6r9)r/r: agdalexers rr9zLiterateAgdaLexer.__init__ss;(((( tYLLLGLLLLLrNr_rrrrras\   D(G I'(I QCMMMMMMrrc8eZdZdZdZgdZdgZdgZdZdZ dZ d S) raS For Literate Cryptol (Bird-style or LaTeX) source. Additional options accepted: `litstyle` If given, must be ``"bird"`` or ``"latex"``. If not given, the style is autodetected: if the first non-whitespace character in the source is a backslash or percent character, LaTeX is assumed, else Bird. zLiterate Cryptol)zliterate-cryptollcryptollcryz*.lcryztext/x-literate-cryptolrrc Dtdi|}tj||fi|dSr\)rr6r9)r/r:crylexers rr9zLiterateCryptolLexer.__init__s6**'**tX9999999rNr_rrrrrxsX   D666G I*+I #CM:::::rrceZdZdZdZdZdgZddgZdgZdZ gd Z gd Z gd Z gd Z d ZdezdzZdZejZejZejZeddezedfdeeeedfdeeeedfdde dzeeeedfdeeeeeejfdeeeejeeeeeej fdezdzeeeeeej fdezdzeeeeeeeej fdde ezej!fdde ezefdde ezej"fd ezefd!eejefd"eejefd#ezdzeejefd$ej#fd%e$j%d&fed'ze&fd(e&fd)e'fd*e(j)fd+e(j*fd,e(j+fd-e$j,d.fd/e$j%d0fgd1efedgd2e'd3fedgd4ed5fed6gd7ed3fd4ed5fd8efd9eeeefed6geddde ezefd:de ezd;zed3fdeejefd?efe-d3g d@eee.j/fdAefdBe.j0dCfdDe.j1fgdEe.j0fdBe.j0dFfdGe.j0d3fdHe.j0fgdIe$j%fdJe$j2fd/e$j%d3fgdKe$j%fedLdMe$j%d3fgdNe$j,fedLdOe$j,d3fgdPe$j2fdQe$j2fdRe$j2fdSe$j2fgdT Z3dUS)Vrz& Lexer for the Koka language. Kokaz/https://koka-lang.github.io/koka/doc/index.htmlkokaz*.kkz*.kkiz text/x-kokaz1.6)"rrrr3cotyperectypealiasstructconfunfunctionvalvarexternalr+r2r)elifreturnrHrrrrTrRasrinlinerectryyieldenumrr.)r3rprqrrrsr)rexistssomer) forwhilerepeatforeachzforeach-indexedr$catchfinallycsjsfilerefassignedz[$%&*+@!/\\^~=.:\-?|<>]+z(?!)z (?![\w/]) whitespacez::?r3z(alias)(\s+)([a-z]\w*)? alias-typez(struct)(\s+)([a-z]\w*)? struct-typez({})rWz(\s+)([a-z]\w*)?z=(module)(\s+)(interface(?=\s))?(\s+)?((?:[a-z]\w*/)*[a-z]\w*)z`(import)(\s+)((?:[a-z]\w*/)*[a-z]\w*)(?:(\s*)(=)(\s*)(qualified)?(\s*)((?:[a-z]\w*/)*[a-z]\w*))?z>^(public|private)?(\s+)?(function|fun|val)(\s+)([a-z]\w*|\((?:z|/)\))zd^(?:(public|private)(?=\s+external))?((?|[=.]z((?:[a-z]\w*/)*)([A-Z]\w*)z((?:[a-z]\w*/)*)([a-z]\w*)z((?:[a-z]\w*/)*)(\((?:z_\w*z@" litstringz |/(?![*/])`z [{}()\[\];,]z![0-9]+\.[0-9]+([eE][\-+]?[0-9]+)?z0[xX][0-9a-fA-F]+z[0-9]+r\charr^r_=z(?=\((?!,*\)))rdz[(\[<] type-nested type-contentz[)\]>]riz([a-z]\w*)(\s*)(:)(?!:)z(?=(({})z))z[EPHVX]z[a-z][0-9]*(?![\w/])z((?:[a-z]\w*/)*)([a-z]\w+)z ::|->|[.:|]z (\n\s*)(#.*)$rMrrPrrrnrrz[^"]+z""z [^\\"\n]+escape-sequencez["\n]z [^\\\'\n]+z[\'\n]z \\[nrt\\"\']z\\x[0-9a-fA-F]{2}z\\u[0-9a-fA-F]{4}z\\U[0-9a-fA-F]{6}) r{rrr3rrrrPrr_rrN)4r|r}r~rrrrrrrkeywordstypeStartKeywords typekeywordsbuiltinsymbols sboundaryboundaryr Attribute tokenTypeClass tokenTypeDefrEmphtokenConstructorrrrrrrrrrPseudoVariablerDoubler rrrrrrrr Preprocrrrrrrrrrs D ;ChG!IIM   H  L G*G#%IHI:L| GL ! !i F 3 '':|)T)T   (((7J *U*U  nnSXX&78899 !"*(7J "M"M   N Xgz7J O O Q+Xgz4>:wPZz4>;; < %'./1:; Xgz7J N N P ")*,56 Xgz7JUYUb c c e ^^CHH\22 3 3h > M ^^CHHX.. / /( :G D ^^CHHW-- . . 97> J ) +W 5+ Xdn&6 7 7 9 *HHT^T,J,J K & 09 < Xdnd + + - dm $FM; /| #X . 8  k *26< @ !6: .  ' 6; ' 6=( +u; ~7O GFOO  V 4 GFOO  = 1 GN # #  6 *  = 1 9  ' XdJ 2 2 4 GN # #   GL ! !^^CHH\22 3 3h > H    2 2 3 3h > E f ( "I .%i 0 i( ) * Xdni 0 0 2 * Xdni 0 0 2Y ' GFOO/ 8xx GODD E Z W& 2 w~ &  ) * W& 0 W& / g' (  v} % FM " 6=& ) 6= ) G% & & v}f - FK ( G% & &  V , fm , !6= 1 !6= 1 !6= 1  cXXFFFrr)%rrVpygments.lexerrrrrrrr r pygments.tokenr r r rrrrrrrpygmentsrr__all__rrrrrr6rrrrrrrrrs0 ''''''''''''''''''''------------------------%%%%%% 0 0 0 BBBBB:BBBJ*llllllll^FFFFF FFFRF*F*F*F*F*:F*F*F*R=Z=Z=Z=Z=ZE=Z=Z=Z@99999=999.99999999.MMMMM MMM.:::::=:::.TTTTT TTTTTr