diff options
| author | Jeffrey B. Arnold <jeffrey.arnold@gmail.com> | 2012-09-23 17:11:18 -0400 |
|---|---|---|
| committer | Jeffrey B. Arnold <jeffrey.arnold@gmail.com> | 2012-09-23 17:11:18 -0400 |
| commit | b97fa6a3ecee3ff9dcf7b768cd7985d79eed4dce (patch) | |
| tree | 8a182ee3bc681fec014ec4f3c3a7ded1bbfc995e /pygments/lexers/math.py | |
| parent | 520215091a7b8e4dad1da581b76d10e1d8faf67c (diff) | |
| download | pygments-b97fa6a3ecee3ff9dcf7b768cd7985d79eed4dce.tar.gz | |
update StanLexer for changes in Stan 1.0.2
Diffstat (limited to 'pygments/lexers/math.py')
| -rw-r--r-- | pygments/lexers/math.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/pygments/lexers/math.py b/pygments/lexers/math.py index fb39abaf..802349d4 100644 --- a/pygments/lexers/math.py +++ b/pygments/lexers/math.py @@ -1281,19 +1281,17 @@ class StanLexer(RegexLexer): filenames = ['*.stan'] _RESERVED = ('for', 'in', 'while', 'repeat', 'until', 'if', - 'then', 'else', 'true', 'false', 'T') + 'then', 'else', 'true', 'false', 'T', + 'lower', 'upper', 'print') _TYPES = ('int', 'real', 'vector', 'simplex', 'ordered', 'row_vector', - 'matrix', 'corr_matrix', 'cov_matrix') + 'matrix', 'corr_matrix', 'cov_matrix', 'positive_ordered') # STAN 1.0 Manual, Chapter 20 _CONSTANTS = ['pi', 'e', 'sqrt2', 'log2', 'log10', 'nan', 'infinity', 'epsilon', 'negative_epsilon'] _FUNCTIONS = ['abs', 'int_step', 'min', 'max', - 'if_else', 'step', - 'fabs', 'fdim', - 'fmin', 'fmax', - 'fmod', + 'if_else', 'step', 'fabs', 'fdim', 'fmin', 'fmax', 'fmod', 'floor', 'ceil', 'round', 'trunc', 'sqrt', 'cbrt', 'square', 'exp', 'exp2', 'expm1', 'log', 'log2', 'log10', 'pow', 'logit', 'inv_logit', @@ -1333,6 +1331,8 @@ class StanLexer(RegexLexer): (r'(//|#).*$', Comment.Single), ], 'root': [ + # Stan is more restrictive on strings than this regex + (r'"[^"]*"', String), # Comments include('comments'), # block start @@ -1382,4 +1382,3 @@ class StanLexer(RegexLexer): return 1.0 else: return 0.0 - |
