mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-21 23:05:27 +00:00
fix a parsing regression (calls with do inside param lists)
This treatment is applied only when "do" is used, because the code foo(x: bar) is recognized as object construction.
This commit is contained in:
@@ -211,6 +211,18 @@ StmtList
|
||||
StmtList
|
||||
DiscardStmt
|
||||
Empty
|
||||
Call
|
||||
Ident !"foo"
|
||||
Ident !"x"
|
||||
Call
|
||||
Ident !"bar"
|
||||
StmtList
|
||||
DiscardStmt
|
||||
Empty
|
||||
Else
|
||||
StmtList
|
||||
DiscardStmt
|
||||
Empty
|
||||
VarSection
|
||||
IdentDefs
|
||||
Ident !"a"
|
||||
@@ -432,6 +444,13 @@ dumpTree:
|
||||
else:
|
||||
discard
|
||||
|
||||
# call with blocks as a param
|
||||
foo(x, bar do:
|
||||
discard
|
||||
else:
|
||||
discard
|
||||
)
|
||||
|
||||
# introduce a variable
|
||||
var a = foo
|
||||
var a = foo()
|
||||
|
||||
Reference in New Issue
Block a user