mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
only store start position for PrecedenceConflict
This commit is contained in:
parent
d22acb521e
commit
9208000316
4 changed files with 41 additions and 6 deletions
|
@ -47,6 +47,18 @@ pub enum BinOp {
|
|||
Backpassing,
|
||||
}
|
||||
|
||||
impl BinOp {
|
||||
/// how wide this operator is when typed out
|
||||
pub fn width(self) -> u16 {
|
||||
match self {
|
||||
Caret | Star | Slash | Percent | Plus | Minus | LessThan | GreaterThan => 1,
|
||||
DoubleSlash | DoublePercent | Equals | NotEquals | LessThanOrEq | GreaterThanOrEq
|
||||
| And | Or | Pizza => 2,
|
||||
Assignment | HasType | Backpassing => unreachable!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub enum ArgSide {
|
||||
Left,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue