conlang: Single-expression functions

This commit is contained in:
2025-02-20 21:59:42 -06:00
parent 3b14186b70
commit 772286eefa
7 changed files with 18 additions and 8 deletions

View File

@@ -459,12 +459,11 @@ impl Parse<'_> for Function {
sign,
bind,
body: match p.peek_kind(P)? {
TokenKind::LCurly => Some(Block::parse(p)?),
TokenKind::Semi => {
p.consume_peeked();
None
}
t => Err(p.error(Unexpected(t), P))?,
_ => Some(Expr::parse(p)?),
},
})
}