diff options
author | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-06-09 14:39:19 +0300 |
---|---|---|
committer | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-06-09 14:39:19 +0300 |
commit | c04b663c7bb4b750deeb8f48f620497ec13da8fa (patch) | |
tree | 151ebc8bfdd2ad918caf5e6e2d8013e14272ddf8 /contrib/python/Pygments/py3/pygments/lexers/spice.py | |
parent | 0d55ca22c507d18c2f35718687e0b06d9915397b (diff) | |
download | ydb-c04b663c7bb4b750deeb8f48f620497ec13da8fa.tar.gz |
intermediate changes
ref:2d4f292087954c9344efdabb7b2a67f466263c65
Diffstat (limited to 'contrib/python/Pygments/py3/pygments/lexers/spice.py')
-rw-r--r-- | contrib/python/Pygments/py3/pygments/lexers/spice.py | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/contrib/python/Pygments/py3/pygments/lexers/spice.py b/contrib/python/Pygments/py3/pygments/lexers/spice.py index 51552b59f3..59d59b44c9 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/spice.py +++ b/contrib/python/Pygments/py3/pygments/lexers/spice.py @@ -4,7 +4,7 @@ Lexers for the Spice programming language. - :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -19,17 +19,16 @@ __all__ = ['SpiceLexer'] class SpiceLexer(RegexLexer): """ - For `Spice <http://spicelang.com>`_ source. + For Spice source. .. versionadded:: 2.11 """ name = 'Spice' + url = 'https://www.spicelang.com' filenames = ['*.spice'] aliases = ['spice', 'spicelang'] mimetypes = ['text/x-spice'] - flags = re.MULTILINE | re.UNICODE - tokens = { 'root': [ (r'\n', Whitespace), @@ -39,22 +38,27 @@ class SpiceLexer(RegexLexer): (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline), (r'(import|as)\b', Keyword.Namespace), (r'(f|p|type|struct|const)\b', Keyword.Declaration), - (words(('if', 'else', 'for', 'foreach', 'while', 'break', 'continue', 'return', 'new', 'ext'), suffix=r'\b'), Keyword), + (words(('if', 'else', 'for', 'foreach', 'while', 'break', 'continue', 'return', 'ext', 'inline', 'public'), suffix=r'\b'), Keyword), (r'(true|false)\b', Keyword.Constant), (words(('printf', 'sizeof'), suffix=r'\b(\()'), bygroups(Name.Builtin, Punctuation)), (words(('double', 'int', 'short', 'long', 'byte', 'char', 'string', 'bool', 'dyn'), suffix=r'\b'), Keyword.Type), # double_lit (r'\d+(\.\d+[eE][+\-]?\d+|\.\d*|[eE][+\-]?\d+)', Number.Double), (r'\.\d+([eE][+\-]?\d+)?', Number.Double), + # short_lit + (r'(0|[1-9][0-9]*s)', Number.Integer), + # long_lit + (r'(0|[1-9][0-9]*l)', Number.Integer.Long), # int_lit (r'(0|[1-9][0-9]*)', Number.Integer), - # StringLiteral - # -- interpreted_string_lit + # string_lit (r'"(\\\\|\\[^\\]|[^"\\])*"', String), - # Tokens + # char_lit + (r'\'(\\\\|\\[^\\]|[^\'\\])\'', String.Char), + # tokens (r'(<<=|>>=|<<|>>|<=|>=|\+=|-=|\*=|/=|&&|\|\||&|\||\+\+|--|\%|==|!=|[.]{3}|[+\-*/&])', Operator), (r'[|<>=!()\[\]{}.,;:\?]', Punctuation), - # identifier + # identifiers (r'[^\W\d]\w*', Name.Other), ] } |