summary refs log tree commit diff stats
path: root/rod/sigmatch.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-02-12 19:24:20 +0100
committerAraq <rumpf_a@web.de>2011-02-12 19:24:20 +0100
commit5b28d08203ba36e84c8e381761db182c0393d07f (patch)
tree9f1fdcb65d8617b65672305327a208bb030405c7 /rod/sigmatch.nim
parent27dc54cbda0beffe8bca36d9cc59cccaf0b2d30f (diff)
downloadNim-5b28d08203ba36e84c8e381761db182c0393d07f.tar.gz
non-nil AST; continue after errors for IDE support
Diffstat (limited to 'rod/sigmatch.nim')
-rwxr-xr-xrod/sigmatch.nim15
1 files changed, 8 insertions, 7 deletions
diff --git a/rod/sigmatch.nim b/rod/sigmatch.nim
index bcb9198da..cddfc89cb 100755
--- a/rod/sigmatch.nim
+++ b/rod/sigmatch.nim
@@ -443,7 +443,7 @@ proc implicitConv(kind: TNodeKind, f: PType, arg: PNode, m: TCandidate,
   if containsGenericType(f): result.typ = getInstantiatedType(c, arg, m, f)
   else: result.typ = f
   if result.typ == nil: InternalError(arg.info, "implicitConv")
-  addSon(result, nil)
+  addSon(result, ast.emptyNode)
   addSon(result, arg)
 
 proc userConvMatch(c: PContext, m: var TCandidate, f, a: PType, 
@@ -578,7 +578,7 @@ proc matches(c: PContext, n: PNode, m: var TCandidate) =
       # named param
       # check if m.callee has such a param:
       if n.sons[a].sons[0].kind != nkIdent: 
-        liMessage(n.sons[a].info, errNamedParamHasToBeIdent)
+        LocalError(n.sons[a].info, errNamedParamHasToBeIdent)
         m.state = csNoMatch
         return 
       formal = getSymFromList(m.callee.n, n.sons[a].sons[0].ident, 1)
@@ -588,7 +588,7 @@ proc matches(c: PContext, n: PNode, m: var TCandidate) =
         return 
       if IntSetContainsOrIncl(marker, formal.position): 
         # already in namedParams:
-        liMessage(n.sons[a].info, errCannotBindXTwice, formal.name.s)
+        LocalError(n.sons[a].info, errCannotBindXTwice, formal.name.s)
         m.state = csNoMatch
         return 
       m.baseTypeMatch = false
@@ -633,7 +633,7 @@ proc matches(c: PContext, n: PNode, m: var TCandidate) =
         formal = m.callee.n.sons[f].sym
         if IntSetContainsOrIncl(marker, formal.position): 
           # already in namedParams:
-          liMessage(n.sons[a].info, errCannotBindXTwice, formal.name.s)
+          LocalError(n.sons[a].info, errCannotBindXTwice, formal.name.s)
           m.state = csNoMatch
           return 
         m.baseTypeMatch = false
@@ -683,12 +683,13 @@ proc semDirectCallWithBinding(c: PContext, n, f: PNode, filter: TSymKinds,
   var
     o: TOverloadIter
     x, y, z: TCandidate
-  #liMessage(n.info, warnUser, renderTree(n));
+  #Message(n.info, warnUser, renderTree(n))
   var sym = initOverloadIter(o, c, f)
   result = nil
   if sym == nil: return 
   initCandidate(x, sym, initialBinding)
   initCandidate(y, sym, initialBinding)
+
   while sym != nil: 
     if sym.kind in filter: 
       initCandidate(z, sym, initialBinding)
@@ -711,7 +712,7 @@ proc semDirectCallWithBinding(c: PContext, n, f: PNode, filter: TSymKinds,
       not sameMethodDispatcher(x.calleeSym, y.calleeSym): 
     if x.state != csMatch: 
       InternalError(n.info, "x.state is not csMatch") 
-    liMessage(n.Info, errGenerated, msgKindToString(errAmbiguousCallXYZ) % [
+    LocalError(n.Info, errGenerated, msgKindToString(errAmbiguousCallXYZ) % [
       getProcHeader(x.calleeSym), getProcHeader(y.calleeSym), 
       x.calleeSym.Name.s])
   else: 
@@ -719,7 +720,7 @@ proc semDirectCallWithBinding(c: PContext, n, f: PNode, filter: TSymKinds,
     markUsed(n, x.calleeSym)
     if x.calleeSym.ast == nil: 
       internalError(n.info, "calleeSym.ast is nil") # XXX: remove this check!
-    if x.calleeSym.ast.sons[genericParamsPos] != nil: 
+    if x.calleeSym.ast.sons[genericParamsPos].kind != nkEmpty: 
       # a generic proc!
       x.calleeSym = generateInstance(c, x.calleeSym, x.bindings, n.info)
       x.callee = x.calleeSym.typ