about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/errors.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-12-19 18:24:07 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2025-02-27 09:53:17 +1100
commitceafbad81fcf71423d4dc7a90fe962bc5895b108 (patch)
tree263d73b402ee77cdfcfea0adbaf1dec5e2a45433 /compiler/rustc_parse/src/errors.rs
parenta8364f3b2ad63c19037bdf060e49ad9ca07e16b6 (diff)
downloadrust-ceafbad81fcf71423d4dc7a90fe962bc5895b108.tar.gz
rust-ceafbad81fcf71423d4dc7a90fe962bc5895b108.zip
Introduce `AssocOp::Binary`.
It mirrors `ExprKind::Binary`, and contains a `BinOpKind`. This makes
`AssocOp` more like `ExprKind`. Note that the variants removed from
`AssocOp` are all named differently to `BinOpToken`, e.g. `Multiply`
instead of `Mul`, so that's an inconsistency removed.

The commit adds `precedence` and `fixity` methods to `BinOpKind`, and
calls them from the corresponding methods in `AssocOp`. This avoids the
need to create an `AssocOp` from a `BinOpKind` in a bunch of places, and
`AssocOp::from_ast_binop` is removed.

`AssocOp::to_ast_binop` is also no longer needed.

Overall things are shorter and nicer.
Diffstat (limited to 'compiler/rustc_parse/src/errors.rs')
0 files changed, 0 insertions, 0 deletions