Closed ceastlund closed 4 years ago
Ah! I see the problem: apparently, $*)
in code is lexed as $*
then )
. So when it happens in code-in-comment, ocp-indent doesn't detect it, and believes everything afterwards is in the comment still, which causes all of this weird stuff.
Interestingly enough, the bug was already there if writing something like (* {[ foo $*)
: while ocp-indent was designed to detect premature ending of the code-in-comment block, parsing $*)
as code bypassed the end of comment detection altogether.
I'll find a fix ASAP, thanks for the feedback.
03bb53f1a9db9e61b66e6674f995ec150619a68b fixes the above, and indeed seems to resolve all the issues you pointed here (so it seems they were all due to the ill-parsed $*)
).
Thanks for the report!
This is a subset of the code from the implementation of bin_prot, formatted using ocp-indent built from 786f61b01674c3315e91ade9a1e2cf160b705a8d. It demonstrates a number of problems. After the initial cinaps comment, everything is indented five characters, but shouldn't be indented at all. The match clauses containing cinaps comments are indented very far to the right, but those cinaps comments shouldn't incur indentation either. And the final non-cinaps comment in the file -- the one that reads "No error possible either." -- causes everything after it to be indented as prose rather than as code, and everything gets aligned to the same indentation level.