aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/Pygments/py3/pygments/lexers/modeling.py
diff options
context:
space:
mode:
authorarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-06-09 14:39:19 +0300
committerarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-06-09 14:39:19 +0300
commitc04b663c7bb4b750deeb8f48f620497ec13da8fa (patch)
tree151ebc8bfdd2ad918caf5e6e2d8013e14272ddf8 /contrib/python/Pygments/py3/pygments/lexers/modeling.py
parent0d55ca22c507d18c2f35718687e0b06d9915397b (diff)
downloadydb-c04b663c7bb4b750deeb8f48f620497ec13da8fa.tar.gz
intermediate changes
ref:2d4f292087954c9344efdabb7b2a67f466263c65
Diffstat (limited to 'contrib/python/Pygments/py3/pygments/lexers/modeling.py')
-rw-r--r--contrib/python/Pygments/py3/pygments/lexers/modeling.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/contrib/python/Pygments/py3/pygments/lexers/modeling.py b/contrib/python/Pygments/py3/pygments/lexers/modeling.py
index b00a7f10b3..56448f5036 100644
--- a/contrib/python/Pygments/py3/pygments/lexers/modeling.py
+++ b/contrib/python/Pygments/py3/pygments/lexers/modeling.py
@@ -4,7 +4,7 @@
Lexers for modeling languages.
- :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
+ :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
@@ -22,11 +22,12 @@ __all__ = ['ModelicaLexer', 'BugsLexer', 'JagsLexer', 'StanLexer']
class ModelicaLexer(RegexLexer):
"""
- For `Modelica <http://www.modelica.org/>`_ source code.
+ For Modelica source code.
.. versionadded:: 1.1
"""
name = 'Modelica'
+ url = 'http://www.modelica.org/'
aliases = ['modelica']
filenames = ['*.mo']
mimetypes = ['text/x-modelica']
@@ -97,7 +98,7 @@ class ModelicaLexer(RegexLexer):
class BugsLexer(RegexLexer):
"""
- Pygments Lexer for `OpenBugs <http://www.openbugs.net/>`_ and WinBugs
+ Pygments Lexer for OpenBugs and WinBugs
models.
.. versionadded:: 1.6
@@ -303,7 +304,6 @@ class StanLexer(RegexLexer):
(r'(//|#).*$', Comment.Single),
],
'root': [
- # Stan is more restrictive on strings than this regex
(r'"[^"]*"', String),
# Comments
include('comments'),
@@ -325,7 +325,7 @@ class StanLexer(RegexLexer):
(r'(%s)\b' % r'|'.join(_stan_builtins.TYPES), Keyword.Type),
# < should be punctuation, but elsewhere I can't tell if it is in
# a range constraint
- (r'(<)(\s*)(upper|lower)(\s*)(=)',
+ (r'(<)(\s*)(upper|lower|offset|multiplier)(\s*)(=)',
bygroups(Operator, Whitespace, Keyword, Whitespace, Punctuation)),
(r'(,)(\s*)(upper)(\s*)(=)',
bygroups(Punctuation, Whitespace, Keyword, Whitespace, Punctuation)),
@@ -340,17 +340,21 @@ class StanLexer(RegexLexer):
(r'(%s)\b' % r'|'.join(_stan_builtins.RESERVED), Keyword.Reserved),
# user-defined functions
(r'[A-Za-z]\w*(?=\s*\()]', Name.Function),
- # Regular variable names
- (r'[A-Za-z]\w*\b', Name),
+ # Imaginary Literals
+ (r'[0-9]+(\.[0-9]*)?([eE][+-]?[0-9]+)?i', Number.Float),
+ (r'\.[0-9]+([eE][+-]?[0-9]+)?i', Number.Float),
+ (r'[0-9]+i', Number.Float),
# Real Literals
(r'[0-9]+(\.[0-9]*)?([eE][+-]?[0-9]+)?', Number.Float),
(r'\.[0-9]+([eE][+-]?[0-9]+)?', Number.Float),
# Integer Literals
(r'[0-9]+', Number.Integer),
+ # Regular variable names
+ (r'[A-Za-z]\w*\b', Name),
# Assignment operators
(r'<-|(?:\+|-|\.?/|\.?\*|=)?=|~', Operator),
# Infix, prefix and postfix operators (and = )
- (r"\+|-|\.?\*|\.?/|\\|'|\^|!=?|<=?|>=?|\|\||&&|%|\?|:", Operator),
+ (r"\+|-|\.?\*|\.?/|\\|'|\.?\^|!=?|<=?|>=?|\|\||&&|%|\?|:|%/%|!", Operator),
# Block delimiters
(r'[{}]', Punctuation),
# Distribution |