fix a regression in tlexerex

This commit is contained in:
Zahary Karadjov 2017-04-10 13:06:06 +03:00
commit 8b63b84924
2 changed files with 14 additions and 14 deletions

View file

@ -1168,6 +1168,7 @@ proc postExprBlocks(p: var TParser, x: PNode): PNode =
result = makeCall(result) result = makeCall(result)
getTok(p) getTok(p)
skipComment(p, result) skipComment(p, result)
if p.tok.tokType notin {tkOf, tkElif, tkElse, tkExcept}:
var stmtList = newNodeP(nkStmtList, p) var stmtList = newNodeP(nkStmtList, p)
let body = parseStmt(p) let body = parseStmt(p)
stmtList.add body stmtList.add body

View file

@ -1,8 +1,7 @@
import macros import macros
macro match*(s: cstring|string; pos: int; sections: untyped): untyped = macro match*(s: cstring|string; pos: int; sections: varargs[untyped]): untyped =
for sec in sections.children: for sec in sections:
expectKind sec, nnkOfBranch expectKind sec, nnkOfBranch
expectLen sec, 2 expectLen sec, 2
result = newStmtList() result = newStmtList()