summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/parser.nim5
-rw-r--r--compiler/semstmts.nim8
2 files changed, 9 insertions, 4 deletions
diff --git a/compiler/parser.nim b/compiler/parser.nim
index dd683eb19..d255949a4 100644
--- a/compiler/parser.nim
+++ b/compiler/parser.nim
@@ -990,7 +990,7 @@ proc primary(p: var TParser, mode: TPrimaryMode): PNode =
   of tkTuple: result = parseTuple(p, mode == pmTypeDef)
   of tkProc: result = parseProcExpr(p, mode notin {pmTypeDesc, pmTypeDef})
   of tkIterator:
-    when true:
+    when false:
       if mode in {pmTypeDesc, pmTypeDef}:
         result = parseProcExpr(p, false)
         result.kind = nkIteratorTy
@@ -1001,7 +1001,8 @@ proc primary(p: var TParser, mode: TPrimaryMode): PNode =
         result = ast.emptyNode
     else:
       result = parseProcExpr(p, mode notin {pmTypeDesc, pmTypeDef})
-      result.kind = nkIteratorTy
+      if result.kind == nkLambda: result.kind = nkIteratorDef
+      else: result.kind = nkIteratorTy
   of tkEnum:
     if mode == pmTypeDef:
       result = parseEnum(p)
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim
index 1aa6a793c..fc1706200 100644
--- a/compiler/semstmts.nim
+++ b/compiler/semstmts.nim
@@ -922,7 +922,7 @@ proc activate(c: PContext, n: PNode) =
     of nkCallKinds:
       for i in 1 .. <n.len: activate(c, n[i])
     else:
-      nil
+      discard
 
 proc maybeAddResult(c: PContext, s: PSym, n: PNode) =
   if s.typ.sons[0] != nil and
@@ -951,7 +951,11 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind,
   var typeIsDetermined = false
   if n[namePos].kind != nkSym:
     assert phase == stepRegisterSymbol
-    s = semIdentDef(c, n.sons[0], kind)
+
+    if n[namePos].kind == nkEmpty:
+      s = newSym(kind, idAnon, getCurrOwner(), n.info)
+    else:
+      s = semIdentDef(c, n.sons[0], kind)
     n.sons[namePos] = newSymNode(s)
     s.ast = n
     s.scope = c.currentScope