3 ��Xӛ � @ s� d Z ddlZddlmZmZmZmZmZmZ ddl m Z mZmZm Z mZmZmZmZmZ ddlmZ ddlmZmZ ddlmZ ddlmZ dd lmZ d ddd dgZG dd � d e�ZG dd� de�Z G dd � d e�Z!G dd� de�Z"G dd� de�Z#dS )z� pygments.lexers.webmisc ~~~~~~~~~~~~~~~~~~~~~~~ Lexers for misc. web stuff. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. � N)� RegexLexer�ExtendedRegexLexer�include�bygroups�default�using) �Text�Comment�Operator�Keyword�Name�String�Number�Punctuation�Literal)�unirange)�_indentation� _starts_block)� HtmlLexer)�JavascriptLexer)� RubyLexer� DuelLexer� SlimLexer�XQueryLexer�QmlLexer� CirruLexerc @ s� e Zd ZdZdZdddgZddgZdd gZej Z d deej ee�ej �fdeej ejeeej �fd eej ejej �fdeee�ee�ee��fdee�fdee�fgiZdS )r z� Lexer for Duel Views Engine (formerly JBST) markup with JavaScript code blocks. See http://duelengine.org/. See http://jsonml.org/jbst/. .. versionadded:: 1.4 ZDuelZduelZjbstz jsonml+bstz*.duelz*.jbstztext/x-duelztext/x-jbst�rootz(<%[@=#!:]?)(.*?)(%>)z(<%\$)(.*?)(:)(.*?)(%>)z(<%--)(.*?)(--%>)z(<script.*?>)(.*?)(</script>)z (.+?)(?=<)z.+N)�__name__� __module__�__qualname__�__doc__�name�aliases� filenames� mimetypes�re�DOTALL�flagsr r �Tagr r �Functionr r r � Multiliner �tokens� r, r, �/usr/lib/python3.6/webmisc.pyr s$ c l @ s� e Zd ZdZdZdddddgZdd d ddgZd dgZg ZdZ de d Z de e f ZdZde d Z dee f Zdeef ZeZdeef ZdZdZde d e d Zde d e d ZdZdZd ZejejB ejB Zd!d"� Zd#d$� Zd%d&� Z d'd(� Z!d)d*� Z"d+d,� Z#d-d.� Z$d/d0� Z%d1d2� Z&d3d4� Z'd5d6� Z(d7d8� Z)d9d:� Z*d;d<� Z+d=d>� Z,d?d@� Z-dAdB� Z.dCdD� Z/dEdF� Z0dGdH� Z1dIdJ� Z2dKdL� Z3dMdN� Z4dOdP� Z5dQdR� Z6dSdT� Z7dUdV� Z8dWdX� Z9dYdZ� Z:d[e;d\fd]e;d^fd_e;fd`e;fgdae<fge=db�dce#fdde;defdfe8fdge>dhfdie>dhfdje>dhfdke>dhfdle?j@dhfdme?j@dhfdne>dhfdoefdpefdqeAe>e<e>�drfdseAe>e<e>�dtfdueAe>e<e>�dtfdve dw eAe>e<eBjC�dtfdve dw eAe>e<eBjD�dtfdxe>dtfdyeAeEe<e>�dtfdzeFjGd{fd|eAe>e<eFjG�d{fd}eAe>e<e>e<e>e<eFjG�d{fd~eEfdeAe>e<e>�fd�e>d^fd�eAe>e<e>�fd�e>fd�e>dhfd�eAe>e<e>�dhfd�e>d�fd�e>dhfd�e?feeBjCfeeBjDfd�eAe>e<�dhfg$eeBjCd\feeBjDd\fge=db�dde;defd�e dw eAe>e<eBjC�fd�e dw eAe>e<eBjD�feeBjCfeeBjDfd�eEfd�e?fd�eEdhfeeFjHfg e=db�dde;defeeBjCd�feeBjDd�fd�e>dhfd�e>d�fd�eAe>e<e>�fd�e>fd�eEfg dde;defeeFjIfd�e dw eAeEeBjC�fd�e dw eAeEeBjD�fd�e dw eAeEe<eBjC�fd�e dw eAeEe<eBjD�fd�eEfd�eAe<eFjI�d�fd�eAe<e>jJe<eFjG�d{fd�eAe<e>jJe<�dhfg dde;defd�e d� eAeFeE�d�fge=db�dde;defed� eFjGd�feeFjGd�fge=db�dde;defdzeFjGd{fd�eAe>e<eEe<eE�d�fd�e4fd�eAe>e<eE��dfd�eAe>e<eEe<eE�d�fd�eAeEe<�d�fd�eEd\fd�e>d\fd�e dw eAe>e<eBjC�d�fd�e dw eAe>e<eBjD�d�fd�e>dhfd�e?j@dhfd�e?dhfd�e>dhfd�eAe>e<e>e<e>�dhfd�eAe>e<e>�drfd�eAe>e<e>�fd�eAe>e<e>�fdve dw eAe>e<eBjC�dtfdve dw eAe>e<eBjD�dtfd�e>dtfdyeAe?e<e>�dtfed� e>jKd�fd�eAe>jKeE�fee>jKd�fgdde;defd�eEdhfd�e"fd�eFd�feeFd�fd�e1fgdde;defd�eEd\feeFjGfeeBjCfeeBjDfgdde;defd�e#fd�eEfdfe6fd�eEfgd�e!fd�eLfd�eMd�d�� eLfgdae<d�fd�eBjNd\feeFfgd�eBjNd\fd�eMd�d�� eLfgd�eBjNd\fd�eMd�d�� eLfge=db�d�e fd�eFjOd�fd�eEd�fd�eEd�fd�e?feeFjOfgd�eEd�fdfe8fd�eFjPfeeFjPfeeFjPfeeFjPfd�eFjPfgd�eEd�fd�eEdhfd�eFjPfeeFjPfeeFjPfeeFjPfd�eFjPfgd�eFjOd�fdfe8fd�e/fd�e,fd�e-fd�e$feeLfeeLfeeLfd�eLfg e=db�d�e feeFjOfge=db�dde;defd�e>d\fgdde;defe=db�d�e>d\fge=db�dde;defeeBjCfeeBjDfd�e>fd�eEd\fgeeFjGd�fgd�eEd�fd�eMd�d�� eLfd�e<fge=db�dde;defd�e?d�fd�e?dhfeQd��ge=db�eeFjGd\fge=db�dfe6fd�eEdhfgeeFjGdhfgeeFjGdhfge=db�dde;defd�eRjSd�fd�eRjSd�fd�eRjSd�fd�eRjTd�fd�eEd�fd�eAe>jJe<e>jJ�d�fd�eAe>jJe<e>jJe<e>jJ�d�fd�eAe>jJe<e>jJe<e>jJ�d�fed� eFd�fd�e eFjOd�fd�eFjOd�feeBjCd�feeBjDd�fd�e#fd�eAe>jJe<e>jJe<e>jJ�fd�eAe>jJe<e>jJ�d�fd�eAe>jJe<e>jJ�d�fd�eAe>jJe<e>jJe<e>jJ�d�fd�eAe>jUe<e>jU�d�fd�eAe>jJe<e>jJ�d�fd�eAe>e<eFjG�d{fd}eAe>e<e>e<e>e<eFjG�d{fdzeFjGd{fd�eAe>jJe<e>jJe<eFjG�d{fd�eAe>jJe<eFjI�d�fd�eAe?e<e>�dtfd�e3fd�e2fd�e0fd�e+fd�e.fd�e5fd�eAe>jJe<e>jJ�d�fd�e*fd�e)fd�eAe>e<eE�fd�eAe>e<eE�fd�e7fd�e7fd�e dw eAe>e<�d�fd�e dw eAe>e<�d�fd�e �d eAe>e<eFjGe<eE�d�f�deAe>jJe<e>jJ�f�de6f�de'f�de(f�deAe>jJe<e>jJ��df�deAe>jUe<e>jU��df�d eAeEe<�d�f�d e>f�deAe>jJe<e>jJ��dfd�e dw eBjCd�fd�e dw eBjDd�f�d eAe>eE�f�deAe>eE�f�deAe>e<eE�fd�e>f�deAe>e<e>�fd�e>f�deAe>e<�dhf�deAe>e<eEeFjG�d{f�de dw eFjPd�f�de dw eFjPd�f�de eFjPd�f�deFjPd�f�deFjPd�f�deEfe�d eFjO�dfe�d eFjV�dfd�e �d eAeFjVe>jKeRjT�feeFjOd�fgI�d�!ZW�dS ( r z� An XQuery lexer, parsing a stream and outputting the tokens needed to highlight xquery code. .. versionadded:: 1.4 ZXQueryZxqueryZxqyZxqZxqlZxqmz*.xqyz*.xqueryz*.xqz*.xqlz*.xqmztext/xqueryzapplication/xqueryz(?:[A-Z]|_|[a-z])z(?:z|-|\.|[0-9])z (?:%s+%s*)z(?:[A-KN-WYZ]|_|:|[a-kn-wyz])z%s+%s*z%s:%sz (?:%s|%s)z"(?:&(?:lt|gt|amp|quot|apos|nbsp);)z(?:&#[0-9]+;|&#x[0-9a-fA-F]+;)z(?:"(?:�|z |""|[^&"])*")z(?:'(?:z |''|[^&'])*')z1[A-Za-z]|\s|\d|[!"#$%()*+,\-./:;=?@\[\\\]^_\'`|~]z0[A-Za-z]|\s|\d|[!#$%()*+,\-./:;=?@\[\\\]^_\'`|~]z/[A-Za-z]|\s|\d|[!"#$%()*+,\-./:;=?@\[\\\]^_`|~]c c s, |j � t|jd�fV dg|_|j� |_d S )N� r )�startr �group�stack�end�pos)�lexer�match�ctxr, r, r- �punctuation_root_callbackv s z%XQueryLexer.punctuation_root_callbackc c s, |j � t|jd�fV dg|_|j� |_d S )Nr/ r )r0 r r1 r2 r3 r4 )r5 r6 r7 r, r, r- �operator_root_callback| s z"XQueryLexer.operator_root_callbackc c s8 |j � tj|jd�fV |jj| jj� � |j� |_ d S )Nr/ ) r0 r r( r1 r2 �append�xquery_parse_state�popr3 r4 )r5 r6 r7 r, r, r- �popstate_tag_callback� s z!XQueryLexer.popstate_tag_callbackc c s8 |j � tj|jd�fV |jj| jj� � |j� |_ d S )Nr/ ) r0 r �Docr1 r2 r: r; r<