diff options
author | nkozlovskiy <nmk@ydb.tech> | 2023-09-29 12:24:06 +0300 |
---|---|---|
committer | nkozlovskiy <nmk@ydb.tech> | 2023-09-29 12:41:34 +0300 |
commit | e0e3e1717e3d33762ce61950504f9637a6e669ed (patch) | |
tree | bca3ff6939b10ed60c3d5c12439963a1146b9711 /contrib/python/Pygments/py3/pygments/lexers/tlb.py | |
parent | 38f2c5852db84c7b4d83adfcb009eb61541d1ccd (diff) | |
download | ydb-e0e3e1717e3d33762ce61950504f9637a6e669ed.tar.gz |
add ydb deps
Diffstat (limited to 'contrib/python/Pygments/py3/pygments/lexers/tlb.py')
-rw-r--r-- | contrib/python/Pygments/py3/pygments/lexers/tlb.py | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/contrib/python/Pygments/py3/pygments/lexers/tlb.py b/contrib/python/Pygments/py3/pygments/lexers/tlb.py new file mode 100644 index 0000000000..ac629dc848 --- /dev/null +++ b/contrib/python/Pygments/py3/pygments/lexers/tlb.py @@ -0,0 +1,57 @@ +""" + pygments.lexers.tlb + ~~~~~~~~~~~~~~~~~~~ + + Lexers for TL-b. + + :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, include, words +from pygments.token import Operator, Name, \ + Number, Whitespace, Punctuation, Comment + +__all__ = ['TlbLexer'] + + +class TlbLexer(RegexLexer): + """ + For TL-b source code. + """ + + name = 'Tl-b' + aliases = ['tlb'] + filenames = ['*.tlb'] + + tokens = { + 'root': [ + (r'\s+', Whitespace), + + include('comments'), + + (r'[0-9]+', Number), + (words(( + '+', '-', '*', '=', '?', '~', '.', + '^', '==', '<', '>', '<=', '>=', '!=' + )), Operator), + (words(('##', '#<', '#<=')), Name.Tag), + (r'#[0-9a-f]*_?', Name.Tag), + (r'\$[01]*_?', Name.Tag), + + (r'[a-zA-Z_][0-9a-zA-Z_]*', Name), + + (r'[;():\[\]{}]', Punctuation) + ], + + 'comments': [ + (r'//.*', Comment.Singleline), + (r'/\*', Comment.Multiline, 'comment'), + ], + 'comment': [ + (r'[^/*]+', Comment.Multiline), + (r'/\*', Comment.Multiline, '#push'), + (r'\*/', Comment.Multiline, '#pop'), + (r'[*/]', Comment.Multiline), + ], + } |