diff options
author | orivej <orivej@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
commit | 718c552901d703c502ccbefdfc3c9028d608b947 (patch) | |
tree | 46534a98bbefcd7b1f3faa5b52c138ab27db75b7 /contrib/python/Pygments/py2/pygments/lexers/rnc.py | |
parent | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (diff) | |
download | ydb-718c552901d703c502ccbefdfc3c9028d608b947.tar.gz |
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/python/Pygments/py2/pygments/lexers/rnc.py')
-rw-r--r-- | contrib/python/Pygments/py2/pygments/lexers/rnc.py | 134 |
1 files changed, 67 insertions, 67 deletions
diff --git a/contrib/python/Pygments/py2/pygments/lexers/rnc.py b/contrib/python/Pygments/py2/pygments/lexers/rnc.py index 8f0ba5cf31..03c6ea7b2a 100644 --- a/contrib/python/Pygments/py2/pygments/lexers/rnc.py +++ b/contrib/python/Pygments/py2/pygments/lexers/rnc.py @@ -1,67 +1,67 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.rnc - ~~~~~~~~~~~~~~~~~~~ - - Lexer for Relax-NG Compact syntax - - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -from pygments.lexer import RegexLexer -from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ - Punctuation - -__all__ = ['RNCCompactLexer'] - - -class RNCCompactLexer(RegexLexer): - """ - For `RelaxNG-compact <http://relaxng.org>`_ syntax. - - .. versionadded:: 2.2 - """ - - name = 'Relax-NG Compact' - aliases = ['rnc', 'rng-compact'] - filenames = ['*.rnc'] - - tokens = { - 'root': [ - (r'namespace\b', Keyword.Namespace), - (r'(?:default|datatypes)\b', Keyword.Declaration), - (r'##.*$', Comment.Preproc), - (r'#.*$', Comment.Single), - (r'"[^"]*"', String.Double), - # TODO single quoted strings and escape sequences outside of - # double-quoted strings - (r'(?:element|attribute|mixed)\b', Keyword.Declaration, 'variable'), - (r'(text\b|xsd:[^ ]+)', Keyword.Type, 'maybe_xsdattributes'), - (r'[,?&*=|~]|>>', Operator), - (r'[(){}]', Punctuation), - (r'.', Text), - ], - - # a variable has been declared using `element` or `attribute` - 'variable': [ - (r'[^{]+', Name.Variable), - (r'\{', Punctuation, '#pop'), - ], - - # after an xsd:<datatype> declaration there may be attributes - 'maybe_xsdattributes': [ - (r'\{', Punctuation, 'xsdattributes'), - (r'\}', Punctuation, '#pop'), - (r'.', Text), - ], - - # attributes take the form { key1 = value1 key2 = value2 ... } - 'xsdattributes': [ - (r'[^ =}]', Name.Attribute), - (r'=', Operator), - (r'"[^"]*"', String.Double), - (r'\}', Punctuation, '#pop'), - (r'.', Text), - ], - } +# -*- coding: utf-8 -*- +""" + pygments.lexers.rnc + ~~~~~~~~~~~~~~~~~~~ + + Lexer for Relax-NG Compact syntax + + :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Punctuation + +__all__ = ['RNCCompactLexer'] + + +class RNCCompactLexer(RegexLexer): + """ + For `RelaxNG-compact <http://relaxng.org>`_ syntax. + + .. versionadded:: 2.2 + """ + + name = 'Relax-NG Compact' + aliases = ['rnc', 'rng-compact'] + filenames = ['*.rnc'] + + tokens = { + 'root': [ + (r'namespace\b', Keyword.Namespace), + (r'(?:default|datatypes)\b', Keyword.Declaration), + (r'##.*$', Comment.Preproc), + (r'#.*$', Comment.Single), + (r'"[^"]*"', String.Double), + # TODO single quoted strings and escape sequences outside of + # double-quoted strings + (r'(?:element|attribute|mixed)\b', Keyword.Declaration, 'variable'), + (r'(text\b|xsd:[^ ]+)', Keyword.Type, 'maybe_xsdattributes'), + (r'[,?&*=|~]|>>', Operator), + (r'[(){}]', Punctuation), + (r'.', Text), + ], + + # a variable has been declared using `element` or `attribute` + 'variable': [ + (r'[^{]+', Name.Variable), + (r'\{', Punctuation, '#pop'), + ], + + # after an xsd:<datatype> declaration there may be attributes + 'maybe_xsdattributes': [ + (r'\{', Punctuation, 'xsdattributes'), + (r'\}', Punctuation, '#pop'), + (r'.', Text), + ], + + # attributes take the form { key1 = value1 key2 = value2 ... } + 'xsdattributes': [ + (r'[^ =}]', Name.Attribute), + (r'=', Operator), + (r'"[^"]*"', String.Double), + (r'\}', Punctuation, '#pop'), + (r'.', Text), + ], + } |