ast2 static inline support

This commit is contained in:
Ganesh Viswanathan 2020-04-19 00:50:14 -05:00
commit 485c2f1ab2
2 changed files with 7 additions and 2 deletions

View file

@ -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

View file

@ -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: