This commit is contained in:
metagn
2023-04-06 14:36:21 +03:00
committed by GitHub
parent 4898b054ce
commit 814d3e6818
2 changed files with 6 additions and 2 deletions

View File

@@ -1197,10 +1197,11 @@ proc parseProcExpr(p: var Parser; isExpr: bool; kind: TNodeKind): PNode =
let pragmas = optPragmas(p)
if p.tok.tokType == tkEquals and isExpr:
getTok(p)
skipComment(p, result)
result = newProcNode(kind, info, body = parseStmt(p),
result = newProcNode(kind, info, body = p.emptyNode,
params = params, name = p.emptyNode, pattern = p.emptyNode,
genericParams = p.emptyNode, pragmas = pragmas, exceptions = p.emptyNode)
skipComment(p, result)
result[bodyPos] = parseStmt(p)
else:
result = newNodeI(if kind == nkIteratorDef: nkIteratorTy else: nkProcTy, info)
if hasSignature:

3
tests/parser/t19430.nim Normal file
View File

@@ -0,0 +1,3 @@
let x = proc() = ## abc
let y = 3 #[tt.Error
^ invalid indentation]#