From 32ff52d9b3f479b0484286dea20eaf7ab3d78825 Mon Sep 17 00:00:00 2001 From: Jeff Date: Thu, 31 Oct 2024 21:40:42 -0400 Subject: [PATCH] Change binary argument handling to fix expression chaining --- dust-lang/src/parser.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dust-lang/src/parser.rs b/dust-lang/src/parser.rs index 37fa803..4611086 100644 --- a/dust-lang/src/parser.rs +++ b/dust-lang/src/parser.rs @@ -492,7 +492,6 @@ impl<'src> Parser<'src> { instruction.b() } - Operation::LoadBoolean => instruction.a(), Operation::Close => { return Err(ParseError::ExpectedExpression { found: self.previous_token.to_owned(), @@ -502,7 +501,11 @@ impl<'src> Parser<'src> { _ => { push_back = true; - self.next_register() + if instruction.yields_value() { + instruction.a() + } else { + self.next_register() + } } };