* refs #17292 fix `repr` with (discard) * add tests * add more tests
This commit is contained in:
parent
fdd4391534
commit
1b65b9cc19
2 changed files with 45 additions and 13 deletions
|
|
@ -1461,7 +1461,13 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext, fromStmtList = false) =
|
|||
put(g, tkSpaces, Space)
|
||||
putWithSpace(g, tkEquals, "=")
|
||||
gsub(g, n, 1)
|
||||
of nkStmtList, nkStmtListExpr, nkStmtListType: gstmts(g, n, emptyContext)
|
||||
of nkStmtList, nkStmtListExpr, nkStmtListType:
|
||||
if n.len == 1 and n[0].kind == nkDiscardStmt:
|
||||
put(g, tkParLe, "(")
|
||||
gsub(g, n[0])
|
||||
put(g, tkParRi, ")")
|
||||
else:
|
||||
gstmts(g, n, emptyContext)
|
||||
of nkIfStmt:
|
||||
putWithSpace(g, tkIf, "if")
|
||||
gif(g, n)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue