some progress on the nimpretty tool; still not ready
This commit is contained in:
parent
c06f73b484
commit
604a15c0aa
4 changed files with 79 additions and 17 deletions
|
|
@ -42,7 +42,8 @@ proc writeVersion() =
|
|||
proc prettyPrint(infile: string) =
|
||||
let fileIdx = fileInfoIdx(infile)
|
||||
let tree = parseFile(fileIdx, newIdentCache())
|
||||
renderModule(tree, infile, {})
|
||||
let outfile = changeFileExt(infile, ".pretty.nim")
|
||||
renderModule(tree, infile, outfile, {})
|
||||
|
||||
proc main =
|
||||
var infile: string
|
||||
|
|
@ -50,7 +51,7 @@ proc main =
|
|||
for kind, key, val in getopt():
|
||||
case kind
|
||||
of cmdArgument:
|
||||
infile = key
|
||||
infile = key.addFileExt(".nim")
|
||||
of cmdLongoption, cmdShortOption:
|
||||
case normalize(key)
|
||||
of "help", "h": writeHelp()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue