From a28369481a7fac9274235e2b789802468d3ed417 Mon Sep 17 00:00:00 2001 From: Jean Abou Samra Date: Sun, 25 Sep 2022 12:44:15 +0200 Subject: [PATCH] Fix regexlint warnings caused by limitations of regexlint --- pygments/lexers/jsonnet.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pygments/lexers/jsonnet.py b/pygments/lexers/jsonnet.py index 0794c060c7..356191fe33 100644 --- a/pygments/lexers/jsonnet.py +++ b/pygments/lexers/jsonnet.py @@ -63,13 +63,13 @@ class JsonnetLexer(RegexLexer): (r'@".*"', String), (r"'", String, 'singlestring'), (r'"', String, 'doublestring'), - (r'(?s:\|\|\|.*\|\|\|)', String), + (r'\|\|\|(.|\n)*\|\|\|', 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'[!$~+\-&|^=<>*/%]', Operator), - (r'[{]', Punctuation, 'object'), + (r'\{', Punctuation, 'object'), (r'\[', Punctuation, 'array'), (r'local\b', Keyword, ('local_name')), (r'assert\b', Keyword, 'assert'), @@ -129,7 +129,7 @@ class JsonnetLexer(RegexLexer): (r'assert\b', Keyword, 'object_assert'), (r'\[', Operator, 'field_name_expr'), (fr'(?={jsonnet_token})', Text, 'field_name'), - (r'}', Punctuation, '#pop'), + (r'\}', Punctuation, '#pop'), (r'"', Name.Variable, 'double_field_name'), (r"'", Name.Variable, 'single_field_name'), include('_comments'), @@ -157,7 +157,7 @@ class JsonnetLexer(RegexLexer): ], 'field_value': [ (r',', Punctuation, '#pop'), - (r'}', Punctuation, '#pop:2'), + (r'\}', Punctuation, '#pop:2'), include('root'), ], 'object_assert': [ @@ -172,7 +172,7 @@ class JsonnetLexer(RegexLexer): 'object_local_value': [ (r'=', Operator), (r',', Punctuation, '#pop'), - (r'}', Punctuation, '#pop:2'), + (r'\}', Punctuation, '#pop:2'), include('root'), ], }