From 6d0abefe8a3c3bb060941cd664fc66dc3cefbd21 Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Tue, 13 Mar 2018 17:05:40 -0500 Subject: Minor bugfixes --- README.md | 2 ++ nimgen.nim | 9 ++++++--- nimgen.nimble | 2 +- tests/nimgentest.nims | 4 ++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2831d45..3434957 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,8 @@ To see examples of nimgen in action check out the following wrappers:- * download ZIP with headers and binary * Compile C code into binary + * [nimbigwig](https://github.com/genotrance/nimbigwig) - libbigWig wrapper + * git checkout * [nimfuzz](https://github.com/genotrance/nimfuzz) - fts_fuzzy_match wrapper * download header file * [nimkerberos](https://github.com/genotrance/nimkerberos) - WinKerberos wrapper diff --git a/nimgen.nim b/nimgen.nim index fc70cc2..c48fdde 100644 --- a/nimgen.nim +++ b/nimgen.nim @@ -283,7 +283,8 @@ proc getIncls(file: string, inline=false): seq[string] = for f in content.findIter(re"(?m)^\s*#\s*include\s+(.*?)$"): var inc = f.captures[0].strip() if ((QUOTES and inc.contains("\"")) or (FILTER != "" and FILTER in inc)) and (not exclude(inc)): - result.add(inc.replace(re"""[<>"]""", "").strip()) + result.add( + inc.replace(re"""[<>"]""", "").replace(re"\/[\*\/].*$", "").strip()) result = result.deduplicate() @@ -337,6 +338,8 @@ proc runPreprocess(file, ppflags, flags: string, inline: bool): string = start = false if sfile in line.replace("\\", "/").replace("//", "/"): start = true + if not ("\\" in line) and not ("/" in line) and extractFilename(sfile) in line: + start = true else: if start: rdata.add( @@ -641,9 +644,9 @@ proc runCfg(cfg: string) = let (key, val) = getKey(wild) if val == true: if key == "wildcard": - wildcard = CONFIG["n.wildcard"][key] + wildcard = CONFIG["n.wildcard"][wild] else: - WILDCARDS.setSectionKey(wildcard, key, CONFIG["n.wildcard"][key]) + WILDCARDS.setSectionKey(wildcard, wild, CONFIG["n.wildcard"][wild]) for file in CONFIG.keys(): if file in @["n.global", "n.include", "n.exclude", "n.prepare", "n.wildcard"]: diff --git a/nimgen.nimble b/nimgen.nimble index 79e8a4b..b2bfac6 100644 --- a/nimgen.nimble +++ b/nimgen.nimble @@ -1,6 +1,6 @@ # Package -version = "0.1.4" +version = "0.1.5" author = "genotrance" description = "c2nim helper to simplify and automate the wrapping of C libraries" license = "MIT" diff --git a/tests/nimgentest.nims b/tests/nimgentest.nims index fedf017..1a9d652 100644 --- a/tests/nimgentest.nims +++ b/tests/nimgentest.nims @@ -2,13 +2,13 @@ import distros import ospaths import strutils -var comps = @["libsvm", "nimbass", "nimfuzz", "nimrax", "nimssl", "nimssh2"] +var comps = @["libsvm", "nimbass", "nimbigwig", "nimfuzz", "nimrax", "nimssl", "nimssh2"] if detectOs(Windows): comps.add("nimkerberos") for comp in comps: if dirExists(".."/comp): - exec "nimble uninstall -y " & comp + exec "nimble uninstall -y " & comp, "", "" withDir(".."/comp): rmDir(comp) exec "nimble install -y" -- cgit v1.2.3