3 ��X � @ sb d Z ddlmZmZmZ ddlmZmZmZm Z m Z mZmZ ddl mZ dgZG dd� de�ZdS )z� pygments.lexers.tcl ~~~~~~~~~~~~~~~~~~~ Lexers for Tcl and related languages. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. � )� RegexLexer�include�words)�Text�Comment�Operator�Keyword�Name�String�Number)�shebang_matches�TclLexerc L @ s� e Zd ZdZed�d d d!�Zed�d d d!�ZdmZdngZdodpgZ dqdrdsgZ d�dudv�Zedw�edx�edy�dze fgeee�eeed{�eeed|�eeed}�d~e dfd�e d�fd�e d�fd�ejdffd�ejfd�efgd�efd�ejfd�ejfd�ejfd�ejfd�ejfd�efgd�e d�fd�ed�fd�e fedx�edy�gdze d�fed��gd�e d�fed��gd�e d�fed��gd�ejd�fd�ejfd�ejd�fgd�ejd�fd�ejfd�ejd�fgdze d�fed��edx�edy�gd�e d�fed��edx�edy�gd�e d�fed��edx�edy�gd�ed�fd�efgd��Zd�d�� Zd�S )�r z: For Tcl source code. .. versionadded:: 0.10 �after�apply�array�break�catch�continue�elseif�else�error�eval�expr�for�foreach�global�if� namespace�proc�rename�return�set�switch�then�trace�unset�update�uplevel�upvar�variable�vwait�whilez\b)�prefix�suffix�append�bgerror�binary�cd�chan�clock�close�concat�dde�dict�encoding�eof�exec�exit�fblocked� fconfigure�fcopy�file� fileevent�flush�format�gets�glob�history�http�incr�info�interp�join�lappend�lassign�lindex�linsert�list�llength�load�loadTk�lrange�lrepeat�lreplace�lreverse�lsearch�lset�lsort�mathfunc�mathop�memory�msgcat�open�package�pid�pkg::create�pkg_mkIndex�platform�platform::shell�puts�pwd� re_syntax�read�refchan�regexp�registry�regsub�scan�seek�socket�source�split�string�subst�tell�time�tm�unknown�unloadZTclZtclz*.tclz*.rvtz text/x-tclztext/x-script.tclzapplication/x-tcl� c C s4 | t d| f|tjd| fdtjd| fdtdfgS )N�paramsz ([\w.-]+)�#�comment)r r ZBuiltin�Variabler )�keyword_cmds_re�builtin_cmds_re�context� r� �/usr/lib/python3.6/tcl.py�_gen_command_rules1 s zTclLexer._gen_command_rules�command�basic�dataz\}z -in-bracez-in-bracketz -in-parenz\(�parenz\[�bracketz\{�brace�"z(eq|ne|in|ni)\bz/!=|==|<<|>>|<=|>=|&&|\|\||\*\*|[-+~!*/%<>&^|?:]z\s+z0x[a-fA-F0-9]+z0[0-7]+z\d+\.\d+z\d+z\$([\w.:-]+)z ([\w.:-]+)�;�#popz\nz(else|elseif|then)\brz z\)z\]z string-squarez(?s)(\\\\|\\[0-7]+|\\.|[^"\\])z$(?s)(\\\\|\\[0-7]+|\\.|\\\n|[^\]\\])zcommand-in-bracezcommand-in-parenzcommand-in-bracketz .*[^\\]\nz.*\\\n)�rootr� zcommand-in-bracezcommand-in-bracketzcommand-in-parenr� r� rz zparams-in-bracezparams-in-parenzparams-in-bracketrr z string-squarer� r� r� r| c C s t | d�S )Nz(tcl))r )�textr� r� r� �analyse_text� s zTclLexer.analyse_textN)r r r r r r r r r r r r r r r r r r r r! r"