From 19bc408ec6554da592a875ed8dc4d07b8838f975 Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 5 Aug 2012 16:05:17 +0200 Subject: idetools: '--def' now works in 'x.f' --- compiler/astalgo.nim | 6 +++--- compiler/semcall.nim | 6 +++--- compiler/semexprs.nim | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/compiler/astalgo.nim b/compiler/astalgo.nim index 33c31c71d..c40d89d84 100755 --- a/compiler/astalgo.nim +++ b/compiler/astalgo.nim @@ -433,9 +433,9 @@ proc debugTree(n: PNode, indent: int, maxRecDepth: int): PRope = appf(result, ",$N$1\"strVal\": $2", [istr, makeYamlString(n.strVal)]) of nkSym: appf(result, ",$N$1\"sym\": $2_$3", - [istr, symToYaml(n.sym, indent, maxRecDepth), - toRope(n.sym.id)]) - #[istr, toRope(n.sym.name.s), toRope(n.sym.id)]) + [istr, toRope(n.sym.name.s), toRope(n.sym.id)]) + # [istr, symToYaml(n.sym, indent, maxRecDepth), + # toRope(n.sym.id)]) of nkIdent: if n.ident != nil: appf(result, ",$N$1\"ident\": $2", [istr, makeYamlString(n.ident.s)]) diff --git a/compiler/semcall.nim b/compiler/semcall.nim index 5bc4fa29e..eca8d75f0 100755 --- a/compiler/semcall.nim +++ b/compiler/semcall.nim @@ -87,7 +87,7 @@ proc resolveOverloads(c: PContext, n, orig: PNode, proc semResolvedCall(c: PContext, n: PNode, x: TCandidate): PNode = assert x.state == csMatch var finalCallee = x.calleeSym - markUsed(n, finalCallee) + markUsed(n.sons[0], finalCallee) if finalCallee.ast == nil: internalError(n.info, "calleeSym.ast is nil") # XXX: remove this check! if finalCallee.ast.sons[genericParamsPos].kind != nkEmpty: @@ -96,12 +96,12 @@ proc semResolvedCall(c: PContext, n: PNode, x: TCandidate): PNode = finalCallee = generateInstance(c, x.calleeSym, x.bindings, n.info) else: result = x.call - result.sons[0] = newSymNode(finalCallee) + result.sons[0] = newSymNode(finalCallee, result.sons[0].info) result.typ = finalCallee.typ.sons[0] if ContainsGenericType(result.typ): result.typ = errorType(c) return result = x.call - result.sons[0] = newSymNode(finalCallee) + result.sons[0] = newSymNode(finalCallee, result.sons[0].info) result.typ = finalCallee.typ.sons[0] proc semOverloadedCall(c: PContext, n, nOrig: PNode, diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 4e8e80d53..6ace851c3 100755 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -914,9 +914,9 @@ proc semFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode = # BUGFIX: do not check for (f.kind in {skProc, skMethod, skIterator}) here # This special node kind is to merge with the call handler in `semExpr`. result = newNodeI(nkDotCall, n.info) - addSon(result, newIdentNode(i, n.info)) + addSon(result, newIdentNode(i, n[1].info)) addSon(result, copyTree(n[0])) - else: + else: if not ContainsOrIncl(c.UnknownIdents, i.id): LocalError(n.Info, errUndeclaredFieldX, i.s) result = errorNode(c, n) @@ -1461,7 +1461,7 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = if result.typ == nil: result.typ = getSysType(tyChar) of nkDotExpr: result = semFieldAccess(c, n, flags) - if result.kind == nkDotCall: + if result.kind == nkDotCall: result.kind = nkCall result = semExpr(c, result, flags) of nkBind: -- cgit 1.4.1-2-gfad0