Formatting comments with semicolon newlines #272
Labels
No Label
blocked: dependency
blocked: info-needed
bug
duplicate
enhancement
fixed in HEAD
help wanted
hs:arrows
hs:brackets
hs:classes
hs:comments
hs:do-notation
hs:guards
hs:lists
hs:operators
hs:patterns
hs:records
hs:types
invalid
language extension support
layouting
needs confirmation
priority: high
priority: low
question
revisit before next release
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: hexagoxel/brittany#272
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
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