Stan keywords and functions; used to create editor language modes and syntax highlighters
This is not literally the Stan Language definition, which is in the Stan Modeling Language User's Guide and Reference Manual.
This repo contains stan-lang.json
, which contains various keywords and built-in functions in Stan that I use in maintaining several editor modes and syntax highlighting defintions.
In particular, this is used to generate the keyword and function lists in:
make all
in this directory invokes the create_stan_lang.py
Python script. This script parses the following manually maintained files to construct the stan-lang.json
file. make clean
will delete this file.
stan-lang-keywords.yaml
stan-functions-*.txt
The stan-functions-*.txt
file is generated by the extract_function_sigs.py
script in the stan docs repo. For example, function signatures for Stan version 2.4.x can be generated as follows after cloning the stan-dev/docs repo.
git clone [email protected]:stan-dev/docs.git
cd docs
python3 extract_function_sigs.py
Copy the resulting file named stan-functions-2_24.txt
to this repo.
array [] int
syntax as replacement for int[]
syntax.^
and %/%
operatorscomplex
typeoffset
and multiplier
to keywords.=
now used for assignment. <-
is deprecated.target
keyword for target += expression
lp__
is no longer supportedlog_prob()
and target()
as special functionsa ? b : c
integrate_ode
, integrate_ode_rk45
, integrate_ode_bdf
which support 6 or 9 arguments.log_prob
, increment_log_prob
, binomial_log
, multiply_log
y ~ foo(a, b)
is deprecated in favor of target += foo(y | a, b)
_log
, _cdf_log
, and _ccdf_log
deprecated in favor of_lpdf
, _lpmf
, _lcdf
, _lccdf
, _cdf
, _ccdf
.