diff options
author | Araq <rumpf_a@web.de> | 2014-09-08 09:18:09 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-09-08 09:18:09 +0200 |
commit | c53a27f0dc4e867701955e97b607aab2b66a0740 (patch) | |
tree | 519ce7a9527e74c4a94109fcaf81ad21be6a12f3 /compiler/pretty.nim | |
parent | 7333237be6abe3f170fe440e887ae83707fd748f (diff) | |
download | Nim-c53a27f0dc4e867701955e97b607aab2b66a0740.tar.gz |
nimfix supports specialized '.nimfix' modules
Diffstat (limited to 'compiler/pretty.nim')
-rw-r--r-- | compiler/pretty.nim | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/compiler/pretty.nim b/compiler/pretty.nim index b7265b946..436181bbc 100644 --- a/compiler/pretty.nim +++ b/compiler/pretty.nim @@ -31,20 +31,20 @@ type proc overwriteFiles*() = let doStrip = options.getConfigVar("pretty.strip").normalize == "on" for i in 0 .. high(gSourceFiles): - if not gSourceFiles[i].dirty: continue - let newFile = if gOverWrite: gSourceFiles[i].fullpath - else: gSourceFiles[i].fullpath.changeFileExt(".pretty.nim") - try: - var f = open(newFile, fmWrite) - for line in gSourceFiles[i].lines: - if doStrip: - f.write line.strip(leading = false, trailing = true) - else: - f.write line - f.write("\L") - f.close - except IOError: - rawMessage(errCannotOpenFile, newFile) + if gSourceFiles[i].dirty and not gSourceFiles[i].isNimfixFile: + let newFile = if gOverWrite: gSourceFiles[i].fullpath + else: gSourceFiles[i].fullpath.changeFileExt(".pretty.nim") + try: + var f = open(newFile, fmWrite) + for line in gSourceFiles[i].lines: + if doStrip: + f.write line.strip(leading = false, trailing = true) + else: + f.write line + f.write("\L") + f.close + except IOError: + rawMessage(errCannotOpenFile, newFile) proc `=~`(s: string, a: openArray[string]): bool = for x in a: |