|e)dZddlZddlmZmZmZmZddlmZm 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-2023 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. N)Lexer RegexLexerinclude do_insertions) TextCommentOperatorKeywordNameStringNumber PunctuationGeneric Whitespace) RConsoleLexerSLexerRdLexerz.*? c(eZdZdZdZddgZdgZdZy)rz@ For R console transcripts or R CMD BATCH output files. RConsolerconsoleroutz*.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)N>+r)roptionsline_refinditergroup startswithappendlenrPromptrget_tokens_unprocessedstartOutput)selftextslexercurrent_code_block insertionsmatchlines 3/usr/lib/python3/dist-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 filenamesr&rr0rrs% D6"G I Or8rceZdZdZdZgdZgdZgdZdZde jfgee fgde fgd e jfgd efd efgd e j fd e j"j$fgdej(fdefgeddefdedfdedfededededededg deze j0fedde fdefgd ed!fgd"ed!fgd# Zd$Zy%)&rzG For S, S-plus, and R source code. .. versionadded:: 0.10 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-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_dquotebuiltin_symbols valid_namenumberskeywords punctuation operatorsz (%s)\s*(?=\() statementsz\{|\}.z([^\'\\]|\\.)*\'z#popz([^"\\]|\\.)*") r>rBrErDrFrArCrGrootr?r@c2tjd|ryy)Nz[a-z0-9_\])\s]<-(?!-)g)\(?)research)r*s r0 analyse_textzSLexer.analyse_texts 99-t 4 5r8N)r1r2r3r4r5r6r7 mimetypesrBrSingler rr Reservedr ConstantBuiltinPseudor Hexrrr FunctionrtokensrMrr8r0rrCs D!GEIEIPJgnn %   *; 7      9( C 4h ?    ,, -  4VZZ @ K     J  Z FO , FO , % & L ! I  J  M " K    *DMM : L ! { # 4L !&& 1  / BFHr8rc eZdZdZdZdgZdgZdgZddejfde fd e jfd e fd e 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 `_ and `Parsing Rd files `_. .. versionadded:: 1.6 Rdrdz*.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 rQPreprocr rRrrVrr8r0rrs  DfGI I  6== ) g  ')9)9 : w ' *GOO < dll # T " 4L Fr8r)r4rKpygments.lexerrrrrpygments.tokenrrr r r r r rrr__all__compilerrrrrr8r0r`sg DD--- 1 2::g )OE)OXTZTn$j$r8