[internal] Move Linter OperatorPrecedence into ruff_python_ast crate (#16162)

## Summary

This change begins to resolve #16071 by moving the `OperatorPrecedence`
structs from the `ruff_python_linter` crate into `ruff_python_ast`. This
PR also implements `precedence()` methods on the `Expr` and `ExprRef`
enums.

## Test Plan

Since this change mainly shifts existing logic, I didn't add any
additional tests. Existing tests do pass.
This commit is contained in:
Junhson Jean-Baptiste 2025-02-14 09:55:07 -05:00 committed by GitHub
parent 63dd68e0ed
commit fa28dc5ccf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 193 additions and 168 deletions

View file

@ -5,6 +5,7 @@ pub use expression::*;
pub use generated::*;
pub use int::*;
pub use nodes::*;
pub use operator_precedence::*;
pub mod comparable;
pub mod docstrings;
@ -16,6 +17,7 @@ mod int;
pub mod name;
mod node;
mod nodes;
pub mod operator_precedence;
pub mod parenthesize;
pub mod relocate;
pub mod script;