Closed jrnold closed 5 years ago
@bob-carpenter stan mode has been having some issues with using the built-in cc-mode to parse the grammar (see #47 ). One idea that I've been sitting on is to use emac's smie to write a new indentation engine. Smie uses an operator precedence grammar for its indentation engine because that is usually "good enough" :tm: for indentation (with edge cases handled by custom code). Since you are the languages expert, what do you think?
From #47 link to smie c-mode http://git.savannah.gnu.org/cgit/emacs/elpa.git/tree/packages/sm-c-mode
I'm so lazy I haven't even tried installing the latest stan mode, though I've seen Daniel using it and it looks awesome. Auto indent should be good enough for us---we use bog standard indentation other than for the named model blocks (which should format as while loops without a condition).
On Aug 9, 2016, at 5:39 PM, Jeffrey Arnold notifications@github.com wrote:
@bob-carpenter stan mode has been having some issues with using the built-in cc-mode to parse the grammar (see #47 ). One idea that I've been sitting on is to use emac's smie to write a new indentation engine. Smie uses an operator precedence grammar for its indentation engine because that is usually "good enough" ™️ for indentation (with edge cases handled by custom code). Since you are the languages expert, what do you think?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
s/lazy/efficient/g
Just adding a link to the current Language Syntax: https://mc-stan.org/docs/2_20/reference-manual/language-syntax.html
As of now, cc-mode
is still a powerful working solution.
This is a longer-run issue. Remove dependency on
cc-mode
and write an indentation engine based on smie. I can translate the Stan BNF to an operator-precedence grammar thatsmie
uses. Removing the reliance oncc-mode
would be useful because as features are added to the Stan language, it will diverge fromC++
syntax.