[wadler] Trivia escapes groups
This means that forced breaks from comments don't screw up the following single-line things. But this still isn't right; we need to fine tune how we represent trivia.
This commit is contained in:
parent
9d55588a35
commit
c31d527077
4 changed files with 96 additions and 26 deletions
|
|
@ -135,6 +135,8 @@ def flatten_document(doc: wadler.Document, src: str) -> list:
|
|||
return []
|
||||
case wadler.Marker():
|
||||
return [f"<marker {repr(doc.meta)}>", flatten_document(doc.child, src)]
|
||||
case wadler.Trivia():
|
||||
return [f"<trivia>", flatten_document(doc.child, src)]
|
||||
case _:
|
||||
typing.assert_never(doc)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue