chore: update script/reformat.lean

This commit is contained in:
Sebastian Ullrich 2022-05-13 11:55:44 +02:00
parent 5cd4bd3552
commit 4934104eaf

View file

@ -59,10 +59,11 @@ def parseModule (input : String) (fileName : String) (opts : Options := {}) (tru
pure {env, currNamespace, openDecls, stx}
| _ =>
failWith "unknown info tree"
#[{ env := env0, stx := header : CommandSyntax }] ++ topLevelCmds
return #[{ env := env0, stx := header : CommandSyntax }] ++ topLevelCmds
unsafe def main (args : List String) : IO Unit := do
let [fileName] ← args | failWith "Usage: reformat file"
let [fileName] := args | failWith "Usage: reformat file"
initSearchPath (← findSysroot)
let input ← IO.FS.readFile fileName
let moduleStx ← parseModule input fileName
let leadingUpdated := mkNullNode (moduleStx.map (·.stx)) |>.updateLeading |>.getArgs