Added support for syscalls with assignment expressions

This commit is contained in:
2025-12-09 23:57:19 -07:00
parent b21d6cc73e
commit 0fde11a2bf
2 changed files with 23 additions and 5 deletions

View File

@@ -295,7 +295,6 @@ impl<'a> Parser<'a> {
self,
TokenType::Symbol(s) if s.is_operator() || s.is_comparison() || s.is_logical() || matches!(s, Symbol::Assign)
) {
println!("{lhs}");
return Ok(Some(self.infix(lhs)?));
} else if self_matches_current!(
self,
@@ -646,6 +645,15 @@ impl<'a> Parser<'a> {
.node
.ok_or(Error::UnexpectedEOF)?,
TokenType::Identifier(ref id) if SysCall::is_syscall(id) => {
let spanned_call = self.spanned(|p| p.syscall())?;
Spanned {
span: spanned_call.span,
node: Expression::Syscall(spanned_call),
}
}
TokenType::Identifier(_)
if self_matches_peek!(self, TokenType::Symbol(Symbol::LParen)) =>
{