more refactoring
This commit is contained in:
parent
dd8a6ef3a2
commit
18a3833d60
11 changed files with 36 additions and 33 deletions
|
|
@ -12,7 +12,7 @@
|
|||
when not defined(nimpretty):
|
||||
{.error: "This needs to be compiled with --define:nimPretty".}
|
||||
|
||||
import ../compiler / [idents, msgs, ast, syntaxes, renderer]
|
||||
import ../compiler / [idents, msgs, ast, syntaxes, renderer, options]
|
||||
|
||||
import parseopt, strutils, os
|
||||
|
||||
|
|
@ -40,8 +40,9 @@ proc writeVersion() =
|
|||
quit(0)
|
||||
|
||||
proc prettyPrint(infile: string) =
|
||||
let fileIdx = fileInfoIdx(infile)
|
||||
let tree = parseFile(fileIdx, newIdentCache())
|
||||
let conf = newConfigRef()
|
||||
let fileIdx = fileInfoIdx(conf, infile)
|
||||
let tree = parseFile(fileIdx, newIdentCache(), conf)
|
||||
let outfile = changeFileExt(infile, ".pretty.nim")
|
||||
renderModule(tree, infile, outfile, {}, fileIdx)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue