1. Georg Brandl
  2. pygments-main

Pull requests

#112 Merged
Repository
Deleted repository
Branch
default (aa19b6e57e48)
Repository
pygments-main
Branch
default

update StanLexer for changes in Stan 1.0.2

Author
  1. Jeffrey Arnold
Reviewers
Description

The new version of Stan (v. 1.0.2) made some changes to the language, like a print statement and string literals.

It also added a few new built-in functions. I moved the Stan builtins to a new module pygments.lexers._stan_builtins.

  • Learn about pull requests

Comments (2)

  1. Tim Hatch

    Looks good to me, except I suspect the string pattern is wrong. How do you output a string that contains a double quote? Could you add that to an examplefile, and adjust the regex to match? Or if you'd prefer, point me to docs and I'll adjust after merging.

  2. Jeffrey Arnold author

    Unusually, the string literals in Stan do not allow for double quotes within the string or even "\". So the the regex I use is even more permissive than the parser, but I kept it simple to avoid specifying the full set of characters that are allowed within the string. The string in the example file is in fact the only characters that are allowed in a valid string.