summary refs log tree commit diff stats
path: root/compiler/parser.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/parser.nim')
-rw-r--r--compiler/parser.nim8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/parser.nim b/compiler/parser.nim
index 902bf0fcb..272c1b15f 100644
--- a/compiler/parser.nim
+++ b/compiler/parser.nim
@@ -514,12 +514,12 @@ proc parsePar(p: var TParser): PNode =
     var a = simpleExpr(p)
     if p.tok.tokType == tkEquals:
       # special case: allow assignments
+      let asgn = newNodeP(nkAsgn, p)
       getTok(p)
       optInd(p, result)
       let b = parseExpr(p)
-      let asgn = newNodeI(nkAsgn, a.info, 2)
-      asgn.sons[0] = a
-      asgn.sons[1] = b
+      asgn.add a
+      asgn.add b
       result.add(asgn)
       if p.tok.tokType == tkSemiColon:
         semiStmtList(p, result)
@@ -1184,10 +1184,10 @@ proc parseExprStmt(p: var TParser): PNode =
   #|            ))?
   var a = simpleExpr(p)
   if p.tok.tokType == tkEquals:
+    result = newNodeP(nkAsgn, p)
     getTok(p)
     optInd(p, result)
     var b = parseExpr(p)
-    result = newNodeI(nkAsgn, a.info)
     addSon(result, a)
     addSon(result, b)
   else: