diff options
author | monster <[email protected]> | 2022-07-07 14:41:37 +0300 |
---|---|---|
committer | monster <[email protected]> | 2022-07-07 14:41:37 +0300 |
commit | 06e5c21a835c0e923506c4ff27929f34e00761c2 (patch) | |
tree | 75efcbc6854ef9bd476eb8bf00cc5c900da436a2 /contrib/python/Pygments/py3/pygments/lexers/bare.py | |
parent | 03f024c4412e3aa613bb543cf1660176320ba8f4 (diff) |
fix ya.make
Diffstat (limited to 'contrib/python/Pygments/py3/pygments/lexers/bare.py')
-rw-r--r-- | contrib/python/Pygments/py3/pygments/lexers/bare.py | 102 |
1 files changed, 0 insertions, 102 deletions
diff --git a/contrib/python/Pygments/py3/pygments/lexers/bare.py b/contrib/python/Pygments/py3/pygments/lexers/bare.py deleted file mode 100644 index c1d183370f7..00000000000 --- a/contrib/python/Pygments/py3/pygments/lexers/bare.py +++ /dev/null @@ -1,102 +0,0 @@ -""" - pygments.lexers.bare - ~~~~~~~~~~~~~~~~~~~~ - - Lexer for the BARE schema. - - :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re - -from pygments.lexer import RegexLexer, words, bygroups -from pygments.token import Text, Comment, Keyword, Name, Literal, Whitespace - -__all__ = ['BareLexer'] - - -class BareLexer(RegexLexer): - """ - For BARE schema source. - - .. versionadded:: 2.7 - """ - name = 'BARE' - url = 'https://baremessages.org' - filenames = ['*.bare'] - aliases = ['bare'] - - keywords = [ - 'type', - 'enum', - 'u8', - 'u16', - 'u32', - 'u64', - 'uint', - 'i8', - 'i16', - 'i32', - 'i64', - 'int', - 'f32', - 'f64', - 'bool', - 'void', - 'data', - 'string', - 'optional', - 'map', - ] - - tokens = { - 'root': [ - (r'(type)(\s+)([A-Z][a-zA-Z0-9]+)(\s+)(\{)', - bygroups(Keyword, Whitespace, Name.Class, Whitespace, Text), 'struct'), - (r'(type)(\s+)([A-Z][a-zA-Z0-9]+)(\s+)(\()', - bygroups(Keyword, Whitespace, Name.Class, Whitespace, Text), 'union'), - (r'(type)(\s+)([A-Z][a-zA-Z0-9]+)(\s+)', - bygroups(Keyword, Whitespace, Name, Whitespace), 'typedef'), - (r'(enum)(\s+)([A-Z][a-zA-Z0-9]+)(\s+\{)', - bygroups(Keyword, Whitespace, Name.Class, Whitespace), 'enum'), - (r'#.*?$', Comment), - (r'\s+', Whitespace), - ], - 'struct': [ - (r'\{', Text, '#push'), - (r'\}', Text, '#pop'), - (r'([a-zA-Z0-9]+)(:)(\s*)', bygroups(Name.Attribute, Text, Whitespace), 'typedef'), - (r'\s+', Whitespace), - ], - 'union': [ - (r'\)', Text, '#pop'), - (r'(\s*)(\|)(\s*)', bygroups(Whitespace, Text, Whitespace)), - (r'[A-Z][a-zA-Z0-9]+', Name.Class), - (words(keywords), Keyword), - (r'\s+', Whitespace), - ], - 'typedef': [ - (r'\[\]', Text), - (r'#.*?$', Comment, '#pop'), - (r'(\[)(\d+)(\])', bygroups(Text, Literal, Text)), - (r'<|>', Text), - (r'\(', Text, 'union'), - (r'(\[)([a-z][a-z-A-Z0-9]+)(\])', bygroups(Text, Keyword, Text)), - (r'(\[)([A-Z][a-z-A-Z0-9]+)(\])', bygroups(Text, Name.Class, Text)), - (r'([A-Z][a-z-A-Z0-9]+)', Name.Class), - (words(keywords), Keyword), - (r'\n', Text, '#pop'), - (r'\{', Text, 'struct'), - (r'\s+', Whitespace), - (r'\d+', Literal), - ], - 'enum': [ - (r'\{', Text, '#push'), - (r'\}', Text, '#pop'), - (r'([A-Z][A-Z0-9_]*)(\s*=\s*)(\d+)', bygroups(Name.Attribute, Text, Literal)), - (r'([A-Z][A-Z0-9_]*)', bygroups(Name.Attribute)), - (r'#.*?$', Comment), - (r'\s+', Whitespace), - ], - } |