idetools: '--def' now works in 'x.f'

This commit is contained in:
Araq
2012-08-05 16:05:17 +02:00
parent c7158af752
commit 19bc408ec6
3 changed files with 9 additions and 9 deletions

View File

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

View File

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

View File

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