3
V'íc ã @ sj d Z ddlZddlmZmZmZmZ ddlmZm Z m
Z
mZmZm
Z
mZmZmZ dgZG dd deZdS )zç
pygments.lexers.nimrod
~~~~~~~~~~~~~~~~~~~~~~
Lexer for the Nim language (formerly known as Nimrod).
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
é N)Ú
RegexLexerÚincludeÚdefaultÚbygroups) ÚTextÚCommentÚOperatorÚKeywordÚNameÚStringÚNumberÚPunctuationÚErrorÚNimrodLexerc 8 @ s e Zd ZdZdZdZddgZddgZdgZe j
e jB Zd d
Z
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBg8ZdCdDdEgZdd3d/dBd9d:dd.d&d0d)d*gZdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTgZdUejdVfdWejfdXejdYfdZefd[ejd\fd]efd^efd_eejeejd`fdaedbfdcejddfdeedffdgejdhfdie
e ejfdjeeejdkfdie
e efdie
dldmdnd"g ej fdoej!fdie
e e"j#fdie
e ej$fdpe"fdqe%j&dfdte%j'dufdve%j(dufdwe%j)dufdxe%j*dufdyejfdze+fgd{ej,fdgejd|fd}ejfgd~ej-fdefdefdefgdejfdUejdfdejd|fd
ejfgdejfdXejdfdejd|fd
ejfgdej,fdeed|fe.dgded|fdej,fe.dgdcejd|fe.ddejfgde"j/d|fde"j/d|fgdefgde%j&fde%j&fe0d|gde%j&fe0d|gde%j*j1fde%j*fe0d|gdefdejfded|fde"j2fgdefdejfdejd|fdejfgdZ3dS )r z9
For Nim source code.
.. versionadded:: 1.5
ZNimrodzhttp://nim-lang.org/ZnimrodZnimz*.nimz*.nimrodz
text/x-nimc C sV g }g }xB| D ]:}x |D ]}|j | |j d qW |j dj| g }qW dj|S )Nz_?Ú ú|)ÚappendÚjoin)ÚwordsZnewWordsÚnewÚwordÚch© r ú:/tmp/pip-build-gk9425m9/Pygments/pygments/lexers/nimrod.pyÚunderscorize# s
zNimrodLexer.underscorizeÚaddrÚandÚasZasmÚbindÚblockÚbreakZcaseÚcastZconceptÚconstÚcontinueÚ converterÚdeferÚdiscardZdistinctÚdivZdoÚelifÚelseÚendÚenumÚexceptÚexportÚfinallyÚforÚifÚinÚyieldZ interfaceÚisZisnotÚiteratorZletZmixinÚmodÚnotÚnotinÚobjectZofÚorÚoutÚptrÚraiseÚrefÚreturnZshlZshrZstaticÚtryÚtupleÚtypeZusingÚwhenÚwhileÚxorÚnilÚtrueÚfalseÚintZint8Zint16Zint32Zint64ÚfloatZfloat32Zfloat64ÚboolÚcharÚrangeÚarrayÚseqÚsetÚstringz##\[Ú
doccommentz##.*$z#\[Úcommentz#.*$z\{\.Úpragmaz[*=><+\-/@$~&%!?|\\\[\]]z<\.\.|\.|,|\[\.|\.\]|\{\.|\.\}|\(\.|\.\)|\{|\}|\(|\)|:|\^|`|;z(\n\s*)(of)(\s)Ú
casebranchz
(?:[\w]+)"Úrdqsz"""Útdqsú"Údqsú'Úcharsz(%s)\bz0(proc|func|method|macro|template)(\s)(?![(\[\]])ÚfuncnameÚfromÚimportr z(v_?a_?r)\bz&\b((?![_\d])\w)(((?!_)\w)|(_(?!_)\w))*z![0-9][0-9_]*(?=([e.]|\'f(32|64)))úfloat-suffixúfloat-numberz0x[a-f0-9][a-f0-9_]*z
int-suffixz0b[01][01_]*z0o[0-7][0-7_]*z[0-9][0-9_]*z\s+z.+$z-\\([\\abcefnrtvl"\']|x[a-f0-9]{2}|[0-9]{1,3})z#popÚ.z(?<!\$)\$(\d+|#|\w+)+z[^\\\'"$\n]+z[\'"\\]z\$z[^\]#]+z#pushz\]##z[\]#]z\]#z0\\([\\abcefnrtvl"\']|\n|x[a-f0-9]{2}|[0-9]{1,3})Ústringsz"(?!")z""z\nz$((?![\d_])\w)(((?!_)\w)|(_(?!_)\w))*z`.+`z\.(?!\.)[0-9_]*[f]*ze[+-]?[0-9][0-9_]*z
\'f(32|64)z
\'i(32|64)z \'i(8|16)ú,z[\n ]+ú:z\w+|[^:]z[:,]z\.\}z
\w+|\W+|[^.}])ÚrootrZ ra rQ rR rX rU rV r[ Únlzfloat-numberzfloat-suffixz
int-suffixrT rS N)r^ r_ )4Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚurlÚaliasesÚ filenamesÚ mimetypesÚreÚ MULTILINEÚ
IGNORECASEÚflagsr ÚkeywordsZkeywordsPseudoZopWordsÚtypesr ZDocr Z MultilineZOtherr r