From 5a84b2a96dd8b4f512d908d3b9146289cc99c0ad Mon Sep 17 00:00:00 2001 From: mlokr Date: Fri, 19 Jul 2024 13:44:35 +0200 Subject: [PATCH] o --- hblang/src/parser.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hblang/src/parser.rs b/hblang/src/parser.rs index d4ca180..7e3d31b 100644 --- a/hblang/src/parser.rs +++ b/hblang/src/parser.rs @@ -333,7 +333,11 @@ impl<'a, 'b> Parser<'a, 'b> { T::Continue => E::Continue { pos: token.start }, T::Return => E::Return { pos: token.start, - val: (self.token.kind != T::Semi).then(|| self.ptr_expr()), + val: (!matches!( + self.token.kind, + T::Semi | T::RBrace | T::RBrack | T::RParen | T::Comma + )) + .then(|| self.ptr_expr()), }, T::Fn => E::Closure { pos: token.start,