aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGanesh Viswanathan <dev@genotrance.com>2019-01-15 16:20:52 -0600
committerGanesh Viswanathan <dev@genotrance.com>2019-01-15 16:20:52 -0600
commit04d01a5f6ebf85f846ab54bd86011f733b42879c (patch)
tree91ee21c67949846289f6f069351efdebd4d1c627
parent75dc6dc56e787daf55363c2ef4f8195c0c5fae9a (diff)
downloadnimterop-04d01a5f6ebf85f846ab54bd86011f733b42879c.tar.gz
nimterop-04d01a5f6ebf85f846ab54bd86011f733b42879c.zip
Fix missing array type, suppress gcc warnings
-rw-r--r--nimterop/getters.nim4
-rw-r--r--nimterop/grammar.nim4
2 files changed, 5 insertions, 3 deletions
diff --git a/nimterop/getters.nim b/nimterop/getters.nim
index 19d32ea..abc292b 100644
--- a/nimterop/getters.nim
+++ b/nimterop/getters.nim
@@ -129,7 +129,7 @@ proc removeStatic*(content: string): string =
proc getPreprocessor*(fullpath: string, mode = "cpp"): string =
var
mmode = if mode == "cpp": "c++" else: mode
- cmd = &"gcc -E -dD -x{mmode} "
+ cmd = &"gcc -E -dD -x{mmode} -w "
rdata: seq[string] = @[]
start = false
@@ -144,7 +144,7 @@ proc getPreprocessor*(fullpath: string, mode = "cpp"): string =
cmd &= &"\"{fullpath}\""
# Include content only from file
- for line in execAction(cmd, true).splitLines():
+ for line in execAction(cmd).splitLines():
if line.strip() != "":
if line.len > 1 and line[0 .. 1] == "# ":
start = false
diff --git a/nimterop/grammar.nim b/nimterop/grammar.nim
index 693b365..ab80356 100644
--- a/nimterop/grammar.nim
+++ b/nimterop/grammar.nim
@@ -267,7 +267,9 @@ proc initGrammar() =
var
offset = 0
- if gStateRT.data[0].name == "type_identifier":
+ if gStateRT.data.len > 1 and
+ gStateRT.data[0].name == "type_identifier" and
+ gStateRT.data[1].name != "field_identifier":
offset = 1
pStructCommon(ast, node, gStateRT.data[^1].val, offset, 1)