feat: use truncateTrailing at error messages
This commit is contained in:
parent
ae84270226
commit
1ff7950a77
2 changed files with 6 additions and 1 deletions
|
|
@ -10,7 +10,7 @@ import Init.Lean.Parser
|
|||
namespace Lean
|
||||
|
||||
def Syntax.prettyPrint (stx : Syntax) : Format :=
|
||||
match stx.reprint with -- TODO use syntax pretty printer
|
||||
match stx.truncateTrailing.reprint with -- TODO use syntax pretty printer
|
||||
| some str => format str.toFormat
|
||||
| none => format stx
|
||||
|
||||
|
|
|
|||
|
|
@ -236,6 +236,11 @@ match setTailInfoAux info stx with
|
|||
| some stx => stx
|
||||
| none => stx
|
||||
|
||||
def truncateTrailing (stx : Syntax) : Syntax :=
|
||||
match stx.getTailInfo with
|
||||
| none => stx
|
||||
| some info => stx.setTailInfo info.truncateTrailing
|
||||
|
||||
private def reprintLeaf : Option SourceInfo → String → String
|
||||
-- no source info => add gracious amounts of whitespace to definitely separate tokens
|
||||
-- Note that the proper pretty printer does not use this function.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue