Skip to content

Commit

Permalink
self-hosted change
Browse files Browse the repository at this point in the history
  • Loading branch information
StunxFS committed Dec 7, 2023
1 parent 2169dfb commit 460a9e4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/rivet/src/parser/exprs.ri
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,18 @@ 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,
has_var_obj: true,
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,
Expand Down Expand Up @@ -605,14 +607,15 @@ 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);
if var_is_mut {
var_pos += self.tok.pos;
}
var_name = self.parse_name();
self.expect(.Rparen);
}
if self.accept(.KwIf) {
has_cond = true;
Expand Down

0 comments on commit 460a9e4

Please sign in to comment.