Commits

Jeffrey Arnold committed 343725a

updating StanLexer to Stan 1.1.1

Comments (0)

Files changed (2)

pygments/lexers/_stan_builtins.py

 # -*- coding: utf-8 -*-
 """
-    pygments.lexers._stan_builtins
-    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+pygments.lexers._stan_builtins
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-    This file contains the names of functions for Stan used by
-    ``pygments.lexers.math.StanLexer.
+This file contains the names of functions for Stan used by
+``pygments.lexers.math.StanLexer.
 
-    :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
-    :license: BSD, see LICENSE for details.
+:copyright: Copyright 2013 by the Pygments team, see AUTHORS.
+:license: BSD, see LICENSE for details.
 """
 
-CONSTANTS = [   'e',
-    'epsilon',
-    'log10',
-    'log2',
-    'negative_epsilon',
-    'negative_infinity',
-    'not_a_number',
-    'pi',
-    'positive_infinity',
-    'sqrt2']
+CONSTANTS=[   u'e',
+    u'epsilon',
+    u'log10',
+    u'log2',
+    u'negative_epsilon',
+    u'negative_infinity',
+    u'not_a_number',
+    u'pi',
+    u'positive_infinity',
+    u'sqrt2']
 
-FUNCTIONS = [   'Phi',
-    'abs',
-    'acos',
-    'acosh',
-    'asin',
-    'asinh',
-    'atan',
-    'atan2',
-    'atanh',
-    'bernoulli_log',
-    'beta_binomial_log',
-    'beta_log',
-    'binary_log_loss',
-    'binomial_coefficient_log',
-    'block',
-    'categorical_log',
-    'cauchy_log',
-    'cbrt',
-    'ceil',
-    'chi_square_log',
-    'cholesky_decompose',
-    'col',
-    'cols',
-    'cos',
-    'cosh',
-    'cumulative_sum',
-    'determinant',
-    'diag_matrix',
-    'diagonal',
-    'dirichlet_log',
-    'dot_product',
-    'dot_self',
-    'double_exponential_log',
-    'eigenvalues',
-    'eigenvalues_sym',
-    'erf',
-    'erfc',
-    'exp',
-    'exp2',
-    'expm1',
-    'exponential_cdf',
-    'exponential_log',
-    'fabs',
-    'fdim',
-    'floor',
-    'fma',
-    'fmax',
-    'fmin',
-    'fmod',
-    'gamma_log',
-    'hypergeometric_log',
-    'hypot',
-    'if_else',
-    'int_step',
-    'inv_chi_square_log',
-    'inv_cloglog',
-    'inv_gamma_log',
-    'inv_logit',
-    'inv_wishart_log',
-    'inverse',
-    'lbeta',
-    'lgamma',
-    'lkj_corr_cholesky_log',
-    'lkj_corr_log',
-    'lkj_cov_log',
-    'lmgamma',
-    'log',
-    'log10',
-    'log1m',
-    'log1p',
-    'log1p_exp',
-    'log2',
-    'log_inv_logit',
-    'log1m_inv_logit',
-    'log_sum_exp',
-    'logistic_log',
-    'logit',
-    'lognormal_cdf',
-    'lognormal_log',
-    'max',
-    'mdivide_left_tri_low',
-    'mdivide_right_tri_low',
-    'mean',
-    'min',
-    'multi_normal_cholesky_log',
-    'multi_normal_log',
-    'multi_student_t_log',
-    'multinomial_log',
-    'multiply_log',
-    'multiply_lower_tri_self_transpose',
-    'neg_binomial_log',
-    'normal_cdf',
-    'normal_log',
-    'ordered_logistic_log',
-    'pareto_log',
-    'poisson_log',
-    'poisson_log_log',
-    'pow',
-    'prod',
-    'round',
-    'row',
-    'rows',
-    'scaled_inv_chi_square_log',
-    'sd',
-    'sin',
-    'singular_values',
-    'sinh',
-    'softmax',
-    'sqrt',
-    'square',
-    'step',
-    'student_t_log',
-    'sum',
-    'tan',
-    'tanh',
-    'tgamma',
-    'trace',
-    'trunc',
-    'uniform_log',
-    'variance',
-    'weibull_cdf',
-    'weibull_log',
-    'wishart_log']
+FUNCTIONS=[   u'Phi',
+    u'Phi_approx',
+    u'abs',
+    u'acos',
+    u'acosh',
+    u'asin',
+    u'asinh',
+    u'atan',
+    u'atan2',
+    u'atanh',
+    u'bernoulli_log',
+    u'bernoulli_logit_log',
+    u'beta_binomial_log',
+    u'beta_log',
+    u'binary_log_loss',
+    u'binomial_coefficient_log',
+    u'binomial_log',
+    u'binomial_logit_log',
+    u'block',
+    u'categorical_log',
+    u'cauchy_log',
+    u'cbrt',
+    u'ceil',
+    u'chi_square_log',
+    u'cholesky_decompose',
+    u'col',
+    u'cols',
+    u'cos',
+    u'cosh',
+    u'crossprod',
+    u'cumulative_sum',
+    u'determinant',
+    u'diag_matrix',
+    u'diag_post_multiply',
+    u'diag_pre_multiply',
+    u'diagonal',
+    u'dims',
+    u'dirichlet_log',
+    u'dot_product',
+    u'dot_self',
+    u'double_exponential_log',
+    u'eigenvalues_sym',
+    u'eigenvectors_sym',
+    u'erf',
+    u'erfc',
+    u'exp',
+    u'exp2',
+    u'expm1',
+    u'exponential_cdf',
+    u'exponential_log',
+    u'fabs',
+    u'fdim',
+    u'floor',
+    u'fma',
+    u'fmax',
+    u'fmin',
+    u'fmod',
+    u'gamma_log',
+    u'hypergeometric_log',
+    u'hypot',
+    u'if_else',
+    u'int_step',
+    u'inv_chi_square_log',
+    u'inv_cloglog',
+    u'inv_gamma_log',
+    u'inv_logit',
+    u'inv_wishart_log',
+    u'inverse',
+    u'lbeta',
+    u'lgamma',
+    u'lkj_corr_cholesky_log',
+    u'lkj_corr_log',
+    u'lkj_cov_log',
+    u'lmgamma',
+    u'log',
+    u'log1m',
+    u'log1m_inv_logit',
+    u'log1p',
+    u'log1p_exp',
+    u'log_determinant',
+    u'log_inv_logit',
+    u'log_sum_exp',
+    u'logistic_log',
+    u'logit',
+    u'lognormal_cdf',
+    u'lognormal_log',
+    u'max',
+    u'mdivide_left_tri_low',
+    u'mdivide_right_tri_low',
+    u'mean',
+    u'min',
+    u'multi_normal_cholesky_log',
+    u'multi_normal_log',
+    u'multi_normal_prec_log',
+    u'multi_student_t_log',
+    u'multinomial_log',
+    u'multiply_log',
+    u'multiply_lower_tri_self_transpose',
+    u'neg_binomial_log',
+    u'normal_cdf',
+    u'normal_log',
+    u'ordered_logistic_log',
+    u'pareto_log',
+    u'poisson_log',
+    u'poisson_log_log',
+    u'pow',
+    u'prod',
+    u'round',
+    u'row',
+    u'rows',
+    u'scaled_inv_chi_square_log',
+    u'sd',
+    u'sin',
+    u'singular_values',
+    u'sinh',
+    u'size',
+    u'softmax',
+    u'sqrt',
+    u'square',
+    u'step',
+    u'student_t_log',
+    u'sum',
+    u'tan',
+    u'tanh',
+    u'tcrossprod',
+    u'tgamma',
+    u'trace',
+    u'trunc',
+    u'uniform_log',
+    u'variance',
+    u'weibull_cdf',
+    u'weibull_log',
+    u'wishart_log']
 
-DISTRIBUTIONS = [   'bernoulli',
-    'beta',
-    'beta_binomial',
-    'categorical',
-    'cauchy',
-    'chi_square',
-    'dirichlet',
-    'double_exponential',
-    'exponential',
-    'gamma',
-    'hypergeometric',
-    'inv_chi_square',
-    'inv_gamma',
-    'inv_wishart',
-    'lkj_corr',
-    'lkj_corr_cholesky',
-    'lkj_cov',
-    'logistic',
-    'lognormal',
-    'multi_normal',
-    'multi_normal_cholesky',
-    'multi_student_t',
-    'multinomial',
-    'neg_binomial',
-    'normal',
-    'ordered_logistic',
-    'pareto',
-    'poisson',
-    'poisson_log',
-    'scaled_inv_chi_square',
-    'student_t',
-    'uniform',
-    'weibull',
-    'wishart']
+DISTRIBUTIONS=[   u'bernoulli',
+    u'bernoulli_logit',
+    u'beta',
+    u'beta_binomial',
+    u'binomial',
+    u'binomial_coefficient',
+    u'binomial_logit',
+    u'categorical',
+    u'cauchy',
+    u'chi_square',
+    u'dirichlet',
+    u'double_exponential',
+    u'exponential',
+    u'gamma',
+    u'hypergeometric',
+    u'inv_chi_square',
+    u'inv_gamma',
+    u'inv_wishart',
+    u'lkj_corr',
+    u'lkj_corr_cholesky',
+    u'lkj_cov',
+    u'logistic',
+    u'lognormal',
+    u'multi_normal',
+    u'multi_normal_cholesky',
+    u'multi_normal_prec',
+    u'multi_student_t',
+    u'multinomial',
+    u'multiply',
+    u'neg_binomial',
+    u'normal',
+    u'ordered_logistic',
+    u'pareto',
+    u'poisson',
+    u'poisson_log',
+    u'scaled_inv_chi_square',
+    u'student_t',
+    u'uniform',
+    u'weibull',
+    u'wishart']
 
-CPP_RESERVED = [
-    'alignas',
-    'alignof',
-    'and',
-    'and_eq',
-    'asm',
-    'auto',
-    'bitand',
-    'bitor'
-    'bool',
-    'break',
-    'case',
-    'catch',
-    'char',
-    'char16_t',
-    'char32_t',
-    'class'
-    'compl',
-    'const',
-    'constexpr',
-    'const_cast',
-    'continue',
-    'decltype'
-    'default',
-    'delete',
-    'do',
-    'double',
-    'dynamic_cast',
-    'else',
-    'enum'
-    'explicit',
-    'export',
-    'extern',
-    'false',
-    'float',
-    'for',
-    'friend',
-    'goto'
-    'if',
-    'inline',
-    'int',
-    'long',
-    'mutable',
-    'namespace',
-    'new',
-    'noexcept'
-    'not',
-    'not_eq',
-    'nullptr',
-    'operator',
-    'or',
-    'or_eq',
-    'private',
-    'protected'
-    'public',
-    'register',
-    'reinterpret_cast',
-    'return',
-    'short',
-    'signed'
-    'sizeof',
-    'static',
-    'static_assert',
-    'static_cast',
-    'struct',
-    'switch'
-    'template',
-    'this',
-    'thread_local',
-    'throw',
-    'true',
-    'try',
-    'typedef'
-    'typeid',
-    'typename',
-    'union',
-    'unsigned',
-    'using',
-    'virtual',
-    'void'
-    'volatile',
-    'wchar_t',
-    'while',
-    'xor',
-    'xor_eq'
-    ]

pygments/lexers/math.py

 from pygments.lexer import Lexer, RegexLexer, bygroups, include, \
     combined, do_insertions
 from pygments.token import Comment, String, Punctuation, Keyword, Name, \
-    Operator, Number, Text, Generic
+    Operator, Number, Text, Generic, Error
 
 from pygments.lexers.agile import PythonLexer
 from pygments.lexers import _scilab_builtins
                         'model', r'generated\s+quantities')),
              bygroups(Keyword.Namespace, Text, Punctuation)),
             # Reserved Words
-            (r'(%s)\b' % r'|'.join(_RESERVED), Keyword),
+            (r'(%s)\b' % r'|'.join(_KEYWORDS), Keyword),
             # Truncation
             (r'T(?=\s*\[)', Keyword),
             # Data types