mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Issue 7089: ?? operator
This commit is contained in:
parent
57cab7f69a
commit
c70ceb4f98
7 changed files with 367 additions and 16 deletions
|
@ -941,6 +941,7 @@ fn push_op(buf: &mut Buf, op: BinOp) {
|
|||
called_via::BinOp::And => buf.push_str("&&"),
|
||||
called_via::BinOp::Or => buf.push_str("||"),
|
||||
called_via::BinOp::Pizza => buf.push_str("|>"),
|
||||
called_via::BinOp::DoubleQuestion => buf.push_str("??"),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2223,7 +2224,8 @@ pub fn sub_expr_requests_parens(expr: &Expr<'_>) -> bool {
|
|||
| BinOp::GreaterThanOrEq
|
||||
| BinOp::And
|
||||
| BinOp::Or
|
||||
| BinOp::Pizza => true,
|
||||
| BinOp::Pizza
|
||||
| BinOp::DoubleQuestion => true,
|
||||
})
|
||||
}
|
||||
Expr::If { .. } => true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue