K iJdZddlZddlmZmZmZmZddlmZm Z m Z m Z m Z m Z mZmZmZmZgdZej&dZGddeZGd d eZGd d eZy) z pygments.lexers.r ~~~~~~~~~~~~~~~~~ Lexers for the R/S languages. :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. N)Lexer RegexLexerinclude do_insertions) TextCommentOperatorKeywordNameStringNumber PunctuationGeneric Whitespace) RConsoleLexerSLexerRdLexerz.*? c4eZdZdZdZddgZdgZdZdZdZ d Z y ) rz@ For R console transcripts or R CMD BATCH output files. RConsolerconsoleroutz*.Routhttps://www.r-project.orgz"rconsole/r-console-transcript.Routc #6Ktdi|j}d}g}tj|D]}|j }|j ds|j dr:|j t|dtj|ddfgf||ddz }o|r't||j|Ed{d}g}|jtj|f|r$t||j|Ed{yy7T7w)Nr>+r)roptionsline_refinditergroup startswithappendlenrPromptrget_tokens_unprocessedstartOutput)selftextslexercurrent_code_block insertionsmatchlines W/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/pygments/lexers/r.pyr'z$RConsoleLexer.get_tokens_unprocessed#s1'$,,' %%d+ :E;;=Ds#ts';!!3'9#:%&Ra$A#B#DE"d12h."&,"F$A$ABT$U WWW*,&!#JkkmW^^T99' :0 $F99:LMO O O W Os%B>DDA DDDDN) __name__ __module__ __qualname____doc__namealiases filenamesurl version_added_exampler'rr1rrs4 D6"G I %CM3H Or<rceZdZdZdZgdZgdZgdZdZdZ dZ d e jfge e fgd e d e jfgd efgd ej"fgdefdefgdej&fde j(j*fgdej.fdefgeddefdedfdedfededededededed g ed!d"efd#efgd$ed%fgd&ed%fgd' Zd(Zy))*rz+ For S, S-plus, and R source code. S)splussr)z*.Sz*.Rz .Rhistoryz .Rprofilez .Renviron)z text/S-plusztext/Sztext/x-r-sourceztext/x-rztext/x-Rztext/x-r-historyztext/x-r-profilerz0.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_dquotebuiltin_symbolskeywords function_name valid_namenumbers punctuation operators statementsz\{|\}.z([^\'\\]|\\.)*\'z#popz([^"\\]|\\.)*") rCrIrHrKrGrLrFrJrMrootrDrEc2tjd|ryy)Nz[a-z0-9_\])\s]<-(?!-)g)\(?)research)r+s r1 analyse_textzSLexer.analyse_texts 99-t 4 5r<N)r2r3r4r5r6r7r8 mimetypesr9r:rIrSingler Functionrr Reservedr ConstantBuiltinPseudor Hexrrr rtokensrSrr<r1rrFs D!GEIEI %CMOJgnn %   *Z ($-- 8 *; 7      =h G 4h ?    ,, -  4VZZ @ K     J  Z FO , FO , % & J  O $ L ! I  M " K   L ! { # 4L  !&& 1  / EEFNr<rc eZdZdZdZdgZdgZdgZdZdZ dd e jfd e fd e jfd e fd e jfdej"fdefdefgiZy)raR 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 `_ and `Parsing Rd files `_. Rdrdz*.Rdz text/x-r-docz1http://cran.r-project.org/doc/manuals/R-exts.htmlz1.6rOz \\[\\{}%]z%.*$z\\(?:cr|l?dots|R|tab)\bz \\[a-zA-Z]+\bz^\s*#(?:ifn?def|endif).*\bz[{}]z [^\\%\n{}]+rNN)r2r3r4r5r6r7r8rTr9r:r Escaperr rXPreprocr rYrr\rr<r1rrs DfGI I =CM  6== ) g  ')9)9 : w ' *GOO < dll # T " 4L Fr<r)r5rQpygments.lexerrrrrpygments.tokenrrr r r r r rrr__all__compiler rrrrr<r1rfsg DD--- 1 2::g ,OE,O^WZWt$j$r<