aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGanesh Viswanathan <dev@genotrance.com>2020-04-19 00:50:14 -0500
committerGanesh Viswanathan <dev@genotrance.com>2020-04-19 00:50:14 -0500
commit485c2f1ab2436094c28eabd97a3a1c02abcddf82 (patch)
treeeabd56f48eead2960713a67b3d9bd9b7c4dd4a39
parente17d6edb5e87f4a74447d3376438dc0d35d95be8 (diff)
downloadnimterop-485c2f1ab2436094c28eabd97a3a1c02abcddf82.tar.gz
nimterop-485c2f1ab2436094c28eabd97a3a1c02abcddf82.zip
ast2 static inline support
-rw-r--r--nimterop/ast2.nim6
-rw-r--r--nimterop/getters.nim3
2 files changed, 7 insertions, 2 deletions
diff --git a/nimterop/ast2.nim b/nimterop/ast2.nim
index 554c507..92d9fc8 100644
--- a/nimterop/ast2.nim
+++ b/nimterop/ast2.nim
@@ -1657,6 +1657,12 @@ proc processNode(nimState: NimState, node: TSNode): bool =
nimState.addEnum(node)
of "declaration":
nimState.addDecl(node)
+ of "function_definition":
+ # Handle static inline
+ let
+ start = getStartAtom(node)
+ if node[start+1].getName() == "function_declarator":
+ nimState.addProc(node[start+1], node[start])
else:
# Unknown
result = false
diff --git a/nimterop/getters.nim b/nimterop/getters.nim
index 6cb7651..502ec89 100644
--- a/nimterop/getters.nim
+++ b/nimterop/getters.nim
@@ -568,8 +568,7 @@ proc getPreprocessor*(gState: State, fullpath: string): string =
rdata.add line
return rdata.join("\n").
replace("__restrict", "").
- replace(re"__attribute__[ ]*\(\(.*?\)\)([ ,;])", "$1").
- removeStatic()
+ replace(re"__attribute__[ ]*\(\(.*?\)\)([ ,;])", "$1")
converter toString*(kind: Kind): string =
return case kind: