mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-23 01:51:44 +00:00
Implement ? binop operator
This commit is contained in:
parent
9d37c906fe
commit
b73e4387ae
12 changed files with 291 additions and 55 deletions
|
@ -963,6 +963,7 @@ fn push_op(buf: &mut Buf, op: BinOp) {
|
|||
called_via::BinOp::Or => buf.push_str("||"),
|
||||
called_via::BinOp::Pizza => buf.push_str("|>"),
|
||||
called_via::BinOp::DoubleQuestion => buf.push_str("??"),
|
||||
called_via::BinOp::SingleQuestion => buf.push_str("?"),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2284,7 +2285,8 @@ pub fn sub_expr_requests_parens(expr: &Expr<'_>) -> bool {
|
|||
| BinOp::And
|
||||
| BinOp::Or
|
||||
| BinOp::Pizza
|
||||
| BinOp::DoubleQuestion => true,
|
||||
| BinOp::DoubleQuestion
|
||||
| BinOp::SingleQuestion => true,
|
||||
})
|
||||
}
|
||||
Expr::If { .. } => true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue