3 ��X�\ � @ s� d Z ddlZddlmZmZmZmZmZ ddlm Z m Z mZmZm Z mZmZmZmZ dddgZejd�ZG d d� de�ZG d d� de�ZG dd� de�ZdS )z� pygments.lexers.r ~~~~~~~~~~~~~~~~~ Lexers for the R/S languages. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. � N)�Lexer� RegexLexer�include�words� do_insertions) �Text�Comment�Operator�Keyword�Name�String�Number�Punctuation�Generic� RConsoleLexer�SLexer�RdLexerz.*? c @ s* e Zd ZdZdZddgZdgZdd� ZdS ) r z@ For R console transcripts or R CMD BATCH output files. ZRConsoleZrconsoleZroutz*.Routc c s� t f | j�}d}g }x�tj|�D ]�}|j� }|jd�s@|jd�rv|jt|�dtj |d d� fgf� ||dd � 7 }q |r�xt ||j|��D ] }|V q�W d}g }|j� tj |fV q W |r�xt ||j|��D ] }|V q�W d S )N� �>�+r � )r �options�line_re�finditer�group� startswith�append�lenr ZPromptr �get_tokens_unprocessed�startZOutput)�self�textZslexerZcurrent_code_blockZ insertions�match�line�item� r% �/usr/lib/python3.6/r.pyr ! s( z$RConsoleLexer.get_tokens_unprocessedN)�__name__� __module__�__qualname__�__doc__�name�aliases� filenamesr r% r% r% r&