This commit is contained in:
mlokr 2024-07-19 13:44:35 +02:00
parent c48a2d2799
commit ab903fa4ea
No known key found for this signature in database
GPG key ID: DEA147DDEE644993

View file

@ -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,