aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGanesh Viswanathan <dev@genotrance.com>2020-04-21 13:39:20 -0500
committerGanesh Viswanathan <dev@genotrance.com>2020-04-21 13:39:20 -0500
commit01bc01a30c25ccd6bc3e344adc1f6be38500b6b0 (patch)
treecce6bcbb92de958c2802dda2acc0533451ec664c
parent82ca3bd37b1587e3c39708e51ed44375b322c111 (diff)
downloadnimterop-01bc01a30c25ccd6bc3e344adc1f6be38500b6b0.tar.gz
nimterop-01bc01a30c25ccd6bc3e344adc1f6be38500b6b0.zip
Handle qualifiers after type
-rw-r--r--nimterop/ast2.nim7
1 files changed, 6 insertions, 1 deletions
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
#