Applied Araq's suggestions for c2nim
This commit is contained in:
parent
5395347582
commit
aec9195c95
2 changed files with 11 additions and 9 deletions
|
|
@ -49,8 +49,8 @@ proc parse(infile: string, options: PParserOptions): PNode =
|
|||
|
||||
proc main(infile, outfile: string, options: PParserOptions, spliceHeader: bool) =
|
||||
var start = getTime()
|
||||
if spliceHeader and infile[infile.len-2 .. infile.len] == ".c" and existsFile(infile[0 .. infile.len-2] & "h"):
|
||||
var header_module = parse(infile[0 .. infile.len-2] & "h", options)
|
||||
if spliceHeader and infile.splitFile.ext == ".c" and existsFile(infile.changeFileExt(".h")):
|
||||
var header_module = parse(infile.changeFileExt(".h"), options)
|
||||
var source_module = parse(infile, options)
|
||||
for n in source_module:
|
||||
addson(header_module, n)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue