diff options
author | ilezhankin <ilezhankin@yandex-team.ru> | 2022-02-10 16:45:55 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:55 +0300 |
commit | 1d125034f06575234f83f24f08677955133f140e (patch) | |
tree | ec05fbbd61dc118d5de37f206ab978cff58774bd /contrib/python/Pygments/py3/pygments/lexers/trafficscript.py | |
parent | 3a7a498715ef1b66f5054455421b845e45e3a653 (diff) | |
download | ydb-1d125034f06575234f83f24f08677955133f140e.tar.gz |
Restoring authorship annotation for <ilezhankin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/python/Pygments/py3/pygments/lexers/trafficscript.py')
-rw-r--r-- | contrib/python/Pygments/py3/pygments/lexers/trafficscript.py | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/contrib/python/Pygments/py3/pygments/lexers/trafficscript.py b/contrib/python/Pygments/py3/pygments/lexers/trafficscript.py index 67ecd243cb..89c9e90085 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/trafficscript.py +++ b/contrib/python/Pygments/py3/pygments/lexers/trafficscript.py @@ -1,51 +1,51 @@ -""" - pygments.lexers.trafficscript - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Lexer for RiverBed's TrafficScript (RTS) language. - +""" + pygments.lexers.trafficscript + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lexer for RiverBed's TrafficScript (RTS) language. + :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -from pygments.lexer import RegexLexer -from pygments.token import String, Number, Name, Keyword, Operator, Text, Comment - -__all__ = ['RtsLexer'] - - -class RtsLexer(RegexLexer): - """ - For `Riverbed Stingray Traffic Manager <http://www.riverbed.com/stingray>`_ - - .. versionadded:: 2.1 - """ - name = 'TrafficScript' + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer +from pygments.token import String, Number, Name, Keyword, Operator, Text, Comment + +__all__ = ['RtsLexer'] + + +class RtsLexer(RegexLexer): + """ + For `Riverbed Stingray Traffic Manager <http://www.riverbed.com/stingray>`_ + + .. versionadded:: 2.1 + """ + name = 'TrafficScript' aliases = ['trafficscript', 'rts'] - filenames = ['*.rts'] - - tokens = { - 'root' : [ - (r"'(\\\\|\\[^\\]|[^'\\])*'", String), - (r'"', String, 'escapable-string'), - (r'(0x[0-9a-fA-F]+|\d+)', Number), - (r'\d+\.\d+', Number.Float), - (r'\$[a-zA-Z](\w|_)*', Name.Variable), - (r'(if|else|for(each)?|in|while|do|break|sub|return|import)', Keyword), - (r'[a-zA-Z][\w.]*', Name.Function), - (r'[-+*/%=,;(){}<>^.!~|&\[\]\?\:]', Operator), - (r'(>=|<=|==|!=|' - r'&&|\|\||' - r'\+=|.=|-=|\*=|/=|%=|<<=|>>=|&=|\|=|\^=|' - r'>>|<<|' - r'\+\+|--|=>)', Operator), - (r'[ \t\r]+', Text), - (r'#[^\n]*', Comment), - ], - 'escapable-string' : [ - (r'\\[tsn]', String.Escape), - (r'[^"]', String), - (r'"', String, '#pop'), - ], - - } + filenames = ['*.rts'] + + tokens = { + 'root' : [ + (r"'(\\\\|\\[^\\]|[^'\\])*'", String), + (r'"', String, 'escapable-string'), + (r'(0x[0-9a-fA-F]+|\d+)', Number), + (r'\d+\.\d+', Number.Float), + (r'\$[a-zA-Z](\w|_)*', Name.Variable), + (r'(if|else|for(each)?|in|while|do|break|sub|return|import)', Keyword), + (r'[a-zA-Z][\w.]*', Name.Function), + (r'[-+*/%=,;(){}<>^.!~|&\[\]\?\:]', Operator), + (r'(>=|<=|==|!=|' + r'&&|\|\||' + r'\+=|.=|-=|\*=|/=|%=|<<=|>>=|&=|\|=|\^=|' + r'>>|<<|' + r'\+\+|--|=>)', Operator), + (r'[ \t\r]+', Text), + (r'#[^\n]*', Comment), + ], + 'escapable-string' : [ + (r'\\[tsn]', String.Escape), + (r'[^"]', String), + (r'"', String, '#pop'), + ], + + } |