lean4-htt/tests/playground/patch.lean
2019-08-08 10:47:19 -07:00

16 lines
408 B
Text

import init.lean.parser
open Lean
open Lean.Parser
def fixEqnSyntax (stx : Syntax) : Syntax :=
stx
def main (xs : List String) : IO Unit :=
do
[fname] ← pure xs | throw (IO.userError "usage `patch <file-name>`");
env ← mkEmptyEnvironment;
stx ← parseFile env fname;
let stx := fixEqnSyntax stx;
match stx.reprint with
| some out => IO.print out
| none => throw (IO.userError "failed to reprint")