HOME


Mini Shell 1.0
DIR: /usr/lib/python3/dist-packages/pygments/lexers/__pycache__/
Upload File :
Current File : //usr/lib/python3/dist-packages/pygments/lexers/__pycache__/r.cpython-312.pyc
�

|�e)����dZddlZddlmZmZmZmZddlmZm	Z	m
Z
mZmZm
Z
mZmZmZmZgd�Zej&d�ZGd�de�ZGd	�d
e�ZGd�de�Zy)
z�
    pygments.lexers.r
    ~~~~~~~~~~~~~~~~~

    Lexers for the R/S languages.

    :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�Lexer�
RegexLexer�include�
do_insertions)
�Text�Comment�Operator�Keyword�Name�String�Number�Punctuation�Generic�
Whitespace)�
RConsoleLexer�SLexer�RdLexerz.*?
c�(�eZdZdZdZddgZdgZd�Zy)rz@
    For R console transcripts or R CMD BATCH output files.
    �RConsole�rconsole�routz*.Routc	#�6K�tdi|j��}d}g}tj|�D]�}|j	�}|jd�s|jd�r:|j
t|�dtj|ddfgf�||ddz
}�o|r't||j|��Ed{���d}g}|j�tj|f����|r$t||j|��Ed{���yy7�T7��w)N��>�+r��)r�options�line_re�finditer�group�
startswith�append�lenr�Promptr�get_tokens_unprocessed�start�Output)�self�text�slexer�current_code_block�
insertions�match�lines       �3/usr/lib/python3/dist-packages/pygments/lexers/r.pyr&z$RConsoleLexer.get_tokens_unprocessed s1�����'�$�,�,�'�����
��%�%�d�+�	:�E��;�;�=�D����s�#�t���s�';��!�!�3�'9�#:�%&�����R�a��$A�#B�#D�E�"�d�1�2�h�.�"�&�,�"�F�$A�$A�BT�$U� W�W�W�*,�&�!#�J��k�k�m�W�^�^�T�9�9�'	:�0�$��F�9�9�:L�M�O�
O�
O��W��
O�s%�B>D�D�A
D�D�D�DN)�__name__�
__module__�__qualname__�__doc__�name�aliases�	filenamesr&r�r0rrs%����D��6�"�G��
�I� Or8rc���eZdZdZdZgd�Zgd�Zgd�ZdZde	jfgeefgdefgd	e
jfgd
efdefgde
j fd
ej"j$fgdej(fdefged�defdedfdedfed�ed�ed�ed�ed�ed�g
dezej0fed�defdefgd ed!fgd"ed!fgd#�Zd$�Zy%)&rzG
    For S, S-plus, and R source code.

    .. versionadded:: 0.10
    �S)�splus�s�r)z*.Sz*.Rz	.Rhistoryz	.Rprofilez	.Renviron)ztext/S-plusztext/Sztext/x-r-sourceztext/x-rztext/x-Rztext/x-r-historyztext/x-r-profilez;`[^`\\]*(?:\\.[^`\\]*)*`|(?:[a-zA-Z]|\.[A-Za-z_.])[\w.]*|\.z#.*$z\[{1,2}|\]{1,2}|\(|\)|;|,zH(if|else|for|while|repeat|in|next|break|return|switch|function)(?![\w.])z(<<?-|->>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|\?z$\*|\+|\^|/|!|%[^%]*%|=|~|\$|@|:{1,3}zm(NULL|NA(_(integer|real|complex|character)_)?|letters|LETTERS|Inf|TRUE|FALSE|NaN|pi|\.\.(\.|[0-9]+))(?![\w.])z(T|F)\bz#0[xX][a-fA-F0-9]+([pP][0-9]+)?[Li]?z;[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+|\.)([eE][+-]?[0-9]+)?[Li]?�commentsz\s+z\'�
string_squotez\"�
string_dquote�builtin_symbols�
valid_name�numbers�keywords�punctuation�	operatorsz
(%s)\s*(?=\()�
statementsz\{|\}�.z([^\'\\]|\\.)*\'z#popz([^"\\]|\\.)*")r>rBrErDrFrArCrG�rootr?r@c�2�tjd|�ryy)Nz[a-z0-9_\])\s]<-(?!-)g)\��(�?)�re�search)r*s r0�analyse_textzSLexer.analyse_text�s��
�9�9�-�t�4��5r8N)r1r2r3r4r5r6r7�	mimetypesrBr�Singlerrr
�Reservedr	�Constant�Builtin�Pseudor
�Hexrrr�Functionr�tokensrMrr8r0rrCs�����D�!�G�E�I�E�I�P�J��g�n�n�%�
����
�*�;�7�
��
�
�
�
�
�9�(�C�
4�h�?�
�
��
�
�
�����,�,�-�
�4�V�Z�Z�@�
K�
�
�	
�
�J��
�Z� �
�F�O�,�
�F�O�,��%�&��L�!��I���J���M�"��K� �
��
�
*�D�M�M�:��L�!�
�{�#�
�4�L�
�!�&�&�1�
����/�
�B�F�Hr8rc
��eZdZdZdZdgZdgZdgZddejfde
fd	ejfd
efde
jfdejfd
efdefgiZy)ram
    Pygments Lexer for R documentation (Rd) files

    This is a very minimal implementation, highlighting little more
    than the macros. A description of Rd syntax is found in `Writing R
    Extensions <http://cran.r-project.org/doc/manuals/R-exts.html>`_
    and `Parsing Rd files <http://developer.r-project.org/parseRd.pdf>`_.

    .. versionadded:: 1.6
    �Rd�rdz*.Rdztext/x-r-docrIz	\\[\\{}%]z%.*$z\\(?:cr|l?dots|R|tab)\bz
\\[a-zA-Z]+\bz^\s*#(?:ifn?def|endif).*\bz[{}]z[^\\%\n{}]+rHN)r1r2r3r4r5r6r7rNr�Escaperr
rQ�PreprocrrRrrVrr8r0rr�s���	��D��f�G���I�� �I�
	�
�6�=�=�)�
�g��
'��)9�)9�:�
�w�'�
*�G�O�O�<�
�d�l�l�#�
�T�"�
�4�L�
��Fr8r)r4rK�pygments.lexerrrrr�pygments.tokenrrr	r
rrr
rrr�__all__�compilerrrrrr8r0�<module>r`sg���
�D�D�-�-�-�1���2�:�:�g���)O�E�)O�XT�Z�T�n$�j�$r8