More multiReplaces
This commit is contained in:
parent
2fae745378
commit
2d06bdcccf
1 changed files with 3 additions and 6 deletions
|
|
@ -123,18 +123,15 @@ proc runPreprocess*(file, ppflags, flags: string, inline: bool): string =
|
||||||
if line.strip() != "":
|
if line.strip() != "":
|
||||||
if line[0] == '#' and not line.contains("#pragma"):
|
if line[0] == '#' and not line.contains("#pragma"):
|
||||||
start = false
|
start = false
|
||||||
if sfile in line.replace("\\", "/").replace("//", "/"):
|
if sfile in line.multiReplace([("\\", "/"), ("//", "/")]):
|
||||||
start = true
|
start = true
|
||||||
if not ("\\" in line) and not ("/" in line) and extractFilename(sfile) in line:
|
if not ("\\" in line) and not ("/" in line) and extractFilename(sfile) in line:
|
||||||
start = true
|
start = true
|
||||||
else:
|
else:
|
||||||
if start:
|
if start:
|
||||||
rdata.add(
|
rdata.add(
|
||||||
line.replace("_Noreturn", "")
|
line.multiReplace([("_Noreturn", ""), ("(())", ""), ("WINAPI", ""),
|
||||||
.replace("(())", "")
|
("__attribute__", ""), ("extern \"C\"", "")])
|
||||||
.replace("WINAPI", "")
|
|
||||||
.replace("__attribute__", "")
|
|
||||||
.replace("extern \"C\"", "")
|
|
||||||
.replace(re"\(\([_a-z]+?\)\)", "")
|
.replace(re"\(\([_a-z]+?\)\)", "")
|
||||||
.replace(re"\(\(__format__[\s]*\(__[gnu_]*printf__, [\d]+, [\d]+\)\)\);", ";") & "\n"
|
.replace(re"\(\(__format__[\s]*\(__[gnu_]*printf__, [\d]+, [\d]+\)\)\);", ";") & "\n"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue