diff options
author | Jeffrey B. Arnold <jeffrey.arnold@gmail.com> | 2012-08-01 16:31:58 -0400 |
---|---|---|
committer | Jeffrey B. Arnold <jeffrey.arnold@gmail.com> | 2012-08-01 16:31:58 -0400 |
commit | eedcbe321333d90f38f2f1cf21781f20fb88ba1c (patch) | |
tree | c6d8707bae561520bd7717db746b203d2d553f60 | |
parent | 64f161dfcae078c644979b6316f083d3a7879f69 (diff) | |
download | pygments-eedcbe321333d90f38f2f1cf21781f20fb88ba1c.tar.gz |
fixing bugs with JagsLexer
-rw-r--r-- | pygments/lexers/_mapping.py | 2 | ||||
-rw-r--r-- | pygments/lexers/math.py | 17 |
2 files changed, 10 insertions, 9 deletions
diff --git a/pygments/lexers/_mapping.py b/pygments/lexers/_mapping.py index aa00f96e..00bef11b 100644 --- a/pygments/lexers/_mapping.py +++ b/pygments/lexers/_mapping.py @@ -230,7 +230,7 @@ LEXERS = { 'SqliteConsoleLexer': ('pygments.lexers.sql', 'sqlite3con', ('sqlite3',), ('*.sqlite3-console',), ('text/x-sqlite3-console',)), 'SquidConfLexer': ('pygments.lexers.text', 'SquidConf', ('squidconf', 'squid.conf', 'squid'), ('squid.conf',), ('text/x-squidconf',)), 'SspLexer': ('pygments.lexers.templates', 'Scalate Server Page', ('ssp',), ('*.ssp',), ('application/x-ssp',)), - 'StanLexer': ('pygments.lexers.math', 'Stan', ('stan',), ('*.stan'), ()), + 'StanLexer': ('pygments.lexers.math', 'Stan', ('stan',), ('*.stan',), ()), 'SystemVerilogLexer': ('pygments.lexers.hdl', 'systemverilog', ('sv',), ('*.sv', '*.svh'), ('text/x-systemverilog',)), 'TclLexer': ('pygments.lexers.agile', 'Tcl', ('tcl',), ('*.tcl',), ('text/x-tcl', 'text/x-script.tcl', 'application/x-tcl')), 'TcshLexer': ('pygments.lexers.shell', 'Tcsh', ('tcsh', 'csh'), ('*.tcsh', '*.csh'), ('application/x-csh',)), diff --git a/pygments/lexers/math.py b/pygments/lexers/math.py index ce9ec007..4501362f 100644 --- a/pygments/lexers/math.py +++ b/pygments/lexers/math.py @@ -1160,7 +1160,7 @@ class BugsLexer(RegexLexer): class JagsLexer(RegexLexer): """ Pygments Lexer for JAGS """ - name = 'jags' + name = 'JAGS' aliases = ['jags'] filenames = ['*.jags'] @@ -1210,7 +1210,7 @@ class JagsLexer(RegexLexer): # Variable declaration (TODO: improve) (r'var\b', Keyword.Declaration, 'var') ], - 'block' : [ + 'statements': [ include('comments'), include('whitespace'), # Reserved Words @@ -1225,27 +1225,28 @@ class JagsLexer(RegexLexer): include('names'), # Number Literals (r'[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?', Number), - (r'(\[|\]|\(|\)|:|,|;)', Punctuation), + (r'(\[|\]|\(|\)|:|,)', Punctuation), # Assignment operators (r'(<-|~)', Operator), # # JAGS includes many more than OpenBUGS # |/|\|\||\&\&|>=?|<=?|[=!]?=|!|%.*?%|^)' (r'(\+|-|\*|\/|\|\|[&]{2}|[<>=]=?|\^|%.*?%)', Operator), - # Block + ], + 'block' : [ + include('statements'), + (r';', Punctuation), (r'{', Punctuation, '#push'), (r'}', Punctuation, '#pop'), ], 'var' : [ - include('whitespace'), - include('names'), - (r'(,|\[|\])', Punctuation), + include('statements'), (r';', Punctuation, '#pop'), ] } class StanLexer(RegexLexer): """ Pygments Lexer for Stan models """ - name = 'STAN' + name = 'Stan' aliases = ['stan'] filenames = ['*.stan'] |