aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)