allow 'block' and 'nkState' after return for easier state machine generation

This commit is contained in:
Andreas Rumpf
2017-10-19 15:51:36 +02:00
parent 186e7d49d3
commit 8be60dc6bd

View File

@@ -1832,7 +1832,8 @@ proc semStmtList(c: PContext, n: PNode, flags: TExprFlags): PNode =
of LastBlockStmts:
for j in countup(i + 1, length - 1):
case n.sons[j].kind
of nkPragma, nkCommentStmt, nkNilLit, nkEmpty: discard
of nkPragma, nkCommentStmt, nkNilLit, nkEmpty, nkBlockExpr,
nkBlockStmt, nkState: discard
else: localError(n.sons[j].info, errStmtInvalidAfterReturn)
else: discard