chore: make Syntax.reprint output without source info more readable

This commit is contained in:
Sebastian Ullrich 2020-01-07 14:29:31 -05:00 committed by Leonardo de Moura
parent c08fcdb662
commit 82078fba84

View file

@ -284,7 +284,11 @@ match setTailInfoAux info stx with
| none => stx
private def reprintLeaf : Option SourceInfo → String → String
| none, val => val
-- no source info => add gracious amounts of whitespace to definitely separate tokens
-- Note that the proper pretty printer does not use this function.
-- The parser as well always produces source info, so round-tripping is still
-- guaranteed.
| none, val => " " ++ val ++ " "
| some info, val => info.leading.toString ++ val ++ info.trailing.toString
partial def reprint : Syntax → Option String