[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:
John Doty 2024-09-15 08:51:18 -07:00
parent 9d55588a35
commit c31d527077
4 changed files with 96 additions and 26 deletions

View file

@ -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)