From bbe58407cfc9dba26db7a398bb6af3207222843e Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Tue, 7 Nov 2017 23:13:16 -0600 Subject: [PATCH] Ignore #pragma in preprocessor output --- nimgen.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nimgen.nim b/nimgen.nim index ef68666..28ee26e 100644 --- a/nimgen.nim +++ b/nimgen.nim @@ -94,6 +94,7 @@ proc savefile(file: string) = FILES.del(file) except: echo "Failed to save " & file + echo getCurrentExceptionMsg() proc savefiles() = for file in FILES.keys(): @@ -195,7 +196,7 @@ proc preprocess(file: string): string = let sfile = file.replace("\\", "/") for line in data.splitLines(): if line.strip() != "": - if line[0] == '#': + if line[0] == '#' and not line.contains("#pragma"): start = false if sfile in line.replace("\\", "/").replace("//", "/"): start = true