New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stan highlighting needs fixing #3236
Comments
Hi @spinkney! I made a PR adding the missing keywords and HOFs (#3238).
"Parameter"? You mean a token, right? If so, then this will be difficult. Program blocks are context-free, so we can't easily detect them using regexes. What do you need the new token for? |
First, thank you for being so responsive! It's a sunday and I really appreciate it. Yes program blocks. I'm thinking it would mimic the highlighting contexts of vscode. So those program blocks would have separate highlighting. Maybe just using the keyword for those blocks and if a "{" is detected after removing/skipping over all white space? |
Ah, that's what you want to do. That's pretty easy. I'll add an alias to those keywords, so you can give them a different color. |
@spinkney You might also want to comment on the VSCode grammar of Stan. That being said, I added support for imaginary number literals. |
Yes, it is already done :) ivan-bocharov/stan-vscode#7 (comment). Thank you! |
Thank you so much @RunDevelopment! |
Information
Description
Lots of updates to Stan since 2.24 plus a few other things.
First the other things. I believe the Stan code needs an additional parameter to indicate the "blocks" of the language:
Changes since 2.28
array[]
is now a valid keywordcomplex
is a valid keyword literalThe higher order functions that are valid are:
It's probably easier to just have all the functions. I've grabbed all this from a recent pr request in the rouge library
Long list of functions
# Integer-Valued Basic FunctionsCode snippet
test page
The BNF grammars page was updated. I see that this is referenced in the prism stan code. The updated file is stan bnf grammars 2.28.
The text was updated successfully, but these errors were encountered: