nimpretty: first version that seems useful for others to test it
This commit is contained in:
parent
bf5d619a52
commit
a1bd4a6cbd
6 changed files with 239 additions and 6 deletions
|
|
@ -42,9 +42,12 @@ proc writeVersion() =
|
|||
proc prettyPrint(infile: string) =
|
||||
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)
|
||||
when defined(nimpretty2):
|
||||
discard parseFile(fileIdx, newIdentCache(), conf)
|
||||
else:
|
||||
let tree = parseFile(fileIdx, newIdentCache(), conf)
|
||||
let outfile = changeFileExt(infile, ".pretty.nim")
|
||||
renderModule(tree, infile, outfile, {}, fileIdx, conf)
|
||||
|
||||
proc main =
|
||||
var infile: string
|
||||
|
|
|
|||
2
tools/nimpretty.nim.cfg
Normal file
2
tools/nimpretty.nim.cfg
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
--define: nimpretty
|
||||
--define: nimpretty2
|
||||
Loading…
Add table
Add a link
Reference in a new issue