diff options
author | orivej <orivej@yandex-team.ru> | 2022-02-10 16:45:01 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:01 +0300 |
commit | 2d37894b1b037cf24231090eda8589bbb44fb6fc (patch) | |
tree | be835aa92c6248212e705f25388ebafcf84bc7a1 /contrib/python/Pygments/py2/pygments/lexers/ampl.py | |
parent | 718c552901d703c502ccbefdfc3c9028d608b947 (diff) | |
download | ydb-2d37894b1b037cf24231090eda8589bbb44fb6fc.tar.gz |
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/python/Pygments/py2/pygments/lexers/ampl.py')
-rw-r--r-- | contrib/python/Pygments/py2/pygments/lexers/ampl.py | 174 |
1 files changed, 87 insertions, 87 deletions
diff --git a/contrib/python/Pygments/py2/pygments/lexers/ampl.py b/contrib/python/Pygments/py2/pygments/lexers/ampl.py index d834925e47..21e7847f40 100644 --- a/contrib/python/Pygments/py2/pygments/lexers/ampl.py +++ b/contrib/python/Pygments/py2/pygments/lexers/ampl.py @@ -1,87 +1,87 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.ampl - ~~~~~~~~~~~~~~~~~~~~ - - Lexers for the AMPL language. - - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -from pygments.lexer import RegexLexer, bygroups, using, this, words -from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ - Number, Punctuation - -__all__ = ['AmplLexer'] - - -class AmplLexer(RegexLexer): - """ - For `AMPL <http://ampl.com/>`_ source code. - - .. versionadded:: 2.2 - """ - name = 'Ampl' - aliases = ['ampl'] - filenames = ['*.run'] - - tokens = { - 'root': [ - (r'\n', Text), - (r'\s+', Text.Whitespace), - (r'#.*?\n', Comment.Single), - (r'/[*](.|\n)*?[*]/', Comment.Multiline), - (words(( - 'call', 'cd', 'close', 'commands', 'data', 'delete', 'display', - 'drop', 'end', 'environ', 'exit', 'expand', 'include', 'load', - 'model', 'objective', 'option', 'problem', 'purge', 'quit', - 'redeclare', 'reload', 'remove', 'reset', 'restore', 'shell', - 'show', 'solexpand', 'solution', 'solve', 'update', 'unload', - 'xref', 'coeff', 'coef', 'cover', 'obj', 'interval', 'default', - 'from', 'to', 'to_come', 'net_in', 'net_out', 'dimen', - 'dimension', 'check', 'complements', 'write', 'function', - 'pipe', 'format', 'if', 'then', 'else', 'in', 'while', 'repeat', - 'for'), suffix=r'\b'), Keyword.Reserved), - (r'(integer|binary|symbolic|ordered|circular|reversed|INOUT|IN|OUT|LOCAL)', - Keyword.Type), - (r'\".*?\"', String.Double), - (r'\'.*?\'', String.Single), - (r'[()\[\]{},;:]+', Punctuation), - (r'\b(\w+)(\.)(astatus|init0|init|lb0|lb1|lb2|lb|lrc|' - r'lslack|rc|relax|slack|sstatus|status|ub0|ub1|ub2|' - r'ub|urc|uslack|val)', - bygroups(Name.Variable, Punctuation, Keyword.Reserved)), - (r'(set|param|var|arc|minimize|maximize|subject to|s\.t\.|subj to|' - r'node|table|suffix|read table|write table)(\s+)(\w+)', - bygroups(Keyword.Declaration, Text, Name.Variable)), - (r'(param)(\s*)(:)(\s*)(\w+)(\s*)(:)(\s*)((\w|\s)+)', - bygroups(Keyword.Declaration, Text, Punctuation, Text, - Name.Variable, Text, Punctuation, Text, Name.Variable)), - (r'(let|fix|unfix)(\s*)((?:\{.*\})?)(\s*)(\w+)', - bygroups(Keyword.Declaration, Text, using(this), Text, Name.Variable)), - (words(( - 'abs', 'acos', 'acosh', 'alias', 'asin', 'asinh', 'atan', 'atan2', - 'atanh', 'ceil', 'ctime', 'cos', 'exp', 'floor', 'log', 'log10', - 'max', 'min', 'precision', 'round', 'sin', 'sinh', 'sqrt', 'tan', - 'tanh', 'time', 'trunc', 'Beta', 'Cauchy', 'Exponential', 'Gamma', - 'Irand224', 'Normal', 'Normal01', 'Poisson', 'Uniform', 'Uniform01', - 'num', 'num0', 'ichar', 'char', 'length', 'substr', 'sprintf', - 'match', 'sub', 'gsub', 'print', 'printf', 'next', 'nextw', 'prev', - 'prevw', 'first', 'last', 'ord', 'ord0', 'card', 'arity', - 'indexarity'), prefix=r'\b', suffix=r'\b'), Name.Builtin), - (r'(\+|\-|\*|/|\*\*|=|<=|>=|==|\||\^|<|>|\!|\.\.|:=|\&|\!=|<<|>>)', - Operator), - (words(( - 'or', 'exists', 'forall', 'and', 'in', 'not', 'within', 'union', - 'diff', 'difference', 'symdiff', 'inter', 'intersect', - 'intersection', 'cross', 'setof', 'by', 'less', 'sum', 'prod', - 'product', 'div', 'mod'), suffix=r'\b'), - Keyword.Reserved), # Operator.Name but not enough emphasized with that - (r'(\d+\.(?!\.)\d*|\.(?!.)\d+)([eE][+-]?\d+)?', Number.Float), - (r'\d+([eE][+-]?\d+)?', Number.Integer), - (r'[+-]?Infinity', Number.Integer), - (r'(\w+|(\.(?!\.)))', Text) - ] - - } +# -*- coding: utf-8 -*- +""" + pygments.lexers.ampl + ~~~~~~~~~~~~~~~~~~~~ + + Lexers for the AMPL language. + + :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, bygroups, using, this, words +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation + +__all__ = ['AmplLexer'] + + +class AmplLexer(RegexLexer): + """ + For `AMPL <http://ampl.com/>`_ source code. + + .. versionadded:: 2.2 + """ + name = 'Ampl' + aliases = ['ampl'] + filenames = ['*.run'] + + tokens = { + 'root': [ + (r'\n', Text), + (r'\s+', Text.Whitespace), + (r'#.*?\n', Comment.Single), + (r'/[*](.|\n)*?[*]/', Comment.Multiline), + (words(( + 'call', 'cd', 'close', 'commands', 'data', 'delete', 'display', + 'drop', 'end', 'environ', 'exit', 'expand', 'include', 'load', + 'model', 'objective', 'option', 'problem', 'purge', 'quit', + 'redeclare', 'reload', 'remove', 'reset', 'restore', 'shell', + 'show', 'solexpand', 'solution', 'solve', 'update', 'unload', + 'xref', 'coeff', 'coef', 'cover', 'obj', 'interval', 'default', + 'from', 'to', 'to_come', 'net_in', 'net_out', 'dimen', + 'dimension', 'check', 'complements', 'write', 'function', + 'pipe', 'format', 'if', 'then', 'else', 'in', 'while', 'repeat', + 'for'), suffix=r'\b'), Keyword.Reserved), + (r'(integer|binary|symbolic|ordered|circular|reversed|INOUT|IN|OUT|LOCAL)', + Keyword.Type), + (r'\".*?\"', String.Double), + (r'\'.*?\'', String.Single), + (r'[()\[\]{},;:]+', Punctuation), + (r'\b(\w+)(\.)(astatus|init0|init|lb0|lb1|lb2|lb|lrc|' + r'lslack|rc|relax|slack|sstatus|status|ub0|ub1|ub2|' + r'ub|urc|uslack|val)', + bygroups(Name.Variable, Punctuation, Keyword.Reserved)), + (r'(set|param|var|arc|minimize|maximize|subject to|s\.t\.|subj to|' + r'node|table|suffix|read table|write table)(\s+)(\w+)', + bygroups(Keyword.Declaration, Text, Name.Variable)), + (r'(param)(\s*)(:)(\s*)(\w+)(\s*)(:)(\s*)((\w|\s)+)', + bygroups(Keyword.Declaration, Text, Punctuation, Text, + Name.Variable, Text, Punctuation, Text, Name.Variable)), + (r'(let|fix|unfix)(\s*)((?:\{.*\})?)(\s*)(\w+)', + bygroups(Keyword.Declaration, Text, using(this), Text, Name.Variable)), + (words(( + 'abs', 'acos', 'acosh', 'alias', 'asin', 'asinh', 'atan', 'atan2', + 'atanh', 'ceil', 'ctime', 'cos', 'exp', 'floor', 'log', 'log10', + 'max', 'min', 'precision', 'round', 'sin', 'sinh', 'sqrt', 'tan', + 'tanh', 'time', 'trunc', 'Beta', 'Cauchy', 'Exponential', 'Gamma', + 'Irand224', 'Normal', 'Normal01', 'Poisson', 'Uniform', 'Uniform01', + 'num', 'num0', 'ichar', 'char', 'length', 'substr', 'sprintf', + 'match', 'sub', 'gsub', 'print', 'printf', 'next', 'nextw', 'prev', + 'prevw', 'first', 'last', 'ord', 'ord0', 'card', 'arity', + 'indexarity'), prefix=r'\b', suffix=r'\b'), Name.Builtin), + (r'(\+|\-|\*|/|\*\*|=|<=|>=|==|\||\^|<|>|\!|\.\.|:=|\&|\!=|<<|>>)', + Operator), + (words(( + 'or', 'exists', 'forall', 'and', 'in', 'not', 'within', 'union', + 'diff', 'difference', 'symdiff', 'inter', 'intersect', + 'intersection', 'cross', 'setof', 'by', 'less', 'sum', 'prod', + 'product', 'div', 'mod'), suffix=r'\b'), + Keyword.Reserved), # Operator.Name but not enough emphasized with that + (r'(\d+\.(?!\.)\d*|\.(?!.)\d+)([eE][+-]?\d+)?', Number.Float), + (r'\d+([eE][+-]?\d+)?', Number.Integer), + (r'[+-]?Infinity', Number.Integer), + (r'(\w+|(\.(?!\.)))', Text) + ] + + } |