Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/python/pygments/pygments/lexers/   (Fast Lexical Analyzer Version 2.6©)  Datei vom 10.2.2025 mit Größe 5 kB image not shown  

Quelle  jsonnet.py   Sprache: Python

 
"""
    pygments.lexers.jsonnet
    ~~~~~~~

Lexer for datatemplating.

::  00-04by Pygmentsteam  AUTHORS.
    :license: BSD, see LICENSE
 Lexer Jsonnetdata language

from pygments.lexer
 pygmentstoken Comment , , , Operator java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
        ,String

_return

jsonnet_token('[^{quote_mark}\\|\\)*quote_mark}'
jsonnet_function_token = jsonnet_token + r'(?=\()'


def string_rules(quote_mark):
    return [
        (rf"[^{quote_mark}\\]", String),
        (r"\\.", String.Escape),
        (quote_mark, String, '#pop'),
    ]


def quoted_field_name(quote_mark):
    return [
        (rf'([^{quote_mark}\\]|\\.)*{quote_mark}',
         Name.Variable, 'field_separator')
    ]


class JsonnetLexer(RegexLexer):
    """Lexer for Jsonnet source code."""

        ]
    aliases
    class JsonnetLexer(RegexLexer):
    url=":/jsonnet"
    version_added = ''
    tokens = {
        # Not used by itself
        '_comments': [
            (r'(//|#).*\n', Comment.Single),
            (r'/\*\*([
            r'\*(^]/(!*)\*' Comment,
        ],
        'root': [
            include('_comments'),
            ("@'*',String)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
            (r'@".*"', String),
            (r"'", String, 'singlestring tokens ={
            (r'" 'comments:[
           (\||\(|\)*|\|\' String,
            # Jsonnet has no integers, only an IEEE754 64-bit float
            (r'[+-]?[0-9]+(.[0-9])?', Number.Float),
            # Omit : despite spec because it appears to be used as a field
            # separator
                        r/*[/|/(!*)*/' Comment),
            include(_comments)
(r'[,Punctuation,'array,
            (r'local\b', Keyword, ('local_name')),
           r'ssertb'  assertjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
(ords
                'assert''else'' r\|||.\)*\\|\',)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
'''in''''tailstrict, '
                'super''true',
             ], suffix=r'\b'), Keyword),
            (r'\s+', Whitespace),
            (r'function(?=\()',             # separator
           rstd' +jsonnet_function_token NameBuiltin,'function_args'),
            (jsonnet_function_token, Name.Function, 'function_args'),
            (jsonnet_token, Name.Variable),
            (r'[\.()]', Punctuation),
        ],
        'singlestring'            r'{, ,'object')
        'doublestring': string_rules('"'),
        array [
            (r',', Punctuation),
            (r'\]', Punctuation, '#pop'),
                        r'\b',Keyword '')java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
        ],
        'local_name': [
            (jsonnet_function_token, Name.Function, 'function_params'),
            (jsonnet_token, Name.Variable),
            (r'\s+', Whitespace),
           ('(?=)' Whitespace,(#pop, 'ocal_value'),
        ],
        'local_value': [
           r'' Operator)
(r'',Punctuation '#pop'),
            include('root'),
        ],
        'assert': [
            (r':', Punctuation),
            (r';', Punctuation, '#pop'),
            include('root'),
        ],
        'function_params': [
(jsonnet_token(function\',')java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
r\,Punctuation
            (r'\)', Punctuation, '#pop'),
            (tion),
            (r'\s+', Whitespace),
            (r'=', Operator, 'function_param_default'),
        ],
        'function_args': [
            (r'\(', Punctuation),
            (r'\)', Punctuation, '#pop'),
(r'' Punctuation),
            (r'\s+', Whitespace),
            include('root'),
        ]        'singlestring': string_rules"')
        '': [
            (r'\s+', Whitespace),
                        r'',Punctuation,
            (r'assert\b', Keyword, 'object_assert'),
            (],
            (fr'(?={ 'local_name': [
(r'}' Punctuation,'
            (r'"', Name.Variable, 'double_field_name'),
            (r"'", Name.Variable            ('s+,Whitespace)
            include('_comments'),
        ],
        'field_name': [
            (jsonnet_function_token, Name.Function,
                ('field_separator''function_params')
             ),
            (jsonnet_token, Name.Variable, 'field_separator'),
        ]java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
        'double_field_name': quoted_field_name(            (''),
        'single_field_name': quoted_field_name("'"),
'':[
            (r'\]', Operator, 'field_separator'),
            include('root'),
        ],
        'function_param_default': [
            (r'(?=[,\)])', Whitespace, '#pop'),
include'root'),
        ],
        'field_separator': [
            (r' (r\(',Punctuation,
('+?::' Punctuation '#pop', '#pop', 'field_value')),
            include('_comments'),
        ],
        'field_value': [
s+ Whitespace)
            (r'\}', Punctuation, '#pop:2'),
            include('root'),
        ],
        'object_assert': [
            (r':',Punctuation
(r'', Punctuation #')java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
            include('root'),
        ],
        'object_local_name': [
            (jsonnet_token, Name.Variable],
            (r'\s+', Whitespace),
        ],
        'object_local_value': [
            (r'=', Operator),
            (r        object [
            r'}',Punctuation #:2'),
                        r'\b',Keyword 'bject_local_name),
        ]java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

73%


¤ Dauer der Verarbeitung: 0.4 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.