diff options
Diffstat (limited to 'src/parser/parsers.h')
-rw-r--r-- | src/parser/parsers.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/parser/parsers.h b/src/parser/parsers.h index bbb50b664..25078f354 100644 --- a/src/parser/parsers.h +++ b/src/parser/parsers.h @@ -3028,11 +3028,13 @@ template<typename Ctx> MaybeResult<> func(Ctx& ctx) { CHECK_ERR(l); localVars = *l; } - CHECK_ERR(instrs(ctx)); - ctx.setSrcLoc(ctx.in.takeAnnotations()); + if (!ctx.skipFunctionBody()) { + CHECK_ERR(instrs(ctx)); + ctx.setSrcLoc(ctx.in.takeAnnotations()); + } } - if (!ctx.in.takeRParen()) { + if (!ctx.skipFunctionBody() && !ctx.in.takeRParen()) { return ctx.in.err("expected end of function"); } |