3
V'íc= ã @ s° d Z ddlZddlmZmZmZmZmZmZ ddl m
Z
mZmZm
Z
mZmZmZmZmZ dgZdddd d
ddd
ddddddddddddddddddd d!d"gZG d#d deZdS )$zÅ
pygments.lexers.crystal
~~~~~~~~~~~~~~~~~~~~~~~
Lexer for Crystal.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
é N)ÚExtendedRegexLexerÚincludeÚbygroupsÚdefaultÚwordsÚline_re) ÚCommentÚOperatorÚKeywordÚNameÚStringÚNumberÚPunctuationÚErrorÚ
WhitespaceÚCrystalLexerz!=z!~ú!ú%z&&ú&z**Ú*ú+ú-ú/z<=>z<<z<=ú<z===z==z=~ú=z>=z>>ú>z[]=z[]?z[]ú^z||ú|ú~c . @ sÎ e Zd ZdZdZdZddgZdgZdgZe j
e jB Zdd Z
d
d Zdejfed
j ddefedj dddejfdejfedddgddejfdeeeejfdeeeejdfdedfdeeeejdfedj dddejfdejjfedj dddejfd ejjfd!e
fd"e
fd#ejd$fd%eeejd&fd'ejd&fd(eeejd&fd)eejee fd*eej!ee fd+eej"ee fd,eej#ee fd-eej#ee fd.eej#ee fd/eej$ee fd0ej%j&fd1ej%j'fd2ej%j(fd3ej%j(fd4ej%j(fd5e fe)d6d7ej*fd8ejfd9ej+d:fd;ej+d<fd=ee eej,d>fee-d?d@ee ej fdAee efdBefdCe fdDe fdEe.fdFefg-dGeej&e ej/dHfe0dHgdIej&fdJee.eej&ee.fe0dHgdKej+dLfdMej+dHfe)dNgdOej+dPfgdQej1fge)dRe)dSge)dRdTejfdUejfge)dRdTej2fdUej2fge)dRdVejfdWejfdTejfdXejfdYejdHfgdZejdHfgd9ej+dLfd[ej+dHfd\efe)dNgd;ej+dLfd]ej+dHfe)dNgd^e dLfd_e dHfe)dNgd`Z3e3j4e daS )br z=
For Crystal source code.
.. versionadded:: 2.2
ZCrystalzhttp://crystal-lang.orgÚcrZcrystalz*.crztext/x-crystalc c sî |j d}|t|jdfV |j dtj|jdfV |j dtj|jdfV |j dtj|jdfV |jjdg }t| }|j |jddk|jdf |j d|_
|jd|_t|dk rØ| j
|d E d H n|j
tj|jdfV |j |_
|rêxÔ|D ]Ì\}}g }x¼tj|j|j
D ]}|r:|j j } n|j j } | |krx$|D ]}
|
j tj|
j fV qVW |j tj|j fV |j |_
P n
|j | q"W x"|D ]}
|
j t|
j fV q°W qW t|j|_|d d
= d S )
Né é é é Úheredocstackz<<-é éd )Úcontext)Ústartr Úgroupr ZHeredocZ DelimiterÚ__dict__Ú
setdefaultÚboolÚappendÚposÚendÚlenZget_tokens_unprocessedr ÚfinditerÚtextÚstripÚrstripr )ÚselfÚmatchÚctxr( r$ Z outermostZtolerantZhdnameÚlinesÚcheckZamatch© r: ú;/tmp/pip-build-gk9425m9/Pygments/pygments/lexers/crystal.pyÚheredoc_callback* s@
zCrystalLexer.heredoc_callbackc