Remove customizable reference enum names (#15647)

The AST generator creates a reference enum for each syntax group — an
enum where each variant contains a reference to the relevant syntax
node. Previously you could customize the name of the reference enum for
a group — primarily because there was an existing `ExpressionRef` type
that wouldn't have lined up with the auto-derived name `ExprRef`. This
follow-up PR is a simple search/replace to switch over to the
auto-derived name, so that we can remove this customization point.
This commit is contained in:
Douglas Creager 2025-01-21 13:46:31 -05:00 committed by GitHub
parent fa546b20a6
commit ef85c682bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 223 additions and 231 deletions

View file

@ -2,7 +2,7 @@ use ruff_python_trivia::{BackwardsTokenizer, CommentRanges, SimpleTokenKind, Sim
use ruff_text_size::{Ranged, TextLen, TextRange};
use crate::AnyNodeRef;
use crate::ExpressionRef;
use crate::ExprRef;
/// Returns an iterator over the ranges of the optional parentheses surrounding an expression.
///
@ -12,7 +12,7 @@ use crate::ExpressionRef;
/// parentheses around `a` even if the parentheses actually belong to `f`. That is why you should
/// generally prefer [`parenthesized_range`].
pub fn parentheses_iterator<'a>(
expr: ExpressionRef<'a>,
expr: ExprRef<'a>,
parent: Option<AnyNodeRef>,
comment_ranges: &'a CommentRanges,
source: &'a str,
@ -58,7 +58,7 @@ pub fn parentheses_iterator<'a>(
/// Returns the [`TextRange`] of a given expression including parentheses, if the expression is
/// parenthesized; or `None`, if the expression is not parenthesized.
pub fn parenthesized_range(
expr: ExpressionRef,
expr: ExprRef,
parent: AnyNodeRef,
comment_ranges: &CommentRanges,
source: &str,