idetools: '--def' now works in 'x.f'
This commit is contained in:
parent
c7158af752
commit
19bc408ec6
3 changed files with 9 additions and 9 deletions
|
|
@ -433,9 +433,9 @@ proc debugTree(n: PNode, indent: int, maxRecDepth: int): PRope =
|
||||||
appf(result, ",$N$1\"strVal\": $2", [istr, makeYamlString(n.strVal)])
|
appf(result, ",$N$1\"strVal\": $2", [istr, makeYamlString(n.strVal)])
|
||||||
of nkSym:
|
of nkSym:
|
||||||
appf(result, ",$N$1\"sym\": $2_$3",
|
appf(result, ",$N$1\"sym\": $2_$3",
|
||||||
[istr, symToYaml(n.sym, indent, maxRecDepth),
|
[istr, toRope(n.sym.name.s), toRope(n.sym.id)])
|
||||||
toRope(n.sym.id)])
|
# [istr, symToYaml(n.sym, indent, maxRecDepth),
|
||||||
#[istr, toRope(n.sym.name.s), toRope(n.sym.id)])
|
# toRope(n.sym.id)])
|
||||||
of nkIdent:
|
of nkIdent:
|
||||||
if n.ident != nil:
|
if n.ident != nil:
|
||||||
appf(result, ",$N$1\"ident\": $2", [istr, makeYamlString(n.ident.s)])
|
appf(result, ",$N$1\"ident\": $2", [istr, makeYamlString(n.ident.s)])
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ proc resolveOverloads(c: PContext, n, orig: PNode,
|
||||||
proc semResolvedCall(c: PContext, n: PNode, x: TCandidate): PNode =
|
proc semResolvedCall(c: PContext, n: PNode, x: TCandidate): PNode =
|
||||||
assert x.state == csMatch
|
assert x.state == csMatch
|
||||||
var finalCallee = x.calleeSym
|
var finalCallee = x.calleeSym
|
||||||
markUsed(n, finalCallee)
|
markUsed(n.sons[0], finalCallee)
|
||||||
if finalCallee.ast == nil:
|
if finalCallee.ast == nil:
|
||||||
internalError(n.info, "calleeSym.ast is nil") # XXX: remove this check!
|
internalError(n.info, "calleeSym.ast is nil") # XXX: remove this check!
|
||||||
if finalCallee.ast.sons[genericParamsPos].kind != nkEmpty:
|
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)
|
finalCallee = generateInstance(c, x.calleeSym, x.bindings, n.info)
|
||||||
else:
|
else:
|
||||||
result = x.call
|
result = x.call
|
||||||
result.sons[0] = newSymNode(finalCallee)
|
result.sons[0] = newSymNode(finalCallee, result.sons[0].info)
|
||||||
result.typ = finalCallee.typ.sons[0]
|
result.typ = finalCallee.typ.sons[0]
|
||||||
if ContainsGenericType(result.typ): result.typ = errorType(c)
|
if ContainsGenericType(result.typ): result.typ = errorType(c)
|
||||||
return
|
return
|
||||||
result = x.call
|
result = x.call
|
||||||
result.sons[0] = newSymNode(finalCallee)
|
result.sons[0] = newSymNode(finalCallee, result.sons[0].info)
|
||||||
result.typ = finalCallee.typ.sons[0]
|
result.typ = finalCallee.typ.sons[0]
|
||||||
|
|
||||||
proc semOverloadedCall(c: PContext, n, nOrig: PNode,
|
proc semOverloadedCall(c: PContext, n, nOrig: PNode,
|
||||||
|
|
|
||||||
|
|
@ -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
|
# 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`.
|
# This special node kind is to merge with the call handler in `semExpr`.
|
||||||
result = newNodeI(nkDotCall, n.info)
|
result = newNodeI(nkDotCall, n.info)
|
||||||
addSon(result, newIdentNode(i, n.info))
|
addSon(result, newIdentNode(i, n[1].info))
|
||||||
addSon(result, copyTree(n[0]))
|
addSon(result, copyTree(n[0]))
|
||||||
else:
|
else:
|
||||||
if not ContainsOrIncl(c.UnknownIdents, i.id):
|
if not ContainsOrIncl(c.UnknownIdents, i.id):
|
||||||
LocalError(n.Info, errUndeclaredFieldX, i.s)
|
LocalError(n.Info, errUndeclaredFieldX, i.s)
|
||||||
result = errorNode(c, n)
|
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)
|
if result.typ == nil: result.typ = getSysType(tyChar)
|
||||||
of nkDotExpr:
|
of nkDotExpr:
|
||||||
result = semFieldAccess(c, n, flags)
|
result = semFieldAccess(c, n, flags)
|
||||||
if result.kind == nkDotCall:
|
if result.kind == nkDotCall:
|
||||||
result.kind = nkCall
|
result.kind = nkCall
|
||||||
result = semExpr(c, result, flags)
|
result = semExpr(c, result, flags)
|
||||||
of nkBind:
|
of nkBind:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue