Skip to content

Commit 0ab3205

Browse files
committed
Document new reserved keywords
1 parent b42b453 commit 0ab3205

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/reference-manual/expressions.Rmd

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ the tokens are reserved for future use.
110110

111111
```
112112
for, in, while, repeat, until, if, then, else,
113-
true, false, target
113+
true, false
114114
```
115115

116116
Variables should not be named after types, either, and thus may not be
@@ -120,7 +120,7 @@ any of the following.
120120
int, real, vector, simplex, unit_vector, ordered,
121121
positive_ordered, row_vector, matrix,
122122
cholesky_factor_corr, cholesky_factor_cov,
123-
corr_matrix, cov_matrix.
123+
corr_matrix, cov_matrix
124124
```
125125

126126
The following block identifiers are reserved and cannot be used as variable names:
@@ -130,6 +130,11 @@ functions, model, data, parameters, quantities,
130130
transformed, generated
131131
```
132132

133+
Since Stan 2.22, the following identifiers cannot be used as variable names:
134+
```
135+
target, lower, upper, offset, multiplier
136+
```
137+
133138

134139
#### Reserved Names from Stan Implementation {-}
135140

@@ -151,7 +156,7 @@ or `add`, but it may be named `pi` or `e`.
151156
Variable names will also conflict with the names of distributions
152157
suffixed with `_lpdf`, `_lpmf`, `_lcdf`, and `_lccdf`, `_cdf`, and
153158
`_ccdf`, such as `normal_lcdf_log`; this also holds for the deprecated
154-
forms `_log`, `_cdf_log`, and `_ccdf_log`,
159+
forms `_log`, `_cdf_log`, and `_ccdf_log`.
155160

156161
Using any of these variable names causes the `stanc` translator
157162
to halt and report the name and location of the variable causing the

0 commit comments

Comments
 (0)