o
    Ñ­jM  ã                   @   sš   d Z ddlZddlmZmZmZmZ ddlmZm	Z	m
Z
mZmZmZmZmZmZmZ g d¢Ze d¡ZG dd„ deƒZG d	d
„ d
eƒZG dd„ deƒZdS )zÇ
    pygments.lexers.r
    ~~~~~~~~~~~~~~~~~

    Lexers for the R/S languages.

    :copyright: Copyright 2006-present 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                   @   s6   e Zd ZdZdZddgZdgZdZdZdZ	d	d
„ Z
dS )r   z@
    For R console transcripts or R CMD BATCH output files.
    ÚRConsoleÚrconsoleÚroutz*.Routúhttps://www.r-project.orgÚ z"rconsole/r-console-transcript.Routc              	   c   sÒ   � t di | j¤Ž}d}g }t |¡D ]E}| ¡ }| d¡s"| d¡r=| t|ƒdtj	|d d… fgf¡ ||dd … 7 }q|rNt
|| |¡ƒE d H  d}g }| ¡ tj|fV  q|rgt
|| |¡ƒE d H  d S d S )Nr   ú>ú+r   é   © )r   ÚoptionsÚline_reÚfinditerÚgroupÚ
startswithÚappendÚlenr   ÚPromptr   Úget_tokens_unprocessedÚstartÚOutput)ÚselfÚtextÚslexerÚcurrent_code_blockÚ
insertionsÚmatchÚliner   r   úN/var/www/html/CropPilot/venv/lib/python3.10/site-packages/pygments/lexers/r.pyr$   #   s.   €
ÿ

ÿ
ÿÿz$RConsoleLexer.get_tokens_unprocessedN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚaliasesÚ	filenamesÚurlÚversion_addedÚ_exampler$   r   r   r   r.   r      s    r   c                   @   s  e Zd ZdZdZg d¢Zg d¢Zg d¢ZdZdZ	dZ
d	ejfge
efgd
e
› d�ejfgdefgdejfgdefdefgdejfdejjfgdejfdefgedƒdefdedfdedfedƒedƒedƒedƒedƒedƒed ƒged!ƒd"efd#efgd$ed%fgd&ed%fgd'œZd(d)„ Zd*S )+r   z+
    For S, S-plus, and R source code.
    ÚS)ÚsplusÚsÚr)z*.Sz*.Rz	.Rhistoryz	.Rprofilez	.Renviron)ztext/S-plusztext/Sztext/x-r-sourceztext/x-rztext/x-Rztext/x-r-historyztext/x-r-profiler   z0.10z;`[^`\\]*(?:\\.[^`\\]*)*`|(?:[a-zA-Z]|\.[A-Za-z_.])[\w.]*|\.z#.*$ú(z
)\s*(?=\()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ÚkeywordsÚfunction_nameÚ
valid_nameÚnumbersÚpunctuationÚ	operatorsÚ
statementsz\{|\}Ú.z([^\'\\]|\\.)*\'z#popz([^"\\]|\\.)*")r>   rD   rC   rF   rB   rG   rA   rE   rH   Úrootr?   r@   c                 C   s   t  d| ¡rdS d S )Nz[a-z0-9_\])\s]<-(?!-)g)\�Âõ(¼?)ÚreÚsearch)r(   r   r   r.   Úanalyse_text›   s   ÿzSLexer.analyse_textN)r/   r0   r1   r2   r3   r4   r5   Ú	mimetypesr6   r7   rD   r   ÚSingler
   ÚFunctionr   r	   ÚReservedr   ÚConstantÚBuiltinÚPseudor   ÚHexr   r   r   r   ÚtokensrM   r   r   r   r.   r   F   sp    ÿÿÿÿþÿþý
û	ÿüôúÿÿ¾Gr   c                
   @   sn   e Zd ZdZdZdgZdgZdgZdZdZ	dd	e
jfd
efdejfdefdejfdejfdefdefgiZdS )r   aR  
    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>`_.
    ÚRdÚrdz*.Rdztext/x-r-docz1http://cran.r-project.org/doc/manuals/R-exts.htmlz1.6rJ   z	\\[\\{}%]z%.*$z\\(?:cr|l?dots|R|tab)\bz\\[a-zA-Z]+\bz^\s*#(?:ifn?def|endif).*\bz[{}]z[^\\%\n{}]+rI   N)r/   r0   r1   r2   r3   r4   r5   rN   r6   r7   r   ÚEscaper   r	   rR   ÚPreprocr
   rS   r   rV   r   r   r   r.   r       s&    ñÿr   )r2   rK   Úpygments.lexerr   r   r   r   Úpygments.tokenr   r   r   r	   r
   r   r   r   r   r   Ú__all__Úcompiler   r   r   r   r   r   r   r.   Ú<module>   s    
0
/Z