Simply create the `nnkObjConstr` first, then add your `ColonExpr` nodes to 
that. Something like this:
    
    
    var myObj = nnkObjConstr.newTree(newIdentNode(strVal(name)))
    for field in fields:
      myObj.add newColonExpr(newIdentNode($field[0]), nodeMap(field[1]))
    
    
    Run

Reply via email to