diff options
-rw-r--r-- | compiler/semgnrc.nim | 6 | ||||
-rw-r--r-- | compiler/semtempl.nim | 14 |
2 files changed, 6 insertions, 14 deletions
diff --git a/compiler/semgnrc.nim b/compiler/semgnrc.nim index ebd361db6..4f3c50dae 100644 --- a/compiler/semgnrc.nim +++ b/compiler/semgnrc.nim @@ -303,8 +303,7 @@ proc semGenericStmt(c: PContext, n: PNode, result = newNodeI(nkCall, n.info) result.add newIdentNode(getIdent(c.cache, "[]"), n.info) for i in 0..<n.len: result.add(n[i]) - withBracketExpr ctx, n[0]: - result = semGenericStmt(c, result, flags, ctx) + result = semGenericStmt(c, result, flags, ctx) of nkAsgn, nkFastAsgn: checkSonsLen(n, 2, c.config) let a = n[0] @@ -323,8 +322,7 @@ proc semGenericStmt(c: PContext, n: PNode, result.add newIdentNode(getIdent(c.cache, "[]="), n.info) for i in 0..<a.len: result.add(a[i]) result.add(b) - withBracketExpr ctx, a[0]: - result = semGenericStmt(c, result, flags, ctx) + result = semGenericStmt(c, result, flags, ctx) else: for i in 0..<n.len: result[i] = semGenericStmt(c, n[i], flags, ctx) diff --git a/compiler/semtempl.nim b/compiler/semtempl.nim index 181cc01db..92cc0be8c 100644 --- a/compiler/semtempl.nim +++ b/compiler/semtempl.nim @@ -131,9 +131,6 @@ type noGenSym: int inTemplateHeader: int -template withBracketExpr(ctx, x, body: untyped) = - body - proc getIdentNode(c: var TemplCtx, n: PNode): PNode = case n.kind of nkPostfix: result = getIdentNode(c, n[1]) @@ -491,9 +488,7 @@ proc semTemplBody(c: var TemplCtx, n: PNode): PNode = result = newNodeI(nkCall, n.info) result.add newIdentNode(getIdent(c.c.cache, "[]"), n.info) for i in 0..<n.len: result.add(n[i]) - let n0 = semTemplBody(c, n[0]) - withBracketExpr c, n0: - result = semTemplBodySons(c, result) + result = semTemplBodySons(c, result) of nkCurlyExpr: result = newNodeI(nkCall, n.info) result.add newIdentNode(getIdent(c.c.cache, "{}"), n.info) @@ -512,8 +507,7 @@ proc semTemplBody(c: var TemplCtx, n: PNode): PNode = for i in 0..<a.len: result.add(a[i]) result.add(b) let a0 = semTemplBody(c, a[0]) - withBracketExpr c, a0: - result = semTemplBodySons(c, result) + result = semTemplBodySons(c, result) of nkCurlyExpr: result = newNodeI(nkCall, n.info) result.add newIdentNode(getIdent(c.c.cache, "{}="), n.info) @@ -644,10 +638,10 @@ proc semTemplateDef(c: PContext, n: PNode): PNode = n[genericParamsPos] = n[miscPos][1] n[miscPos] = c.graph.emptyNode if allUntyped: incl(s.flags, sfAllUntyped) - + if n[patternPos].kind != nkEmpty: n[patternPos] = semPattern(c, n[patternPos]) - + var ctx: TemplCtx ctx.toBind = initIntSet() ctx.toMixin = initIntSet() |