Closed domluna closed 2 years ago
I don't think modifications to CSTParser are the correct route for this, having a quick glance I think we should be able to hand this through modifying get_lines
. I think handling comments explicitly in CSTParser would add too many complications to the token look ahead mechanism
@ZacLN
Currently the formatter doesn't properly align docstrings and comments.
formats to:
I have a POC which treats each line in the doc as a LITERAL instead of the entire doc as one LITERAL and this works, also needs come changes to
get_lines
. We could do something similar for comments but it's trickier since at the moment CSTParser ignores comments.We could add something like
to
spec.jl
and then store the comments as LITERALS,MultiLineComment
would be similar to how docstrings work.I have some WIP on these things but would like to hear your thoughts before I proceed further.