change if parse
This commit is contained in:
parent
2bbc6386ed
commit
559d4c29ed
|
@ -162,12 +162,12 @@ where
|
||||||
// parse the condition
|
// parse the condition
|
||||||
let cond = self.parse_expr(Precedence::Min, false)?;
|
let cond = self.parse_expr(Precedence::Min, false)?;
|
||||||
// parse the true case
|
// parse the true case
|
||||||
let true_case = self.parse_expr(prec, in_group)?;
|
let true_case = self.parse_expr(Precedence::Min, in_group)?;
|
||||||
// and maybe a false case
|
// and maybe a false case
|
||||||
let false_case = matches!(self.try_peek(), Ok(Token::Else))
|
let false_case = matches!(self.try_peek(), Ok(Token::Else))
|
||||||
.then(|| {
|
.then(|| {
|
||||||
self.eat();
|
self.eat();
|
||||||
self.parse_expr(prec, in_group)
|
self.parse_expr(Precedence::Min, in_group)
|
||||||
})
|
})
|
||||||
.transpose()?;
|
.transpose()?;
|
||||||
// pack
|
// pack
|
||||||
|
|
Loading…
Reference in New Issue