nimpretty: smart tabs support, fixes #9399 [bugfix]
This commit is contained in:
parent
22a1b12038
commit
caf93f4355
6 changed files with 159 additions and 59 deletions
|
|
@ -50,15 +50,11 @@ proc prettyPrint(infile, outfile: string, opt: PrettyOptions) =
|
|||
var conf = newConfigRef()
|
||||
let fileIdx = fileInfoIdx(conf, AbsoluteFile infile)
|
||||
conf.outFile = RelativeFile outfile
|
||||
when defined(nimpretty2):
|
||||
var p: TParsers
|
||||
p.parser.em.indWidth = opt.indWidth
|
||||
if setupParsers(p, fileIdx, newIdentCache(), conf):
|
||||
discard parseAll(p)
|
||||
closeParsers(p)
|
||||
else:
|
||||
let tree = parseFile(fileIdx, newIdentCache(), conf)
|
||||
renderModule(tree, infile, outfile, {}, fileIdx, conf)
|
||||
var p: TParsers
|
||||
p.parser.em.indWidth = opt.indWidth
|
||||
if setupParsers(p, fileIdx, newIdentCache(), conf):
|
||||
discard parseAll(p)
|
||||
closeParsers(p)
|
||||
|
||||
proc main =
|
||||
var infile, outfile: string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue