diff options
| author | Georg Brandl <georg@python.org> | 2015-01-21 08:33:36 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2015-01-21 08:33:36 +0100 |
| commit | fe72d20b50c75089fa1262b9f03fcb29c9e49282 (patch) | |
| tree | fb249a513bd3e4bde8fdf01c2448df20b1928a53 /pygments/lexers | |
| parent | 13705acbd57b936990c63a12de05ce29834b6afb (diff) | |
| parent | 8cff73f38805fbd29af82fb2aa47956a4a93d22e (diff) | |
| download | pygments-fe72d20b50c75089fa1262b9f03fcb29c9e49282.tar.gz | |
merge with stable
Diffstat (limited to 'pygments/lexers')
| -rw-r--r-- | pygments/lexers/_stan_builtins.py | 33 | ||||
| -rw-r--r-- | pygments/lexers/modeling.py | 4 | ||||
| -rw-r--r-- | pygments/lexers/textfmts.py | 2 | ||||
| -rw-r--r-- | pygments/lexers/theorem.py | 31 |
4 files changed, 38 insertions, 32 deletions
diff --git a/pygments/lexers/_stan_builtins.py b/pygments/lexers/_stan_builtins.py index e276ae29..0a225eba 100644 --- a/pygments/lexers/_stan_builtins.py +++ b/pygments/lexers/_stan_builtins.py @@ -4,7 +4,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This file contains the names of functions for Stan used by - ``pygments.lexers.math.StanLexer. This is for Stan language version 2.4.0. + ``pygments.lexers.math.StanLexer. This is for Stan language version 2.5.0. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. @@ -16,10 +16,12 @@ KEYWORDS = ( 'if', 'in', 'increment_log_prob', + 'integrate_ode', 'lp__', 'print', + 'reject', 'return', - 'while', + 'while' ) TYPES = ( @@ -36,7 +38,7 @@ TYPES = ( 'simplex', 'unit_vector', 'vector', - 'void', + 'void' ) FUNCTIONS = ( @@ -45,6 +47,8 @@ FUNCTIONS = ( 'abs', 'acos', 'acosh', + 'append_col', + 'append_row', 'asin', 'asinh', 'atan', @@ -144,6 +148,11 @@ FUNCTIONS = ( 'fmax', 'fmin', 'fmod', + 'frechet_ccdf_log', + 'frechet_cdf', + 'frechet_cdf_log', + 'frechet_log', + 'frechet_rng', 'gamma_ccdf_log', 'gamma_cdf', 'gamma_cdf_log', @@ -152,6 +161,7 @@ FUNCTIONS = ( 'gamma_q', 'gamma_rng', 'gaussian_dlm_obs_log', + 'get_lp', 'gumbel_ccdf_log', 'gumbel_cdf', 'gumbel_cdf_log', @@ -182,6 +192,8 @@ FUNCTIONS = ( 'inv_wishart_rng', 'inverse', 'inverse_spd', + 'is_inf', + 'is_nan', 'lbeta', 'lgamma', 'lkj_corr_cholesky_log', @@ -252,6 +264,7 @@ FUNCTIONS = ( 'normal_log', 'normal_rng', 'not_a_number', + 'num_elements', 'ordered_logistic_log', 'ordered_logistic_rng', 'owens_t', @@ -260,6 +273,11 @@ FUNCTIONS = ( 'pareto_cdf_log', 'pareto_log', 'pareto_rng', + 'pareto_type_2_ccdf_log', + 'pareto_type_2_cdf', + 'pareto_type_2_cdf_log', + 'pareto_type_2_log', + 'pareto_type_2_rng', 'pi', 'poisson_ccdf_log', 'poisson_cdf', @@ -354,7 +372,7 @@ FUNCTIONS = ( 'weibull_log', 'weibull_rng', 'wishart_log', - 'wishart_rng', + 'wishart_rng' ) DISTRIBUTIONS = ( @@ -372,6 +390,7 @@ DISTRIBUTIONS = ( 'double_exponential', 'exp_mod_normal', 'exponential', + 'frechet', 'gamma', 'gaussian_dlm_obs', 'gumbel', @@ -396,6 +415,7 @@ DISTRIBUTIONS = ( 'normal', 'ordered_logistic', 'pareto', + 'pareto_type_2', 'poisson', 'poisson_log', 'rayleigh', @@ -405,7 +425,7 @@ DISTRIBUTIONS = ( 'uniform', 'von_mises', 'weibull', - 'wishart', + 'wishart' ) RESERVED = ( @@ -494,5 +514,6 @@ RESERVED = ( 'volatile', 'wchar_t', 'xor', - 'xor_eq', + 'xor_eq' ) + diff --git a/pygments/lexers/modeling.py b/pygments/lexers/modeling.py index 1d8bd342..43194436 100644 --- a/pygments/lexers/modeling.py +++ b/pygments/lexers/modeling.py @@ -284,8 +284,8 @@ class StanLexer(RegexLexer): """Pygments Lexer for Stan models. The Stan modeling language is specified in the *Stan Modeling Language - User's Guide and Reference Manual, v2.4.0*, - `pdf <https://github.com/stan-dev/stan/releases/download/v2.4.0/stan-reference-2.4.0.pdf>`__. + User's Guide and Reference Manual, v2.5.0*, + `pdf <https://github.com/stan-dev/stan/releases/download/v2.5.0/stan-reference-2.5.0.pdf>`__. .. versionadded:: 1.6 """ diff --git a/pygments/lexers/textfmts.py b/pygments/lexers/textfmts.py index 8a6872ca..43b16f8c 100644 --- a/pygments/lexers/textfmts.py +++ b/pygments/lexers/textfmts.py @@ -102,7 +102,7 @@ class GettextLexer(RegexLexer): (r'^(")([A-Za-z-]+:)(.*")$', bygroups(String, Name.Property, String)), (r'^".*"$', String), - (r'^(msgid|msgid_plural|msgstr)(\s+)(".*")$', + (r'^(msgid|msgid_plural|msgstr|msgctxt)(\s+)(".*")$', bygroups(Name.Variable, Text, String)), (r'^(msgstr\[)(\d)(\])(\s+)(".*")$', bygroups(Name.Variable, Number.Integer, Name.Variable, Text, String)), diff --git a/pygments/lexers/theorem.py b/pygments/lexers/theorem.py index 0b688b03..9898b05d 100644 --- a/pygments/lexers/theorem.py +++ b/pygments/lexers/theorem.py @@ -395,11 +395,13 @@ class LeanLexer(RegexLexer): 'options', 'precedence', 'postfix', 'prefix', 'calc_trans', 'calc_subst', 'calc_refl', 'infix', 'infixl', 'infixr', 'notation', 'eval', 'check', 'exit', 'coercion', 'end', 'private', 'using', 'namespace', 'including', 'instance', 'section', 'context', - 'protected', 'expose', 'export', 'set_option', 'add_rewrite', 'extends') + 'protected', 'expose', 'export', 'set_option', 'add_rewrite', 'extends', + 'open', 'example', 'constant', 'constants', 'print', 'opaque', 'reducible', 'irreducible' + ) keywords2 = ( - 'forall', 'exists', 'fun', 'Pi', 'obtain', 'from', 'have', 'show', 'assume', 'take', - 'let', 'if', 'else', 'then', 'by', 'in', 'with', 'begin', 'proof', 'qed', 'calc' + 'forall', 'fun', 'Pi', 'obtain', 'from', 'have', 'show', 'assume', 'take', + 'let', 'if', 'else', 'then', 'by', 'in', 'with', 'begin', 'proof', 'qed', 'calc', 'match' ) keywords3 = ( @@ -407,46 +409,29 @@ class LeanLexer(RegexLexer): 'Type', 'Prop', ) - keywords4 = ( - # Tactics - 'apply', 'and_then', 'or_else', 'append', 'interleave', 'par', 'fixpoint', 'repeat', - 'at_most', 'discard', 'focus_at', 'rotate', 'try_for', 'now', 'assumption', 'eassumption', - 'state', 'intro', 'generalize', 'exact', 'unfold', 'beta', 'trace', 'focus', 'repeat1', - 'determ', 'destruct', 'try', 'auto', 'intros' - ) - operators = ( - '!=', '#', '&', '&&', '*', '+', '-', '/', '@', + '!=', '#', '&', '&&', '*', '+', '-', '/', '@', '!', '`', '-.', '->', '.', '..', '...', '::', ':>', ';', ';;', '<', '<-', '=', '==', '>', '_', '`', '|', '||', '~', '=>', '<=', '>=', '/\\', '\\/', u'∀', u'Π', u'λ', u'↔', u'∧', u'∨', u'≠', u'≤', u'≥', - u'¬', u'⁻¹', u'⬝', u'▸', u'→', u'∃', u'ℕ', u'ℤ', u'≈' + u'¬', u'⁻¹', u'⬝', u'▸', u'→', u'∃', u'ℕ', u'ℤ', u'≈', u'×', u'⌞', u'⌟', u'≡' ) - word_operators = ('and', 'or', 'not', 'iff', 'eq') - punctuation = ('(', ')', ':', '{', '}', '[', ']', u'⦃', u'⦄', ':=', ',') - primitives = ('unit', 'int', 'bool', 'string', 'char', 'list', - 'array', 'prod', 'sum', 'pair', 'real', 'nat', 'num', 'path') - tokens = { 'root': [ (r'\s+', Text), - (r'\b(false|true)\b|\(\)|\[\]', Name.Builtin.Pseudo), (r'/-', Comment, 'comment'), (r'--.*?$', Comment.Single), (words(keywords1, prefix=r'\b', suffix=r'\b'), Keyword.Namespace), (words(keywords2, prefix=r'\b', suffix=r'\b'), Keyword), (words(keywords3, prefix=r'\b', suffix=r'\b'), Keyword.Type), - (words(keywords4, prefix=r'\b', suffix=r'\b'), Keyword), (words(operators), Name.Builtin.Pseudo), - (words(word_operators, prefix=r'\b', suffix=r'\b'), Name.Builtin.Pseudo), (words(punctuation), Operator), - (words(primitives, prefix=r'\b', suffix=r'\b'), Keyword.Type), (u"[A-Za-z_\u03b1-\u03ba\u03bc-\u03fb\u1f00-\u1ffe\u2100-\u214f]" u"[A-Za-z_'\u03b1-\u03ba\u03bc-\u03fb\u1f00-\u1ffe\u2070-\u2079" - u"\u207f-\u2089\u2090-\u209c\u2100-\u214f]*", Name), + u"\u207f-\u2089\u2090-\u209c\u2100-\u214f0-9]*", Name), (r'\d+', Number.Integer), (r'"', String.Double, 'string'), (r'[~?][a-z][\w\']*:', Name.Variable) |
