refactoring: removed empty withBracketExpr template (#18152)

This commit is contained in:
Andreas Rumpf 2021-06-02 13:14:10 +02:00 • committed by GitHub
commit 6768f507fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 14 deletions

View file

@ -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)