Hi, I’m working with CmdStan 2.31.0 and stanc
emits warning messages such as the following:
Warning in 'tmp1.stan', line 127, column 4: Declaration of arrays by placing
brackets after a variable name is deprecated and will be removed in Stan
2.32.0. Instead use the array keyword before the type. This can be
changed automatically using the auto-format flag to stanc
I guess that’s from instances of real xyz [nnn]
, which, I gather from the message, are going to be discontinued at some point in the near future. Looks like I just need to replace that with array [nnn] real xyz
.
I am looking for an existing tool or whatever to carry out just that conversion, as I have a number of models, so I’d rather not do it by hand, and I’d rather not reinvent the wheel if someone else has already tackled it. There are several variations, and getting the regular expression syntax just right is a delicate operation.
I know that I can say stanc --auto-format
and that rewrites the array declarations, but it also rewrites everything else, which I’d rather not.
Thanks in advance for any light you can shed on this problem.
Robert Dodier