Your IP : 216.73.216.213


Current Path : /opt/alt/python37/lib/python3.7/site-packages/pygments/lexers/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/pygments/lexers/__pycache__/data.cpython-37.pyc

B

ʽ�\oJ�@s�dZddlZddlmZmZmZmZmZmZddl	m
Z
mZmZm
Z
mZmZmZmZmZddddgZGd	d
�d
e�ZGdd�de�ZGdd�de�ZGd
d�de�ZGdd�de�ZdS)z�
    pygments.lexers.data
    ~~~~~~~~~~~~~~~~~~~~

    Lexers for data file format.

    :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�
RegexLexer�ExtendedRegexLexer�LexerContext�include�bygroups�inherit)	�Text�Comment�Keyword�Name�String�Number�Punctuation�Literal�Error�	YamlLexer�	JsonLexer�JsonBareObjectLexer�JsonLdLexercs eZdZdZ�fdd�Z�ZS)�YamlLexerContextz'Indentation context for the YAML lexer.cs.tt|�j||�g|_d|_d|_d|_dS)N���r)�superr�__init__�indent_stack�indent�next_indent�block_scalar_indent)�self�args�kwds)�	__class__��E/opt/alt/python37/lib/python3.7/site-packages/pygments/lexers/data.pyrs
zYamlLexerContext.__init__)�__name__�
__module__�__qualname__�__doc__r�
__classcell__r!r!)r r"rsrcs�eZdZdZdZdgZddgZdgZdd�Zd	d
�Z	dgdd
�Z
dhdd�Zdd�Zdd�Z
dd�Zdd�Zdefdefdejfde	ej�dfde	ej�dfde	ej�d fd!e
ed"d#�d$fgdefdejfd%ed&fgd'eee�d(fgd)eeejeej�d(fgd*ee�d&fd+e
e�fd,eej�fd-e
e�d.fgd/ee�d.fd0efd1eejeed"d2��fed3�ed4�ed5�d6eej�d7fgd8ejfd9ejfd:ejfd;ejfgd<eejd"d2�fd=ejd>fgd?ejd@fdAejdBfdCedDfdEedFfgd0efdefdejfdGejfed3�ed5�dHeej�dIfgedJ�dKejd.fgd1eeje�fedJ�dLejd.fgd%efdMe
eej �fdNee�fdOej fgdPeej�d(fdQeej�d(fgdRefdSefdefd0ejfgedT�dUej!fdVefdCed.fgedT�dWefdXej!fdYefdZed.fgdMefdefd[eej�d\fdNee�d.fgd]ee�d.fd^ed.fdSefded_fd0e"j#j$fd`e"j#j$fgdaee�d.fd^ed.fdRefdSefdefd0ejfdbejfgdc�Z%di�fdedf�	Z&�Z'S)jrz}
    Lexer for `YAML <http://yaml.org/>`_, a human-friendly data serialization
    language.

    .. versionadded:: 0.11
    ZYAMLZyamlz*.yamlz*.ymlztext/x-yamlcs�fdd�}|S)zDo not produce empty tokens.c3s.|��}|sdS|���|fV|��|_dS)N)�group�start�end�pos)�lexer�match�context�text)�token_classr!r"�callback0s
z%YamlLexer.something.<locals>.callbackr!)r0r1r!)r0r"�	something.szYamlLexer.somethingcs�fdd�}|S)zReset the indentation levels.c3s>|��}g|_d|_d|_d|_|���|fV|��|_dS)Nrr)r(rrrrr)r*r+)r,r-r.r/)r0r!r"r1:sz(YamlLexer.reset_indent.<locals>.callbackr!)r0r1r!)r0r"�reset_indent8szYamlLexer.reset_indentFcs��fdd�}|S)z"Save a possible indentation level.c3s�|��}d}�rnt|�|_|j|jkr�x|j|jkrB|j��|_q(W|j|jkr�||jd�}|d|j�}n|jt|�7_|r�|���|fV|r�|��t|��j|fV|��|_	dS)N�)
r(�lenrrr�popr)rr*r+)r,r-r.r/�extra)r)r0r!r"r1Fs 
z'YamlLexer.save_indent.<locals>.callbackr!)r0r)r1r!)r)r0r"�save_indentDszYamlLexer.save_indentcs��fdd�}|S)z+Set the previously saved indentation level.c3s^|��}|j|jkr*|j�|j�|j|_�s@|jt|�7_|���|fV|��|_dS)N)	r(rrr�appendr5r)r*r+)r,r-r.r/)�implicitr0r!r"r1\sz&YamlLexer.set_indent.<locals>.callbackr!)r0r:r1r!)r:r0r"�
set_indentZs	zYamlLexer.set_indentcs�fdd�}|S)z5Set an explicit indentation level for a block scalar.c3sd|��}d|_|sdS|�d�}|rBt|jd�}t|�}|||_|r`|���|fV|��|_dS)N�r)r(r�maxr�intr)r*r+)r,r-r.r/Z	incrementZcurrent_indent)r0r!r"r1is

z3YamlLexer.set_block_scalar_indent.<locals>.callbackr!)r0r1r!)r0r"�set_block_scalar_indentgs
z!YamlLexer.set_block_scalar_indentcs��fdd�}|S)z(Process an empty line in a block scalar.c3s�|��}|jdks t|�|jkr6|rx|���|fVnB|d|j�}||jd�}|���|fV|��|j�|fV|��|_dS)N)r(rr5r)r*r+)r,r-r.r/�indentation�content)�content_token_class�indent_token_classr!r"r1zs

z9YamlLexer.parse_block_scalar_empty_line.<locals>.callbackr!)rCrBr1r!)rBrCr"�parse_block_scalar_empty_linexs
z'YamlLexer.parse_block_scalar_empty_linecs�fdd�}|S)z-Process indentation spaces in a block scalar.c3s�|��}|jdkrJt|�t|jd�kr>|j��|j��dSt|�|_n&t|�|jkrp|j��|j��dS|r�|���|fV|��|_	dS)Nr)
r(rr5r=r�stackr6r)r*r+)r,r-r.r/)r0r!r"r1�s




z5YamlLexer.parse_block_scalar_indent.<locals>.callbackr!)r0r1r!)r0r"�parse_block_scalar_indent�sz#YamlLexer.parse_block_scalar_indentcs�fdd�}|S)z-Process indentation spaces in a plain scalar.c3sP|��}t|�|jkr.|j��|j��dS|rL|���|fV|��|_dS)N)r(r5rrEr6r)r*r+)r,r-r.r/)r0r!r"r1�s

z5YamlLexer.parse_plain_scalar_indent.<locals>.callbackr!)r0r1r!)r0r"�parse_plain_scalar_indent�s	z#YamlLexer.parse_plain_scalar_indentz[ ]+(?=#|$)z\n+z#[^\n]*z^%YAML(?=[ ]|$)zyaml-directivez^%TAG(?=[ ]|$)z
tag-directivez^(?:---|\.\.\.)(?=[ ]|$)z
block-linez[ ]*(?!\s|$)T)r))z
block-liner@z\nz#pop:2z([ ]+)([0-9]+\.[0-9]+)zignored-linez;([ ]+)(!|![\w-]*!)([ ]+)(!|!?[\w;/?:@&=+$,.!~*\'()\[\]%-]+)z[ ]*$z[ ]+(?=[?:-](?:[ ]|$))z[?:-](?=[ ]|$)z[ ]*z#popz[ ]*(?=#|$)z[ ]+z([^,:?\[\]{}"'\n]+)(:)(?=[ ]|$))r:�descriptorszblock-nodesz
flow-nodesz'(?=[^\s?:,\[\]{}#&*!|>\'"%@`-]|[?:-]\S)zplain-scalar-in-block-contextz!!<[\w#;/?:@&=+$,.!~*\'()\[\]%-]+>z+!(?:[\w-]+!)?[\w#;/?:@&=+$,.!~*\'()\[\]%-]*z&[\w-]+z\*[\w-]+z
:(?=[ ]|$)z[|>])zblock-scalar-contentzblock-scalar-headerz\[z
flow-sequencez\{zflow-mappingz\'zsingle-quoted-scalarz\"zdouble-quoted-scalarz[?:,]z(?=[^\s?:,\[\]{}#&*!|>\'"%@`])zplain-scalar-in-flow-contextzflow-collectionz\]z\}z^[ ]+$z^[ ]*z[\S\t ]+z([1-9])?[+-]?(?=[ ]|$)z[+-]?([1-9])?(?=[ ]|$)z^[ ]+z[ ]+$zquoted-scalar-whitespacesz\'\'z[^\s\']+z\\[0abt\tn\nvfre "\\N_LP]z5\\(?:x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})z	[^\s"\\]+�"z^(?=---|\.\.\.)z#pop:3z[ ]*(?=:[ ]|:$)z	[ ]+(?=#)z&plain-scalar-in-block-context-new-linez(?::(?!\s)|[^\s:])+z[ ]*(?=[,:?\[\]{}])z[^\s,:?\[\]{}]+)�rootzignored-linezyaml-directivez
tag-directiver@z
block-linerHzblock-nodesz
flow-nodeszflow-collectionz
flow-sequencezflow-mappingzblock-scalar-contentzblock-scalar-headerzquoted-scalar-whitespaceszsingle-quoted-scalarzdouble-quoted-scalarz&plain-scalar-in-block-context-new-linezplain-scalar-in-block-contextzplain-scalar-in-flow-contextNcs$|dkrt|d�}tt|��||�S)Nr)rrr�get_tokens_unprocessed)rr/r.)r r!r"rK�s
z YamlLexer.get_tokens_unprocessed)F)F)NN)(r#r$r%r&�name�aliases�	filenames�	mimetypesr2r3r8r;r?rDrFrGrr	�Singler�TagZ	Namespacerr
r
ZTyperZ	Indicatorr�VariableZLabelr�ConstantZEscaperZScalarZPlain�tokensrKr'r!r!)r r"r!s�
















c@s�eZdZdZdZdgZdgZdgZej	Z
dZdZdZ
d	efgd
ejfde�ejfeejfdejfged
�defdedfdedfged�dejdfdedfged�ed
�defdedfged�ed�dedfdedfged
�gd�ZdS)rz>
    For JSON data structures.

    .. versionadded:: 1.5
    ZJSONZjsonz*.jsonzapplication/jsonz-?(0|[1-9]\d*)z\.\d+z[eE](\+|-)?\d+z\s+z(true|false|null)\bzB%(int_part)s(%(frac_part)s%(exp_part)s|%(exp_part)s|%(frac_part)s)z"(\\\\|\\"|[^"])*"�value�:�,z#popz\}z#pop:2�
whitespace�objectattributez\]�simplevaluez\{�objectvaluez\[�
arrayvalue)rXrZrYr[r\rUrJN)r#r$r%r&rLrMrNrO�re�DOTALL�flagsZint_partZ	frac_partZexp_partrr
rS�varsr
ZFloatZIntegerr�DoublerrrrQrTr!r!r!r"r�s@





c@sBeZdZdZdZdgZgZdgZdefe	d�gdefe
gd�ZdS)	rza
    For JSON data structures (with missing object curly braces).

    .. versionadded:: 2.2
    ZJSONBareObjectzjson-objectzapplication/json-objectz\}r[)rJrYN)r#r$r%r&rLrMrNrOrrrrTr!r!r!r"rsc@s<eZdZdZdZddgZdgZdgZddej	d	fe
giZd
S)rzV
    For `JSON-LD <http://json-ld.org/>`_ linked data.

    .. versionadded:: 2.0
    zJSON-LDZjsonldzjson-ldz*.jsonldzapplication/ld+jsonr[zU"@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"rYN)r#r$r%r&rLrMrNrOrZ	DecoratorrrTr!r!r!r"rs)r&r]Zpygments.lexerrrrrrrZpygments.tokenrr	r
rrr
rrr�__all__rrrrrr!r!r!r"�<module>
s ,O