diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2018-06-16 01:46:39 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-06-16 01:46:39 +0200 |
commit | a1bd4a6cbd820cac7b3534e03c27bcd960775e76 (patch) | |
tree | fda3527ec954e5cdfb7ec09cb5e400caa7800f20 /tools | |
parent | bf5d619a52da04c857a6f7fb3d68afc12182bc22 (diff) | |
download | Nim-a1bd4a6cbd820cac7b3534e03c27bcd960775e76.tar.gz |
nimpretty: first version that seems useful for others to test it
Diffstat (limited to 'tools')
-rw-r--r-- | tools/nimpretty.nim | 9 | ||||
-rw-r--r-- | tools/nimpretty.nim.cfg | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/tools/nimpretty.nim b/tools/nimpretty.nim index 386eddfde..89e6ef905 100644 --- a/tools/nimpretty.nim +++ b/tools/nimpretty.nim @@ -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 diff --git a/tools/nimpretty.nim.cfg b/tools/nimpretty.nim.cfg new file mode 100644 index 000000000..5fafa6d2a --- /dev/null +++ b/tools/nimpretty.nim.cfg @@ -0,0 +1,2 @@ +--define: nimpretty +--define: nimpretty2 |