-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
In the untyped ast, a node of nnkDo with no arguments is omitted. This makes it indestinguishable from a stmtListExpr
without a do block.
Example
import macros
dumpTree:
foobar("abc") do:
echo 1
foobar("abc") do(abc):
echo 1
foobar("abc", proc() = echo 1)
Current Output
StmtList
Call
Ident "foobar"
StrLit "abc"
StmtList
Command
Ident "echo"
IntLit 1
Call
Ident "foobar"
StrLit "abc"
Do
Empty
Empty
Empty
FormalParams
Empty
IdentDefs
Ident "abc"
Empty
Empty
Empty
Empty
StmtList
Command
Ident "echo"
IntLit 1
Call
Ident "foobar"
StrLit "abc"
Lambda
Empty
Empty
Empty
FormalParams
Empty
Empty
Empty
StmtList
Command
Ident "echo"
IntLit 1
Expected Output
StmtList
Call
Ident "foobar"
StrLit "abc"
Do
Empty
Empty
Empty
FormalParams
Empty
Empty
Empty
StmtList
Command
Ident "echo"
IntLit 1
Call
Ident "foobar"
StrLit "abc"
Do
Empty
Empty
Empty
FormalParams
Empty
IdentDefs
Ident "abc"
Empty
Empty
Empty
Empty
StmtList
Command
Ident "echo"
IntLit 1
Call
Ident "foobar"
StrLit "abc"
Lambda
Empty
Empty
Empty
FormalParams
Empty
Empty
Empty
StmtList
Command
Ident "echo"
IntLit 1
Additional Information
This issue is related: #12110