mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
@@ -400,7 +400,8 @@ proc exprList(p: var TParser, endTok: TTokType, result: PNode) =
|
||||
proc exprColonEqExprListAux(p: var TParser, endTok: TTokType, result: PNode) =
|
||||
assert(endTok in {tkCurlyRi, tkCurlyDotRi, tkBracketRi, tkParRi})
|
||||
getTok(p)
|
||||
optInd(p, result)
|
||||
flexComment(p, result)
|
||||
optPar(p)
|
||||
# progress guaranteed
|
||||
while p.tok.tokType != endTok and p.tok.tokType != tkEof:
|
||||
var a = exprColonEqExpr(p)
|
||||
@@ -2085,7 +2086,7 @@ proc parseConstant(p: var TParser): PNode =
|
||||
addSon(result, p.emptyNode)
|
||||
eat(p, tkEquals)
|
||||
optInd(p, result)
|
||||
addSon(result, parseExpr(p))
|
||||
addSon(result, parseStmtListExpr(p))
|
||||
indAndComment(p, result)
|
||||
|
||||
proc parseBind(p: var TParser, k: TNodeKind): PNode =
|
||||
|
||||
@@ -58,4 +58,18 @@ block:
|
||||
var y = 2
|
||||
echo "block expression works"
|
||||
y*y
|
||||
doAssert x == 4
|
||||
doAssert x == 4
|
||||
|
||||
|
||||
# bug 10861
|
||||
macro foo(a: untyped): untyped =
|
||||
a
|
||||
|
||||
let c1 = foo:
|
||||
1 + 1
|
||||
|
||||
const c2 = foo:
|
||||
1 + 1
|
||||
|
||||
const c3 =
|
||||
foo: 1 + 1
|
||||
|
||||
Reference in New Issue
Block a user