Commits

Georg Brandl committed 92ab6fc

BUGS/STAN: fix Bugs lexer and Stan example file to not generate errors

  • Participants
  • Parent commits efa832f

Comments (0)

Files changed (3)

pygments/lexers/_mapping.py

     'BooLexer': ('pygments.lexers.dotnet', 'Boo', ('boo',), ('*.boo',), ('text/x-boo',)),
     'BrainfuckLexer': ('pygments.lexers.other', 'Brainfuck', ('brainfuck', 'bf'), ('*.bf', '*.b'), ('application/x-brainfuck',)),
     'BroLexer': ('pygments.lexers.other', 'Bro', ('bro',), ('*.bro',), ()),
-    'BugsLexer': ('pygments.lexers.math', 'BUGS', ('bugs', 'winbugs', 'openbugs'), ('*.bug',), ()),
+    'BugsLexer': ('pygments.lexers.math', 'BUGS', ('bugs', 'winbugs', 'openbugs'), ('*.bugs',), ()),
     'CLexer': ('pygments.lexers.compiled', 'C', ('c',), ('*.c', '*.h', '*.idc'), ('text/x-chdr', 'text/x-csrc')),
     'CMakeLexer': ('pygments.lexers.text', 'CMake', ('cmake',), ('*.cmake', 'CMakeLists.txt'), ('text/x-cmake',)),
     'CObjdumpLexer': ('pygments.lexers.asm', 'c-objdump', ('c-objdump',), ('*.c-objdump',), ('text/x-c-objdump',)),

pygments/lexers/math.py

 
     name = 'BUGS'
     aliases = ['bugs', 'winbugs', 'openbugs']
-    filenames = ['*.bug']
+    filenames = ['*.bugs']
 
     _FUNCTIONS = [
         # Scalar functions
     """
 
     _DISTRIBUTIONS = ['dbern', 'dbin', 'dcat', 'dnegbin', 'dpois',
-                           'dhyper', 'dbeta', 'dchisqr', 'ddexp', 'dexp',
-                           'dflat', 'dgamma', 'dgev', 'df', 'dggamma', 'dgpar',
-                           'dloglik', 'dlnorm', 'dlogis', 'dnorm', 'dpar',
-                           'dt', 'dunif', 'dweib', 'dmulti', 'ddirch', 'dmnorm',
-                           'dmt', 'dwish']
+                      'dhyper', 'dbeta', 'dchisqr', 'ddexp', 'dexp',
+                      'dflat', 'dgamma', 'dgev', 'df', 'dggamma', 'dgpar',
+                      'dloglik', 'dlnorm', 'dlogis', 'dnorm', 'dpar',
+                      'dt', 'dunif', 'dweib', 'dmulti', 'ddirch', 'dmnorm',
+                      'dmt', 'dwish']
     """ OpenBUGS built-in distributions
 
     Functions From http://www.openbugs.info/Manuals/ModelSpecification.html#ContentsAI
             # Block
             (r'{', Punctuation, '#push'),
             (r'}', Punctuation, '#pop'),
+            # Other
+            (r';', Punctuation),
             ]
         }
 

tests/examplefiles/example.stan

      // includes .
      real foo.;
      // beings with number
-     real 0foo;
+     //real 0foo;
      // begins with _
-     real _foo;
+     //real _foo;
 }
 transformed data {
      real xyzzy;
 }
 
 ## Baddness
-foo <- 2.0;
-foo ~ normal(0, 1);
-not_a_block {
-}
+//foo <- 2.0;
+//foo ~ normal(0, 1);
+//not_a_block {
+//}
 
 /*
 what happens with this? 
 */
-*/
+// */