mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-03 04:24:45 +00:00
…ismatched indentation with repr fixes #24850
This commit is contained in:
@@ -326,3 +326,27 @@ do:
|
||||
|
||||
static: main()
|
||||
main()
|
||||
|
||||
import std/macros
|
||||
|
||||
# bug #24850
|
||||
macro a() =
|
||||
let
|
||||
y = quote do: discard
|
||||
b = nnkIfStmt.newTree(
|
||||
nnkElifExpr.newTree(ident "true", y), nnkElseExpr.newTree(y))
|
||||
d = nnkWhenStmt.newTree(
|
||||
nnkElifExpr.newTree(ident "true", y), nnkElseExpr.newTree(y))
|
||||
doAssert repr(b) == """
|
||||
if true:
|
||||
discard
|
||||
else:
|
||||
discard"""
|
||||
|
||||
doAssert repr(d) == """
|
||||
when true:
|
||||
discard
|
||||
else:
|
||||
discard"""
|
||||
|
||||
a()
|
||||
|
||||
Reference in New Issue
Block a user