diff --git a/src/parser.bux b/src/parser.bux index 1332785..7a0e7a8 100644 --- a/src/parser.bux +++ b/src/parser.bux @@ -1006,6 +1006,11 @@ func parserParseFuncDecl(p: *Parser, isPublic: bool, isExtern: bool, isAsync: bo // Body if !isExtern && parserCheck(p, tkLBrace) { d.refBody = parserParseBlock(p); + // HACK: if parserParseBlock left a stray } at current position, + // consume it. Without this, the module handler exits early. + if parserCheck(p, tkRBrace) { + discard parserAdvance(p); + } } else { d.refBody = null as *Block; }