From 460a9e414d99b7a6a5a4d76b1887e71024d6c159 Mon Sep 17 00:00:00 2001 From: Jose Mendoza <56417208+StunxFS@users.noreply.github.com> Date: Thu, 7 Dec 2023 18:09:48 +0000 Subject: [PATCH] self-hosted change --- lib/rivet/src/parser/exprs.ri | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/rivet/src/parser/exprs.ri b/lib/rivet/src/parser/exprs.ri index ca188dfa0..681340295 100644 --- a/lib/rivet/src/parser/exprs.ri +++ b/lib/rivet/src/parser/exprs.ri @@ -92,8 +92,8 @@ extend Parser { } else { .Type(self.parse_type()) }; - if self.accept(.KwAs) { - .Binary( + if self.accept(.Lparen) { + val := Expr.Binary( left: left, right: right, op: op, @@ -101,7 +101,9 @@ extend Parser { var_obj: self.parse_var_decl(support_ref: false), scope: self.scope, pos: left.position() + self.prev_tok.pos - ) + ); + self.expect(.Rparen); + val } else { .Binary( left: left, @@ -605,7 +607,7 @@ extend Parser { break; } } - if self.accept(.KwAs) { + if self.accept(.Lparen) { has_var = true; var_pos = self.tok.pos; var_is_mut = self.accept(.KwMut); @@ -613,6 +615,7 @@ extend Parser { var_pos += self.tok.pos; } var_name = self.parse_name(); + self.expect(.Rparen); } if self.accept(.KwIf) { has_cond = true;