Hi, thank you for implementing newlines for semicolons! This might be more complicated, but I wonder if it might be possible to handle comments intermingled with the semicolons.
Suppose we have
do {
; A
;
;-- This is a comment
;
; B
}
Right now this gets indented like this:
do
A--This is a comment
B
First, it seems that if there are any comments mixed in with the semicolons, then the comments are retained, but the newlines are lost. Would it be possible to make the semi-colon -> newline translation work when there are comments embedded?
(Note, I think in some cases A--comment would not be parsed as a comment, but if we have e.g. let x=y--comment, then --comment is indeed parsed as a comment.)
Second, this might be too messy, but would it be possible to handle cases where we have a line like
;--comment
and indent the comment to the level of the ;?
My apologies for the complication, but would be useful (to me at least) when trying to generate Haskell code with comments. That is, ideally, I would be able to write
Hi, thank you for implementing newlines for semicolons! This might be more complicated, but I wonder if it might be possible to handle comments intermingled with the semicolons.
Suppose we have
Right now this gets indented like this:
First, it seems that if there are any comments mixed in with the semicolons, then the comments are retained, but the newlines are lost. Would it be possible to make the semi-colon -> newline translation work when there are comments embedded?
(Note, I think in some cases
A--comment
would not be parsed as a comment, but if we have e.g. let x=y--comment, then--comment
is indeed parsed as a comment.)Second, this might be too messy, but would it be possible to handle cases where we have a line like
and indent the comment to the level of the
;
?My apologies for the complication, but would be useful (to me at least) when trying to generate Haskell code with comments. That is, ideally, I would be able to write
and get