3
V'íc@ ã @ sf d Z ddlZddlmZmZmZmZ ddlmZm Z m
Z
mZmZm
Z
mZmZ dgZG dd deZdS )zã
pygments.lexers.inferno
~~~~~~~~~~~~~~~~~~~~~~~
Lexers for Inferno os and all the related stuff.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
é N)Ú
RegexLexerÚincludeÚbygroupsÚdefault)ÚPunctuationÚCommentÚOperatorÚKeywordÚNameÚStringÚNumberÚ
WhitespaceÚ
LimboLexerc @ s e Zd ZdZdZdZdgZdgZdgZde e
eje
fde
fd e
fd
e
jfgdedfd
ejfdefdefgdedfdejfdejfdejfdejfdejfdejfdefdefdefdejfdejfdefg
ededdefd edfgeded!gd"Zd#d$ Zd%S )&r zÂ
Lexer for Limbo programming language
TODO:
- maybe implement better var declaration highlighting
- some simple syntax error highlighting
.. versionadded:: 2.0
ZLimboz+http://www.vitanuova.com/inferno/limbo.htmlZlimboz*.bz
text/limboz^(\s*)([a-zA-Z_]\w*:)(\s*\n)z\nz\s+z#(\n|(.|\n)*?[^\\]\n)ú"z#popzO\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|[0-7]{1,3})z [^\\"\n]+z\\Ústringz2'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'z (\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+z(\d+\.\d*|\.\d+|\d+[fF])z16r[0-9a-fA-F]+z8r[0-7]+z((([1-3]\d)|([2-9]))r)?(\d+)z
[()\[\],.]z%[~!%^&*+=|?:<>/-]|(->)|(<-)|(=>)|(::)z(alt|break|case|continue|cyclic|do|else|exitfor|hd|if|implement|import|include|len|load|orpick|return|spawn|tagof|tl|to|while)\bzK(byte|int|big|real|string|array|chan|list|adt|fn|ref|of|module|self|type)\bz(con|iota|nil)\bz[a-zA-Z_]\w*Ú
whitespaceÚ
statementsz[{}]ú;Ú statement)r r r r Úrootc C s t jd| t jrdS d S )Nz^implement \w+;gffffffæ?)ÚreÚsearchÚ MULTILINE)Útext© r ú;/tmp/pip-build-gk9425m9/Pygments/pygments/lexers/inferno.pyÚanalyse_textQ s zLimboLexer.analyse_textN) Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚurlÚaliasesÚ filenamesÚ mimetypesr r