From 01bc01a30c25ccd6bc3e344adc1f6be38500b6b0 Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Tue, 21 Apr 2020 13:39:20 -0500 Subject: Handle qualifiers after type --- nimterop/ast2.nim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nimterop/ast2.nim b/nimterop/ast2.nim index 23bf774..7c32a21 100644 --- a/nimterop/ast2.nim +++ b/nimterop/ast2.nim @@ -529,9 +529,10 @@ iterator newIdentDefs(nimState: NimState, name: string, node: TSNode, offset: So # struct ABC { int w, h; }; # # This is not applicable for procs. - let + var start = getStartAtom(node) + let # node[start] - param type (tname0, _, tinfo) = nimState.getNameInfo(node[start].getAtom(), nskType, parent = name) @@ -544,6 +545,10 @@ iterator newIdentDefs(nimState: NimState, name: string, node: TSNode, offset: So tident = nimState.getIdent(tname, tinfo, exported = false) + # Skip qualifiers after type + while start < node.len - 1 and node[start+1].getName() == "type_qualifier": + start += 1 + if start == node.len - 1: # Only for proc with no named param - create a param name based on offset # -- cgit v1.2.3