chore: add formatter module docstring

This commit is contained in:
Sebastian Ullrich 2020-08-04 17:02:36 +02:00 committed by Leonardo de Moura
parent a35e1c79b7
commit 093f0553e7

View file

@ -4,6 +4,15 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Sebastian Ullrich
-/
/-!
The formatter turns a `Syntax` tree into a `Format` object, inserting both mandatory whitespace (to separate adjacent
tokens) as well as "pretty" optional whitespace.
The basic approach works much like the parenthesizer: A right-to-left traversal over the syntax tree and the parser that
produced it, driven by parser-specific handlers registered via an attribute. The traversal is right-to-left so that when
emitting a token, we already know the text following it and can decide whether or not whitespace between the two is
necessary.
-/
import Lean.Parser
import Lean.Meta
import Lean.Elab.Quotation