From 6271fba1e1c01c9c49a360b1084217955145bce6 Mon Sep 17 00:00:00 2001 From: Takayuki Maeda Date: Wed, 22 Oct 2025 15:24:34 +0900 Subject: [PATCH] [`ruff`] Auto generate ast Pattern nodes (#21024) --- crates/ruff_python_ast/ast.toml | 51 +- crates/ruff_python_ast/generate.py | 2 + crates/ruff_python_ast/src/generated.rs | 193 +++++++ crates/ruff_python_ast/src/node.rs | 114 ---- crates/ruff_python_ast/src/nodes.rs | 86 +-- ...alid_syntax@async_unexpected_token.py.snap | 2 +- ..._syntax@case_expect_indented_block.py.snap | 4 +- .../invalid_syntax@debug_shadow_match.py.snap | 2 +- ...x@different_match_pattern_bindings.py.snap | 150 ++--- ..._syntax@duplicate_match_class_attr.py.snap | 54 +- ...invalid_syntax@duplicate_match_key.py.snap | 100 ++-- ...id_syntax@irrefutable_case_pattern.py.snap | 22 +- .../invalid_syntax@match_before_py310.py.snap | 2 +- ...d_syntax@match_classify_as_keyword.py.snap | 2 +- ..._classify_as_keyword_or_identifier.py.snap | 2 +- ...nvalid_syntax@match_expected_colon.py.snap | 2 +- ...x@match_stmt_expect_indented_block.py.snap | 2 +- ...tax@match_stmt_expected_case_block.py.snap | 2 +- ...ntax@match_stmt_invalid_guard_expr.py.snap | 6 +- ...ax@match_stmt_invalid_subject_expr.py.snap | 6 +- ...ntax@match_stmt_missing_guard_expr.py.snap | 2 +- ..._syntax@match_stmt_missing_pattern.py.snap | 2 +- ...@match_stmt_no_newline_before_case.py.snap | 2 +- ...@match_stmt_single_starred_subject.py.snap | 2 +- ...ultiple_assignment_in_case_pattern.py.snap | 66 +-- ...ax@statements__match__as_pattern_0.py.snap | 6 +- ...ax@statements__match__as_pattern_1.py.snap | 2 +- ...ax@statements__match__as_pattern_2.py.snap | 4 +- ...ax@statements__match__as_pattern_3.py.snap | 6 +- ...ax@statements__match__as_pattern_4.py.snap | 6 +- ...ents__match__invalid_class_pattern.py.snap | 24 +- ..._match__invalid_lhs_or_rhs_pattern.py.snap | 36 +- ...ts__match__invalid_mapping_pattern.py.snap | 34 +- ...tements__match__star_pattern_usage.py.snap | 42 +- ...statements__match__unary_add_usage.py.snap | 30 +- ...ntax@class_keyword_in_case_pattern.py.snap | 4 +- ...x@different_match_pattern_bindings.py.snap | 60 +- ...id_syntax@duplicate_match_key_attr.py.snap | 6 +- ...valid_syntax@expressions__f_string.py.snap | 4 +- ...valid_syntax@expressions__t_string.py.snap | 4 +- ...ax@irrefutable_case_pattern_at_end.py.snap | 12 +- .../valid_syntax@match_after_py310.py.snap | 2 +- .../valid_syntax@match_as_pattern.py.snap | 4 +- ...ntax@match_as_pattern_soft_keyword.py.snap | 6 +- ...ax@match_attr_pattern_soft_keyword.py.snap | 8 +- ...syntax@match_classify_as_keyword_1.py.snap | 24 +- ...syntax@match_classify_as_keyword_2.py.snap | 12 +- ..._classify_as_keyword_or_identifier.py.snap | 6 +- ...nce_pattern_parentheses_terminator.py.snap | 12 +- ...@match_sequence_pattern_terminator.py.snap | 16 +- ...lid_syntax@match_stmt_subject_expr.py.snap | 8 +- ...syntax@match_stmt_valid_guard_expr.py.snap | 8 +- ...ultiple_assignment_in_case_pattern.py.snap | 12 +- .../valid_syntax@statement__match.py.snap | 542 +++++++++--------- 54 files changed, 928 insertions(+), 890 deletions(-) diff --git a/crates/ruff_python_ast/ast.toml b/crates/ruff_python_ast/ast.toml index 38a9415515..e2c6fd2844 100644 --- a/crates/ruff_python_ast/ast.toml +++ b/crates/ruff_python_ast/ast.toml @@ -559,15 +559,48 @@ InterpolatedStringLiteralElement = { variant = "Literal" } [Pattern] doc = "See also [pattern](https://docs.python.org/3/library/ast.html#ast.pattern)" -[Pattern.nodes] -PatternMatchValue = {} -PatternMatchSingleton = {} -PatternMatchSequence = {} -PatternMatchMapping = {} -PatternMatchClass = {} -PatternMatchStar = {} -PatternMatchAs = {} -PatternMatchOr = {} +[Pattern.nodes.PatternMatchValue] +doc = "See also [MatchValue](https://docs.python.org/3/library/ast.html#ast.MatchValue)" +fields = [{ name = "value", type = "Box" }] + +[Pattern.nodes.PatternMatchSingleton] +doc = "See also [MatchSingleton](https://docs.python.org/3/library/ast.html#ast.MatchSingleton)" +fields = [{ name = "value", type = "Singleton" }] + +[Pattern.nodes.PatternMatchSequence] +doc = "See also [MatchSequence](https://docs.python.org/3/library/ast.html#ast.MatchSequence)" +fields = [{ name = "patterns", type = "Pattern*" }] + +[Pattern.nodes.PatternMatchMapping] +doc = "See also [MatchMapping](https://docs.python.org/3/library/ast.html#ast.MatchMapping)" +fields = [ + { name = "keys", type = "Expr*" }, + { name = "patterns", type = "Pattern*" }, + { name = "rest", type = "Identifier?" }, +] +custom_source_order = true + +[Pattern.nodes.PatternMatchClass] +doc = "See also [MatchClass](https://docs.python.org/3/library/ast.html#ast.MatchClass)" +fields = [ + { name = "cls", type = "Box" }, + { name = "arguments", type = "PatternArguments" }, +] + +[Pattern.nodes.PatternMatchStar] +doc = "See also [MatchStar](https://docs.python.org/3/library/ast.html#ast.MatchStar)" +fields = [{ name = "name", type = "Identifier?" }] + +[Pattern.nodes.PatternMatchAs] +doc = "See also [MatchAs](https://docs.python.org/3/library/ast.html#ast.MatchAs)" +fields = [ + { name = "pattern", type = "Box?" }, + { name = "name", type = "Identifier?" }, +] + +[Pattern.nodes.PatternMatchOr] +doc = "See also [MatchOr](https://docs.python.org/3/library/ast.html#ast.MatchOr)" +fields = [{ name = "patterns", type = "Pattern*" }] [TypeParam] doc = "See also [type_param](https://docs.python.org/3/library/ast.html#ast.type_param)" diff --git a/crates/ruff_python_ast/generate.py b/crates/ruff_python_ast/generate.py index 2b8687b233..7ed8646f5b 100644 --- a/crates/ruff_python_ast/generate.py +++ b/crates/ruff_python_ast/generate.py @@ -38,6 +38,8 @@ types_requiring_crate_prefix = { "WithItem", "MatchCase", "Alias", + "Singleton", + "PatternArguments", } diff --git a/crates/ruff_python_ast/src/generated.rs b/crates/ruff_python_ast/src/generated.rs index 935595705d..8cf0ad9009 100644 --- a/crates/ruff_python_ast/src/generated.rs +++ b/crates/ruff_python_ast/src/generated.rs @@ -9637,6 +9637,82 @@ pub struct ExprIpyEscapeCommand { pub value: Box, } +/// See also [MatchValue](https://docs.python.org/3/library/ast.html#ast.MatchValue) +#[derive(Clone, Debug, PartialEq)] +#[cfg_attr(feature = "get-size", derive(get_size2::GetSize))] +pub struct PatternMatchValue { + pub node_index: crate::AtomicNodeIndex, + pub range: ruff_text_size::TextRange, + pub value: Box, +} + +/// See also [MatchSingleton](https://docs.python.org/3/library/ast.html#ast.MatchSingleton) +#[derive(Clone, Debug, PartialEq)] +#[cfg_attr(feature = "get-size", derive(get_size2::GetSize))] +pub struct PatternMatchSingleton { + pub node_index: crate::AtomicNodeIndex, + pub range: ruff_text_size::TextRange, + pub value: crate::Singleton, +} + +/// See also [MatchSequence](https://docs.python.org/3/library/ast.html#ast.MatchSequence) +#[derive(Clone, Debug, PartialEq)] +#[cfg_attr(feature = "get-size", derive(get_size2::GetSize))] +pub struct PatternMatchSequence { + pub node_index: crate::AtomicNodeIndex, + pub range: ruff_text_size::TextRange, + pub patterns: Vec, +} + +/// See also [MatchMapping](https://docs.python.org/3/library/ast.html#ast.MatchMapping) +#[derive(Clone, Debug, PartialEq)] +#[cfg_attr(feature = "get-size", derive(get_size2::GetSize))] +pub struct PatternMatchMapping { + pub node_index: crate::AtomicNodeIndex, + pub range: ruff_text_size::TextRange, + pub keys: Vec, + pub patterns: Vec, + pub rest: Option, +} + +/// See also [MatchClass](https://docs.python.org/3/library/ast.html#ast.MatchClass) +#[derive(Clone, Debug, PartialEq)] +#[cfg_attr(feature = "get-size", derive(get_size2::GetSize))] +pub struct PatternMatchClass { + pub node_index: crate::AtomicNodeIndex, + pub range: ruff_text_size::TextRange, + pub cls: Box, + pub arguments: crate::PatternArguments, +} + +/// See also [MatchStar](https://docs.python.org/3/library/ast.html#ast.MatchStar) +#[derive(Clone, Debug, PartialEq)] +#[cfg_attr(feature = "get-size", derive(get_size2::GetSize))] +pub struct PatternMatchStar { + pub node_index: crate::AtomicNodeIndex, + pub range: ruff_text_size::TextRange, + pub name: Option, +} + +/// See also [MatchAs](https://docs.python.org/3/library/ast.html#ast.MatchAs) +#[derive(Clone, Debug, PartialEq)] +#[cfg_attr(feature = "get-size", derive(get_size2::GetSize))] +pub struct PatternMatchAs { + pub node_index: crate::AtomicNodeIndex, + pub range: ruff_text_size::TextRange, + pub pattern: Option>, + pub name: Option, +} + +/// See also [MatchOr](https://docs.python.org/3/library/ast.html#ast.MatchOr) +#[derive(Clone, Debug, PartialEq)] +#[cfg_attr(feature = "get-size", derive(get_size2::GetSize))] +pub struct PatternMatchOr { + pub node_index: crate::AtomicNodeIndex, + pub range: ruff_text_size::TextRange, + pub patterns: Vec, +} + impl ModModule { pub(crate) fn visit_source_order<'a, V>(&'a self, visitor: &mut V) where @@ -10585,3 +10661,120 @@ impl ExprIpyEscapeCommand { } = self; } } + +impl PatternMatchValue { + pub(crate) fn visit_source_order<'a, V>(&'a self, visitor: &mut V) + where + V: SourceOrderVisitor<'a> + ?Sized, + { + let PatternMatchValue { + value, + range: _, + node_index: _, + } = self; + visitor.visit_expr(value); + } +} + +impl PatternMatchSingleton { + pub(crate) fn visit_source_order<'a, V>(&'a self, visitor: &mut V) + where + V: SourceOrderVisitor<'a> + ?Sized, + { + let PatternMatchSingleton { + value, + range: _, + node_index: _, + } = self; + visitor.visit_singleton(value); + } +} + +impl PatternMatchSequence { + pub(crate) fn visit_source_order<'a, V>(&'a self, visitor: &mut V) + where + V: SourceOrderVisitor<'a> + ?Sized, + { + let PatternMatchSequence { + patterns, + range: _, + node_index: _, + } = self; + + for elm in patterns { + visitor.visit_pattern(elm); + } + } +} + +impl PatternMatchClass { + pub(crate) fn visit_source_order<'a, V>(&'a self, visitor: &mut V) + where + V: SourceOrderVisitor<'a> + ?Sized, + { + let PatternMatchClass { + cls, + arguments, + range: _, + node_index: _, + } = self; + visitor.visit_expr(cls); + visitor.visit_pattern_arguments(arguments); + } +} + +impl PatternMatchStar { + pub(crate) fn visit_source_order<'a, V>(&'a self, visitor: &mut V) + where + V: SourceOrderVisitor<'a> + ?Sized, + { + let PatternMatchStar { + name, + range: _, + node_index: _, + } = self; + + if let Some(name) = name { + visitor.visit_identifier(name); + } + } +} + +impl PatternMatchAs { + pub(crate) fn visit_source_order<'a, V>(&'a self, visitor: &mut V) + where + V: SourceOrderVisitor<'a> + ?Sized, + { + let PatternMatchAs { + pattern, + name, + range: _, + node_index: _, + } = self; + + if let Some(pattern) = pattern { + visitor.visit_pattern(pattern); + } + + if let Some(name) = name { + visitor.visit_identifier(name); + } + } +} + +impl PatternMatchOr { + pub(crate) fn visit_source_order<'a, V>(&'a self, visitor: &mut V) + where + V: SourceOrderVisitor<'a> + ?Sized, + { + let PatternMatchOr { + patterns, + range: _, + node_index: _, + } = self; + + for elm in patterns { + visitor.visit_pattern(elm); + } + } +} diff --git a/crates/ruff_python_ast/src/node.rs b/crates/ruff_python_ast/src/node.rs index 58ad37925c..202315964d 100644 --- a/crates/ruff_python_ast/src/node.rs +++ b/crates/ruff_python_ast/src/node.rs @@ -235,50 +235,6 @@ impl ast::ExceptHandlerExceptHandler { } } -impl ast::PatternMatchValue { - pub(crate) fn visit_source_order<'a, V>(&'a self, visitor: &mut V) - where - V: SourceOrderVisitor<'a> + ?Sized, - { - let ast::PatternMatchValue { - value, - range: _, - node_index: _, - } = self; - visitor.visit_expr(value); - } -} - -impl ast::PatternMatchSingleton { - pub(crate) fn visit_source_order<'a, V>(&'a self, visitor: &mut V) - where - V: SourceOrderVisitor<'a> + ?Sized, - { - let ast::PatternMatchSingleton { - value, - range: _, - node_index: _, - } = self; - visitor.visit_singleton(value); - } -} - -impl ast::PatternMatchSequence { - pub(crate) fn visit_source_order<'a, V>(&'a self, visitor: &mut V) - where - V: SourceOrderVisitor<'a> + ?Sized, - { - let ast::PatternMatchSequence { - patterns, - range: _, - node_index: _, - } = self; - for pattern in patterns { - visitor.visit_pattern(pattern); - } - } -} - impl ast::PatternMatchMapping { pub(crate) fn visit_source_order<'a, V>(&'a self, visitor: &mut V) where @@ -311,76 +267,6 @@ impl ast::PatternMatchMapping { } } -impl ast::PatternMatchClass { - pub(crate) fn visit_source_order<'a, V>(&'a self, visitor: &mut V) - where - V: SourceOrderVisitor<'a> + ?Sized, - { - let ast::PatternMatchClass { - cls, - arguments: parameters, - range: _, - node_index: _, - } = self; - visitor.visit_expr(cls); - visitor.visit_pattern_arguments(parameters); - } -} - -impl ast::PatternMatchStar { - pub(crate) fn visit_source_order<'a, V>(&'a self, visitor: &mut V) - where - V: SourceOrderVisitor<'a> + ?Sized, - { - let ast::PatternMatchStar { - range: _, - node_index: _, - name, - } = self; - - if let Some(name) = name { - visitor.visit_identifier(name); - } - } -} - -impl ast::PatternMatchAs { - pub(crate) fn visit_source_order<'a, V>(&'a self, visitor: &mut V) - where - V: SourceOrderVisitor<'a> + ?Sized, - { - let ast::PatternMatchAs { - pattern, - range: _, - node_index: _, - name, - } = self; - if let Some(pattern) = pattern { - visitor.visit_pattern(pattern); - } - - if let Some(name) = name { - visitor.visit_identifier(name); - } - } -} - -impl ast::PatternMatchOr { - pub(crate) fn visit_source_order<'a, V>(&'a self, visitor: &mut V) - where - V: SourceOrderVisitor<'a> + ?Sized, - { - let ast::PatternMatchOr { - patterns, - range: _, - node_index: _, - } = self; - for pattern in patterns { - visitor.visit_pattern(pattern); - } - } -} - impl ast::PatternArguments { pub(crate) fn visit_source_order<'a, V>(&'a self, visitor: &mut V) where diff --git a/crates/ruff_python_ast/src/nodes.rs b/crates/ruff_python_ast/src/nodes.rs index 55c055e5bb..d26be06da5 100644 --- a/crates/ruff_python_ast/src/nodes.rs +++ b/crates/ruff_python_ast/src/nodes.rs @@ -3,7 +3,7 @@ use crate::AtomicNodeIndex; use crate::generated::{ ExprBytesLiteral, ExprDict, ExprFString, ExprList, ExprName, ExprSet, ExprStringLiteral, - ExprTString, ExprTuple, StmtClassDef, + ExprTString, ExprTuple, PatternMatchAs, PatternMatchOr, StmtClassDef, }; use std::borrow::Cow; use std::fmt; @@ -2848,58 +2848,10 @@ pub enum IrrefutablePatternKind { Wildcard, } -/// See also [MatchValue](https://docs.python.org/3/library/ast.html#ast.MatchValue) -#[derive(Clone, Debug, PartialEq)] -#[cfg_attr(feature = "get-size", derive(get_size2::GetSize))] -pub struct PatternMatchValue { - pub range: TextRange, - pub node_index: AtomicNodeIndex, - pub value: Box, -} - -/// See also [MatchSingleton](https://docs.python.org/3/library/ast.html#ast.MatchSingleton) -#[derive(Clone, Debug, PartialEq)] -#[cfg_attr(feature = "get-size", derive(get_size2::GetSize))] -pub struct PatternMatchSingleton { - pub range: TextRange, - pub node_index: AtomicNodeIndex, - pub value: Singleton, -} - -/// See also [MatchSequence](https://docs.python.org/3/library/ast.html#ast.MatchSequence) -#[derive(Clone, Debug, PartialEq)] -#[cfg_attr(feature = "get-size", derive(get_size2::GetSize))] -pub struct PatternMatchSequence { - pub range: TextRange, - pub node_index: AtomicNodeIndex, - pub patterns: Vec, -} - -/// See also [MatchMapping](https://docs.python.org/3/library/ast.html#ast.MatchMapping) -#[derive(Clone, Debug, PartialEq)] -#[cfg_attr(feature = "get-size", derive(get_size2::GetSize))] -pub struct PatternMatchMapping { - pub range: TextRange, - pub node_index: AtomicNodeIndex, - pub keys: Vec, - pub patterns: Vec, - pub rest: Option, -} - -/// See also [MatchClass](https://docs.python.org/3/library/ast.html#ast.MatchClass) -#[derive(Clone, Debug, PartialEq)] -#[cfg_attr(feature = "get-size", derive(get_size2::GetSize))] -pub struct PatternMatchClass { - pub range: TextRange, - pub node_index: AtomicNodeIndex, - pub cls: Box, - pub arguments: PatternArguments, -} - -/// An AST node to represent the arguments to a [`PatternMatchClass`], i.e., the +/// An AST node to represent the arguments to a [`crate::PatternMatchClass`], i.e., the /// parenthesized contents in `case Point(1, x=0, y=0)`. /// -/// Like [`Arguments`], but for [`PatternMatchClass`]. +/// Like [`Arguments`], but for [`crate::PatternMatchClass`]. #[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "get-size", derive(get_size2::GetSize))] pub struct PatternArguments { @@ -2909,10 +2861,10 @@ pub struct PatternArguments { pub keywords: Vec, } -/// An AST node to represent the keyword arguments to a [`PatternMatchClass`], i.e., the +/// An AST node to represent the keyword arguments to a [`crate::PatternMatchClass`], i.e., the /// `x=0` and `y=0` in `case Point(x=0, y=0)`. /// -/// Like [`Keyword`], but for [`PatternMatchClass`]. +/// Like [`Keyword`], but for [`crate::PatternMatchClass`]. #[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "get-size", derive(get_size2::GetSize))] pub struct PatternKeyword { @@ -2922,34 +2874,6 @@ pub struct PatternKeyword { pub pattern: Pattern, } -/// See also [MatchStar](https://docs.python.org/3/library/ast.html#ast.MatchStar) -#[derive(Clone, Debug, PartialEq)] -#[cfg_attr(feature = "get-size", derive(get_size2::GetSize))] -pub struct PatternMatchStar { - pub range: TextRange, - pub node_index: AtomicNodeIndex, - pub name: Option, -} - -/// See also [MatchAs](https://docs.python.org/3/library/ast.html#ast.MatchAs) -#[derive(Clone, Debug, PartialEq)] -#[cfg_attr(feature = "get-size", derive(get_size2::GetSize))] -pub struct PatternMatchAs { - pub range: TextRange, - pub node_index: AtomicNodeIndex, - pub pattern: Option>, - pub name: Option, -} - -/// See also [MatchOr](https://docs.python.org/3/library/ast.html#ast.MatchOr) -#[derive(Clone, Debug, PartialEq)] -#[cfg_attr(feature = "get-size", derive(get_size2::GetSize))] -pub struct PatternMatchOr { - pub range: TextRange, - pub node_index: AtomicNodeIndex, - pub patterns: Vec, -} - impl TypeParam { pub const fn name(&self) -> &Identifier { match self { diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@async_unexpected_token.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@async_unexpected_token.py.snap index 7d5b8fd56a..2dd2bddfc4 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@async_unexpected_token.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@async_unexpected_token.py.snap @@ -148,8 +148,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 109..110, node_index: NodeIndex(None), + range: 109..110, pattern: None, name: None, }, diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@case_expect_indented_block.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@case_expect_indented_block.py.snap index 99c12452b7..952ba305f7 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@case_expect_indented_block.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@case_expect_indented_block.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 24..25, node_index: NodeIndex(None), + range: 24..25, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -49,8 +49,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 36..37, node_index: NodeIndex(None), + range: 36..37, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_match.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_match.py.snap index 16b505fcf9..0fe9d38d82 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_match.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_match.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 18..27, node_index: NodeIndex(None), + range: 18..27, pattern: None, name: Some( Identifier { diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@different_match_pattern_bindings.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@different_match_pattern_bindings.py.snap index a2ec2aa024..588dbe3cd8 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@different_match_pattern_bindings.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@different_match_pattern_bindings.py.snap @@ -28,18 +28,18 @@ Module( node_index: NodeIndex(None), pattern: MatchOr( PatternMatchOr { - range: 18..27, node_index: NodeIndex(None), + range: 18..27, patterns: [ MatchSequence( PatternMatchSequence { - range: 18..21, node_index: NodeIndex(None), + range: 18..21, patterns: [ MatchAs( PatternMatchAs { - range: 19..20, node_index: NodeIndex(None), + range: 19..20, pattern: None, name: Some( Identifier { @@ -55,13 +55,13 @@ Module( ), MatchSequence( PatternMatchSequence { - range: 24..27, node_index: NodeIndex(None), + range: 24..27, patterns: [ MatchAs( PatternMatchAs { - range: 25..26, node_index: NodeIndex(None), + range: 25..26, pattern: None, name: Some( Identifier { @@ -99,18 +99,18 @@ Module( node_index: NodeIndex(None), pattern: MatchOr( PatternMatchOr { - range: 42..50, node_index: NodeIndex(None), + range: 42..50, patterns: [ MatchSequence( PatternMatchSequence { - range: 42..45, node_index: NodeIndex(None), + range: 42..45, patterns: [ MatchAs( PatternMatchAs { - range: 43..44, node_index: NodeIndex(None), + range: 43..44, pattern: None, name: Some( Identifier { @@ -126,8 +126,8 @@ Module( ), MatchSequence( PatternMatchSequence { - range: 48..50, node_index: NodeIndex(None), + range: 48..50, patterns: [], }, ), @@ -155,18 +155,18 @@ Module( node_index: NodeIndex(None), pattern: MatchOr( PatternMatchOr { - range: 65..78, node_index: NodeIndex(None), + range: 65..78, patterns: [ MatchSequence( PatternMatchSequence { - range: 65..71, node_index: NodeIndex(None), + range: 65..71, patterns: [ MatchAs( PatternMatchAs { - range: 66..67, node_index: NodeIndex(None), + range: 66..67, pattern: None, name: Some( Identifier { @@ -179,8 +179,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 69..70, node_index: NodeIndex(None), + range: 69..70, pattern: None, name: Some( Identifier { @@ -196,13 +196,13 @@ Module( ), MatchSequence( PatternMatchSequence { - range: 74..78, node_index: NodeIndex(None), + range: 74..78, patterns: [ MatchAs( PatternMatchAs { - range: 75..76, node_index: NodeIndex(None), + range: 75..76, pattern: None, name: Some( Identifier { @@ -240,18 +240,18 @@ Module( node_index: NodeIndex(None), pattern: MatchOr( PatternMatchOr { - range: 93..108, node_index: NodeIndex(None), + range: 93..108, patterns: [ MatchSequence( PatternMatchSequence { - range: 93..99, node_index: NodeIndex(None), + range: 93..99, patterns: [ MatchAs( PatternMatchAs { - range: 94..95, node_index: NodeIndex(None), + range: 94..95, pattern: None, name: Some( Identifier { @@ -264,8 +264,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 97..98, node_index: NodeIndex(None), + range: 97..98, pattern: None, name: None, }, @@ -275,13 +275,13 @@ Module( ), MatchSequence( PatternMatchSequence { - range: 102..108, node_index: NodeIndex(None), + range: 102..108, patterns: [ MatchAs( PatternMatchAs { - range: 103..104, node_index: NodeIndex(None), + range: 103..104, pattern: None, name: Some( Identifier { @@ -294,8 +294,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 106..107, node_index: NodeIndex(None), + range: 106..107, pattern: None, name: Some( Identifier { @@ -333,13 +333,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 123..135, node_index: NodeIndex(None), + range: 123..135, patterns: [ MatchAs( PatternMatchAs { - range: 124..125, node_index: NodeIndex(None), + range: 124..125, pattern: None, name: Some( Identifier { @@ -352,13 +352,13 @@ Module( ), MatchOr( PatternMatchOr { - range: 128..133, node_index: NodeIndex(None), + range: 128..133, patterns: [ MatchAs( PatternMatchAs { - range: 128..129, node_index: NodeIndex(None), + range: 128..129, pattern: None, name: Some( Identifier { @@ -371,8 +371,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 132..133, node_index: NodeIndex(None), + range: 132..133, pattern: None, name: Some( Identifier { @@ -410,18 +410,18 @@ Module( node_index: NodeIndex(None), pattern: MatchOr( PatternMatchOr { - range: 150..165, node_index: NodeIndex(None), + range: 150..165, patterns: [ MatchSequence( PatternMatchSequence { - range: 150..153, node_index: NodeIndex(None), + range: 150..153, patterns: [ MatchAs( PatternMatchAs { - range: 151..152, node_index: NodeIndex(None), + range: 151..152, pattern: None, name: Some( Identifier { @@ -437,13 +437,13 @@ Module( ), MatchSequence( PatternMatchSequence { - range: 156..159, node_index: NodeIndex(None), + range: 156..159, patterns: [ MatchAs( PatternMatchAs { - range: 157..158, node_index: NodeIndex(None), + range: 157..158, pattern: None, name: Some( Identifier { @@ -459,13 +459,13 @@ Module( ), MatchSequence( PatternMatchSequence { - range: 162..165, node_index: NodeIndex(None), + range: 162..165, patterns: [ MatchAs( PatternMatchAs { - range: 163..164, node_index: NodeIndex(None), + range: 163..164, pattern: None, name: Some( Identifier { @@ -503,25 +503,25 @@ Module( node_index: NodeIndex(None), pattern: MatchOr( PatternMatchOr { - range: 180..188, node_index: NodeIndex(None), + range: 180..188, patterns: [ MatchSequence( PatternMatchSequence { - range: 180..182, node_index: NodeIndex(None), + range: 180..182, patterns: [], }, ), MatchSequence( PatternMatchSequence { - range: 185..188, node_index: NodeIndex(None), + range: 185..188, patterns: [ MatchAs( PatternMatchAs { - range: 186..187, node_index: NodeIndex(None), + range: 186..187, pattern: None, name: Some( Identifier { @@ -559,18 +559,18 @@ Module( node_index: NodeIndex(None), pattern: MatchOr( PatternMatchOr { - range: 203..215, node_index: NodeIndex(None), + range: 203..215, patterns: [ MatchSequence( PatternMatchSequence { - range: 203..206, node_index: NodeIndex(None), + range: 203..206, patterns: [ MatchAs( PatternMatchAs { - range: 204..205, node_index: NodeIndex(None), + range: 204..205, pattern: None, name: Some( Identifier { @@ -586,13 +586,13 @@ Module( ), MatchSequence( PatternMatchSequence { - range: 209..215, node_index: NodeIndex(None), + range: 209..215, patterns: [ MatchClass( PatternMatchClass { - range: 210..214, node_index: NodeIndex(None), + range: 210..214, cls: Name( ExprName { node_index: NodeIndex(None), @@ -607,8 +607,8 @@ Module( patterns: [ MatchAs( PatternMatchAs { - range: 212..213, node_index: NodeIndex(None), + range: 212..213, pattern: None, name: Some( Identifier { @@ -651,23 +651,23 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 230..241, node_index: NodeIndex(None), + range: 230..241, patterns: [ MatchOr( PatternMatchOr { - range: 231..240, node_index: NodeIndex(None), + range: 231..240, patterns: [ MatchSequence( PatternMatchSequence { - range: 231..234, node_index: NodeIndex(None), + range: 231..234, patterns: [ MatchAs( PatternMatchAs { - range: 232..233, node_index: NodeIndex(None), + range: 232..233, pattern: None, name: Some( Identifier { @@ -683,13 +683,13 @@ Module( ), MatchSequence( PatternMatchSequence { - range: 237..240, node_index: NodeIndex(None), + range: 237..240, patterns: [ MatchAs( PatternMatchAs { - range: 238..239, node_index: NodeIndex(None), + range: 238..239, pattern: None, name: Some( Identifier { @@ -730,18 +730,18 @@ Module( node_index: NodeIndex(None), pattern: MatchOr( PatternMatchOr { - range: 256..271, node_index: NodeIndex(None), + range: 256..271, patterns: [ MatchSequence( PatternMatchSequence { - range: 256..262, node_index: NodeIndex(None), + range: 256..262, patterns: [ MatchClass( PatternMatchClass { - range: 257..261, node_index: NodeIndex(None), + range: 257..261, cls: Name( ExprName { node_index: NodeIndex(None), @@ -756,8 +756,8 @@ Module( patterns: [ MatchAs( PatternMatchAs { - range: 259..260, node_index: NodeIndex(None), + range: 259..260, pattern: None, name: Some( Identifier { @@ -778,13 +778,13 @@ Module( ), MatchSequence( PatternMatchSequence { - range: 265..271, node_index: NodeIndex(None), + range: 265..271, patterns: [ MatchClass( PatternMatchClass { - range: 266..270, node_index: NodeIndex(None), + range: 266..270, cls: Name( ExprName { node_index: NodeIndex(None), @@ -799,8 +799,8 @@ Module( patterns: [ MatchAs( PatternMatchAs { - range: 268..269, node_index: NodeIndex(None), + range: 268..269, pattern: None, name: Some( Identifier { @@ -843,18 +843,18 @@ Module( node_index: NodeIndex(None), pattern: MatchOr( PatternMatchOr { - range: 286..307, node_index: NodeIndex(None), + range: 286..307, patterns: [ MatchSequence( PatternMatchSequence { - range: 286..295, node_index: NodeIndex(None), + range: 286..295, patterns: [ MatchClass( PatternMatchClass { - range: 287..294, node_index: NodeIndex(None), + range: 287..294, cls: Name( ExprName { node_index: NodeIndex(None), @@ -869,8 +869,8 @@ Module( patterns: [ MatchClass( PatternMatchClass { - range: 289..293, node_index: NodeIndex(None), + range: 289..293, cls: Name( ExprName { node_index: NodeIndex(None), @@ -885,8 +885,8 @@ Module( patterns: [ MatchAs( PatternMatchAs { - range: 291..292, node_index: NodeIndex(None), + range: 291..292, pattern: None, name: Some( Identifier { @@ -912,13 +912,13 @@ Module( ), MatchSequence( PatternMatchSequence { - range: 298..307, node_index: NodeIndex(None), + range: 298..307, patterns: [ MatchClass( PatternMatchClass { - range: 299..306, node_index: NodeIndex(None), + range: 299..306, cls: Name( ExprName { node_index: NodeIndex(None), @@ -933,8 +933,8 @@ Module( patterns: [ MatchClass( PatternMatchClass { - range: 301..305, node_index: NodeIndex(None), + range: 301..305, cls: Name( ExprName { node_index: NodeIndex(None), @@ -949,8 +949,8 @@ Module( patterns: [ MatchAs( PatternMatchAs { - range: 303..304, node_index: NodeIndex(None), + range: 303..304, pattern: None, name: Some( Identifier { @@ -998,23 +998,23 @@ Module( node_index: NodeIndex(None), pattern: MatchOr( PatternMatchOr { - range: 322..341, node_index: NodeIndex(None), + range: 322..341, patterns: [ MatchSequence( PatternMatchSequence { - range: 322..330, node_index: NodeIndex(None), + range: 322..330, patterns: [ MatchSequence( PatternMatchSequence { - range: 323..329, node_index: NodeIndex(None), + range: 323..329, patterns: [ MatchAs( PatternMatchAs { - range: 324..325, node_index: NodeIndex(None), + range: 324..325, pattern: None, name: Some( Identifier { @@ -1027,8 +1027,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 327..328, node_index: NodeIndex(None), + range: 327..328, pattern: None, name: Some( Identifier { @@ -1047,18 +1047,18 @@ Module( ), MatchSequence( PatternMatchSequence { - range: 333..341, node_index: NodeIndex(None), + range: 333..341, patterns: [ MatchSequence( PatternMatchSequence { - range: 334..340, node_index: NodeIndex(None), + range: 334..340, patterns: [ MatchAs( PatternMatchAs { - range: 335..336, node_index: NodeIndex(None), + range: 335..336, pattern: None, name: Some( Identifier { @@ -1071,8 +1071,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 338..339, node_index: NodeIndex(None), + range: 338..339, pattern: None, name: Some( Identifier { diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@duplicate_match_class_attr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@duplicate_match_class_attr.py.snap index 63067a4b3c..83e2d732da 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@duplicate_match_class_attr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@duplicate_match_class_attr.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchClass( PatternMatchClass { - range: 18..33, node_index: NodeIndex(None), + range: 18..33, cls: Name( ExprName { node_index: NodeIndex(None), @@ -53,8 +53,8 @@ Module( }, pattern: MatchValue( PatternMatchValue { - range: 26..27, node_index: NodeIndex(None), + range: 26..27, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -77,8 +77,8 @@ Module( }, pattern: MatchValue( PatternMatchValue { - range: 31..32, node_index: NodeIndex(None), + range: 31..32, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -116,13 +116,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 48..65, node_index: NodeIndex(None), + range: 48..65, patterns: [ MatchClass( PatternMatchClass { - range: 49..64, node_index: NodeIndex(None), + range: 49..64, cls: Name( ExprName { node_index: NodeIndex(None), @@ -146,8 +146,8 @@ Module( }, pattern: MatchValue( PatternMatchValue { - range: 57..58, node_index: NodeIndex(None), + range: 57..58, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -170,8 +170,8 @@ Module( }, pattern: MatchValue( PatternMatchValue { - range: 62..63, node_index: NodeIndex(None), + range: 62..63, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -212,8 +212,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 80..108, node_index: NodeIndex(None), + range: 80..108, keys: [ StringLiteral( ExprStringLiteral { @@ -261,8 +261,8 @@ Module( patterns: [ MatchAs( PatternMatchAs { - range: 86..87, node_index: NodeIndex(None), + range: 86..87, pattern: None, name: Some( Identifier { @@ -275,8 +275,8 @@ Module( ), MatchClass( PatternMatchClass { - range: 94..107, node_index: NodeIndex(None), + range: 94..107, cls: Name( ExprName { node_index: NodeIndex(None), @@ -300,8 +300,8 @@ Module( }, pattern: MatchValue( PatternMatchValue { - range: 100..101, node_index: NodeIndex(None), + range: 100..101, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -324,8 +324,8 @@ Module( }, pattern: MatchValue( PatternMatchValue { - range: 105..106, node_index: NodeIndex(None), + range: 105..106, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -367,13 +367,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 123..157, node_index: NodeIndex(None), + range: 123..157, patterns: [ MatchMapping( PatternMatchMapping { - range: 124..126, node_index: NodeIndex(None), + range: 124..126, keys: [], patterns: [], rest: None, @@ -381,8 +381,8 @@ Module( ), MatchMapping( PatternMatchMapping { - range: 128..156, node_index: NodeIndex(None), + range: 128..156, keys: [ StringLiteral( ExprStringLiteral { @@ -430,8 +430,8 @@ Module( patterns: [ MatchAs( PatternMatchAs { - range: 134..135, node_index: NodeIndex(None), + range: 134..135, pattern: None, name: Some( Identifier { @@ -444,8 +444,8 @@ Module( ), MatchClass( PatternMatchClass { - range: 142..155, node_index: NodeIndex(None), + range: 142..155, cls: Name( ExprName { node_index: NodeIndex(None), @@ -469,8 +469,8 @@ Module( }, pattern: MatchValue( PatternMatchValue { - range: 148..149, node_index: NodeIndex(None), + range: 148..149, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -493,8 +493,8 @@ Module( }, pattern: MatchValue( PatternMatchValue { - range: 153..154, node_index: NodeIndex(None), + range: 153..154, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -539,8 +539,8 @@ Module( node_index: NodeIndex(None), pattern: MatchClass( PatternMatchClass { - range: 172..225, node_index: NodeIndex(None), + range: 172..225, cls: Name( ExprName { node_index: NodeIndex(None), @@ -564,8 +564,8 @@ Module( }, pattern: MatchValue( PatternMatchValue { - range: 180..181, node_index: NodeIndex(None), + range: 180..181, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -588,8 +588,8 @@ Module( }, pattern: MatchMapping( PatternMatchMapping { - range: 185..201, node_index: NodeIndex(None), + range: 185..201, keys: [ StringLiteral( ExprStringLiteral { @@ -637,8 +637,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 191..192, node_index: NodeIndex(None), + range: 191..192, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -652,8 +652,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 199..200, node_index: NodeIndex(None), + range: 199..200, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -680,8 +680,8 @@ Module( }, pattern: MatchClass( PatternMatchClass { - range: 209..224, node_index: NodeIndex(None), + range: 209..224, cls: Name( ExprName { node_index: NodeIndex(None), @@ -705,8 +705,8 @@ Module( }, pattern: MatchValue( PatternMatchValue { - range: 217..218, node_index: NodeIndex(None), + range: 217..218, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -729,8 +729,8 @@ Module( }, pattern: MatchValue( PatternMatchValue { - range: 222..223, node_index: NodeIndex(None), + range: 222..223, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@duplicate_match_key.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@duplicate_match_key.py.snap index aec92ae959..9ebc6f8748 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@duplicate_match_key.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@duplicate_match_key.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 18..34, node_index: NodeIndex(None), + range: 18..34, keys: [ StringLiteral( ExprStringLiteral { @@ -77,8 +77,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 24..25, node_index: NodeIndex(None), + range: 24..25, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -92,8 +92,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 32..33, node_index: NodeIndex(None), + range: 32..33, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -130,8 +130,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 49..67, node_index: NodeIndex(None), + range: 49..67, keys: [ BytesLiteral( ExprBytesLiteral { @@ -183,8 +183,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 56..57, node_index: NodeIndex(None), + range: 56..57, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -198,8 +198,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 65..66, node_index: NodeIndex(None), + range: 65..66, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -236,8 +236,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 82..94, node_index: NodeIndex(None), + range: 82..94, keys: [ NumberLiteral( ExprNumberLiteral { @@ -261,8 +261,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 86..87, node_index: NodeIndex(None), + range: 86..87, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -276,8 +276,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 92..93, node_index: NodeIndex(None), + range: 92..93, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -314,8 +314,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 109..125, node_index: NodeIndex(None), + range: 109..125, keys: [ NumberLiteral( ExprNumberLiteral { @@ -339,8 +339,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 115..116, node_index: NodeIndex(None), + range: 115..116, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -354,8 +354,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 123..124, node_index: NodeIndex(None), + range: 123..124, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -392,8 +392,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 140..166, node_index: NodeIndex(None), + range: 140..166, keys: [ BinOp( ExprBinOp { @@ -451,8 +451,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 151..152, node_index: NodeIndex(None), + range: 151..152, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -466,8 +466,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 164..165, node_index: NodeIndex(None), + range: 164..165, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -504,8 +504,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 181..199, node_index: NodeIndex(None), + range: 181..199, keys: [ BooleanLiteral( ExprBooleanLiteral { @@ -525,8 +525,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 188..189, node_index: NodeIndex(None), + range: 188..189, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -540,8 +540,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 197..198, node_index: NodeIndex(None), + range: 197..198, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -578,8 +578,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 214..232, node_index: NodeIndex(None), + range: 214..232, keys: [ NoneLiteral( ExprNoneLiteral { @@ -597,8 +597,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 221..222, node_index: NodeIndex(None), + range: 221..222, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -612,8 +612,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 230..231, node_index: NodeIndex(None), + range: 230..231, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -650,8 +650,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 247..314, node_index: NodeIndex(None), + range: 247..314, keys: [ StringLiteral( ExprStringLiteral { @@ -699,8 +699,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 279..280, node_index: NodeIndex(None), + range: 279..280, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -714,8 +714,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 312..313, node_index: NodeIndex(None), + range: 312..313, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -752,8 +752,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 329..353, node_index: NodeIndex(None), + range: 329..353, keys: [ StringLiteral( ExprStringLiteral { @@ -822,8 +822,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 335..336, node_index: NodeIndex(None), + range: 335..336, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -837,8 +837,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 343..344, node_index: NodeIndex(None), + range: 343..344, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -852,8 +852,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 351..352, node_index: NodeIndex(None), + range: 351..352, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -890,8 +890,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 368..396, node_index: NodeIndex(None), + range: 368..396, keys: [ NumberLiteral( ExprNumberLiteral { @@ -957,8 +957,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 372..373, node_index: NodeIndex(None), + range: 372..373, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -972,8 +972,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 380..381, node_index: NodeIndex(None), + range: 380..381, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -987,8 +987,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 386..387, node_index: NodeIndex(None), + range: 386..387, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -1002,8 +1002,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 394..395, node_index: NodeIndex(None), + range: 394..395, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -1040,13 +1040,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 411..429, node_index: NodeIndex(None), + range: 411..429, patterns: [ MatchMapping( PatternMatchMapping { - range: 412..428, node_index: NodeIndex(None), + range: 412..428, keys: [ StringLiteral( ExprStringLiteral { @@ -1094,8 +1094,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 418..419, node_index: NodeIndex(None), + range: 418..419, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -1109,8 +1109,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 426..427, node_index: NodeIndex(None), + range: 426..427, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -1150,8 +1150,8 @@ Module( node_index: NodeIndex(None), pattern: MatchClass( PatternMatchClass { - range: 444..472, node_index: NodeIndex(None), + range: 444..472, cls: Name( ExprName { node_index: NodeIndex(None), @@ -1175,8 +1175,8 @@ Module( }, pattern: MatchValue( PatternMatchValue { - range: 450..451, node_index: NodeIndex(None), + range: 450..451, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -1199,8 +1199,8 @@ Module( }, pattern: MatchMapping( PatternMatchMapping { - range: 455..471, node_index: NodeIndex(None), + range: 455..471, keys: [ StringLiteral( ExprStringLiteral { @@ -1248,8 +1248,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 461..462, node_index: NodeIndex(None), + range: 461..462, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -1263,8 +1263,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 469..470, node_index: NodeIndex(None), + range: 469..470, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -1306,13 +1306,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 487..527, node_index: NodeIndex(None), + range: 487..527, patterns: [ MatchClass( PatternMatchClass { - range: 488..496, node_index: NodeIndex(None), + range: 488..496, cls: Name( ExprName { node_index: NodeIndex(None), @@ -1336,8 +1336,8 @@ Module( }, pattern: MatchValue( PatternMatchValue { - range: 494..495, node_index: NodeIndex(None), + range: 494..495, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -1356,8 +1356,8 @@ Module( ), MatchClass( PatternMatchClass { - range: 498..526, node_index: NodeIndex(None), + range: 498..526, cls: Name( ExprName { node_index: NodeIndex(None), @@ -1381,8 +1381,8 @@ Module( }, pattern: MatchValue( PatternMatchValue { - range: 504..505, node_index: NodeIndex(None), + range: 504..505, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -1405,8 +1405,8 @@ Module( }, pattern: MatchMapping( PatternMatchMapping { - range: 509..525, node_index: NodeIndex(None), + range: 509..525, keys: [ StringLiteral( ExprStringLiteral { @@ -1454,8 +1454,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 515..516, node_index: NodeIndex(None), + range: 515..516, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -1469,8 +1469,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 523..524, node_index: NodeIndex(None), + range: 523..524, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@irrefutable_case_pattern.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@irrefutable_case_pattern.py.snap index 00d25b2f52..e92cdb2db1 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@irrefutable_case_pattern.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@irrefutable_case_pattern.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 18..21, node_index: NodeIndex(None), + range: 18..21, pattern: None, name: Some( Identifier { @@ -61,8 +61,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 55..56, node_index: NodeIndex(None), + range: 55..56, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -111,8 +111,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 80..81, node_index: NodeIndex(None), + range: 80..81, pattern: None, name: None, }, @@ -138,8 +138,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 96..97, node_index: NodeIndex(None), + range: 96..97, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -188,13 +188,13 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 143..155, node_index: NodeIndex(None), + range: 143..155, pattern: Some( MatchAs( PatternMatchAs { - range: 143..147, node_index: NodeIndex(None), + range: 143..147, pattern: None, name: Some( Identifier { @@ -236,8 +236,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 216..217, node_index: NodeIndex(None), + range: 216..217, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -286,13 +286,13 @@ Module( node_index: NodeIndex(None), pattern: MatchOr( PatternMatchOr { - range: 241..259, node_index: NodeIndex(None), + range: 241..259, patterns: [ MatchValue( PatternMatchValue { - range: 241..253, node_index: NodeIndex(None), + range: 241..253, value: Attribute( ExprAttribute { node_index: NodeIndex(None), @@ -317,8 +317,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 256..259, node_index: NodeIndex(None), + range: 256..259, pattern: None, name: Some( Identifier { @@ -353,8 +353,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 310..311, node_index: NodeIndex(None), + range: 310..311, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_before_py310.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_before_py310.py.snap index ee6bbd4bd0..391c87863e 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_before_py310.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_before_py310.py.snap @@ -29,8 +29,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 63..64, node_index: NodeIndex(None), + range: 63..64, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_classify_as_keyword.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_classify_as_keyword.py.snap index f30f13e7be..47f410992c 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_classify_as_keyword.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_classify_as_keyword.py.snap @@ -36,8 +36,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 26..27, node_index: NodeIndex(None), + range: 26..27, pattern: None, name: None, }, diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_classify_as_keyword_or_identifier.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_classify_as_keyword_or_identifier.py.snap index 531219c2b7..4696b90ac2 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_classify_as_keyword_or_identifier.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_classify_as_keyword_or_identifier.py.snap @@ -35,8 +35,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 32..33, node_index: NodeIndex(None), + range: 32..33, pattern: None, name: None, }, diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_expected_colon.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_expected_colon.py.snap index a3b0a5de38..f352512262 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_expected_colon.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_expected_colon.py.snap @@ -47,8 +47,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 22..23, node_index: NodeIndex(None), + range: 22..23, pattern: None, name: None, }, diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_expect_indented_block.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_expect_indented_block.py.snap index 3f165716fd..60781de936 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_expect_indented_block.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_expect_indented_block.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 16..17, node_index: NodeIndex(None), + range: 16..17, pattern: None, name: None, }, diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_expected_case_block.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_expected_case_block.py.snap index 491b242611..8aaaa11d01 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_expected_case_block.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_expected_case_block.py.snap @@ -83,8 +83,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 54..55, node_index: NodeIndex(None), + range: 54..55, pattern: None, name: None, }, diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_invalid_guard_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_invalid_guard_expr.py.snap index 73bce3400e..967dfc2d2e 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_invalid_guard_expr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_invalid_guard_expr.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 18..19, node_index: NodeIndex(None), + range: 18..19, pattern: None, name: Some( Identifier { @@ -93,8 +93,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 49..50, node_index: NodeIndex(None), + range: 49..50, pattern: None, name: Some( Identifier { @@ -158,8 +158,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 82..83, node_index: NodeIndex(None), + range: 82..83, pattern: None, name: Some( Identifier { diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_invalid_subject_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_invalid_subject_expr.py.snap index 1db01735fb..537bf08d6b 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_invalid_subject_expr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_invalid_subject_expr.py.snap @@ -35,8 +35,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 21..22, node_index: NodeIndex(None), + range: 21..22, pattern: None, name: None, }, @@ -120,8 +120,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 93..94, node_index: NodeIndex(None), + range: 93..94, pattern: None, name: None, }, @@ -171,8 +171,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 124..125, node_index: NodeIndex(None), + range: 124..125, pattern: None, name: None, }, diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_missing_guard_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_missing_guard_expr.py.snap index ebaf34464b..bf66acae17 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_missing_guard_expr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_missing_guard_expr.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 18..19, node_index: NodeIndex(None), + range: 18..19, pattern: None, name: Some( Identifier { diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_missing_pattern.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_missing_pattern.py.snap index ddc7872be1..84fad76972 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_missing_pattern.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_missing_pattern.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 17..17, node_index: NodeIndex(None), + range: 17..17, value: Name( ExprName { node_index: NodeIndex(None), diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_no_newline_before_case.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_no_newline_before_case.py.snap index b904a97ae4..324f3480ff 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_no_newline_before_case.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_no_newline_before_case.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 16..17, node_index: NodeIndex(None), + range: 16..17, pattern: None, name: None, }, diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_single_starred_subject.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_single_starred_subject.py.snap index 8ad5469d41..67fa5c7067 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_single_starred_subject.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_single_starred_subject.py.snap @@ -35,8 +35,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 21..22, node_index: NodeIndex(None), + range: 21..22, pattern: None, name: None, }, diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@multiple_assignment_in_case_pattern.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@multiple_assignment_in_case_pattern.py.snap index fbedd8e0ee..3aed113557 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@multiple_assignment_in_case_pattern.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@multiple_assignment_in_case_pattern.py.snap @@ -29,13 +29,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 18..27, node_index: NodeIndex(None), + range: 18..27, patterns: [ MatchAs( PatternMatchAs { - range: 19..20, node_index: NodeIndex(None), + range: 19..20, pattern: None, name: Some( Identifier { @@ -48,8 +48,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 22..23, node_index: NodeIndex(None), + range: 22..23, pattern: None, name: Some( Identifier { @@ -62,8 +62,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 25..26, node_index: NodeIndex(None), + range: 25..26, pattern: None, name: Some( Identifier { @@ -98,13 +98,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 59..69, node_index: NodeIndex(None), + range: 59..69, patterns: [ MatchAs( PatternMatchAs { - range: 60..61, node_index: NodeIndex(None), + range: 60..61, pattern: None, name: Some( Identifier { @@ -117,8 +117,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 63..64, node_index: NodeIndex(None), + range: 63..64, pattern: None, name: Some( Identifier { @@ -131,8 +131,8 @@ Module( ), MatchStar( PatternMatchStar { - range: 66..68, node_index: NodeIndex(None), + range: 66..68, name: Some( Identifier { id: Name("y"), @@ -166,13 +166,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 101..110, node_index: NodeIndex(None), + range: 101..110, patterns: [ MatchAs( PatternMatchAs { - range: 102..103, node_index: NodeIndex(None), + range: 102..103, pattern: None, name: Some( Identifier { @@ -185,8 +185,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 105..106, node_index: NodeIndex(None), + range: 105..106, pattern: None, name: Some( Identifier { @@ -199,8 +199,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 108..109, node_index: NodeIndex(None), + range: 108..109, pattern: None, name: Some( Identifier { @@ -235,8 +235,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 151..163, node_index: NodeIndex(None), + range: 151..163, keys: [ NumberLiteral( ExprNumberLiteral { @@ -260,8 +260,8 @@ Module( patterns: [ MatchAs( PatternMatchAs { - range: 155..156, node_index: NodeIndex(None), + range: 155..156, pattern: None, name: Some( Identifier { @@ -274,8 +274,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 161..162, node_index: NodeIndex(None), + range: 161..162, pattern: None, name: Some( Identifier { @@ -311,8 +311,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 212..223, node_index: NodeIndex(None), + range: 212..223, keys: [ NumberLiteral( ExprNumberLiteral { @@ -327,8 +327,8 @@ Module( patterns: [ MatchAs( PatternMatchAs { - range: 216..217, node_index: NodeIndex(None), + range: 216..217, pattern: None, name: Some( Identifier { @@ -370,8 +370,8 @@ Module( node_index: NodeIndex(None), pattern: MatchClass( PatternMatchClass { - range: 274..285, node_index: NodeIndex(None), + range: 274..285, cls: Name( ExprName { node_index: NodeIndex(None), @@ -386,8 +386,8 @@ Module( patterns: [ MatchAs( PatternMatchAs { - range: 280..281, node_index: NodeIndex(None), + range: 280..281, pattern: None, name: Some( Identifier { @@ -400,8 +400,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 283..284, node_index: NodeIndex(None), + range: 283..284, pattern: None, name: Some( Identifier { @@ -438,8 +438,8 @@ Module( node_index: NodeIndex(None), pattern: MatchClass( PatternMatchClass { - range: 325..340, node_index: NodeIndex(None), + range: 325..340, cls: Name( ExprName { node_index: NodeIndex(None), @@ -463,8 +463,8 @@ Module( }, pattern: MatchAs( PatternMatchAs { - range: 333..334, node_index: NodeIndex(None), + range: 333..334, pattern: None, name: Some( Identifier { @@ -486,8 +486,8 @@ Module( }, pattern: MatchAs( PatternMatchAs { - range: 338..339, node_index: NodeIndex(None), + range: 338..339, pattern: None, name: Some( Identifier { @@ -524,18 +524,18 @@ Module( node_index: NodeIndex(None), pattern: MatchOr( PatternMatchOr { - range: 377..407, node_index: NodeIndex(None), + range: 377..407, patterns: [ MatchSequence( PatternMatchSequence { - range: 377..380, node_index: NodeIndex(None), + range: 377..380, patterns: [ MatchAs( PatternMatchAs { - range: 378..379, node_index: NodeIndex(None), + range: 378..379, pattern: None, name: Some( Identifier { @@ -551,8 +551,8 @@ Module( ), MatchMapping( PatternMatchMapping { - range: 383..389, node_index: NodeIndex(None), + range: 383..389, keys: [ NumberLiteral( ExprNumberLiteral { @@ -567,8 +567,8 @@ Module( patterns: [ MatchAs( PatternMatchAs { - range: 387..388, node_index: NodeIndex(None), + range: 387..388, pattern: None, name: Some( Identifier { @@ -585,8 +585,8 @@ Module( ), MatchClass( PatternMatchClass { - range: 392..407, node_index: NodeIndex(None), + range: 392..407, cls: Name( ExprName { node_index: NodeIndex(None), @@ -610,8 +610,8 @@ Module( }, pattern: MatchAs( PatternMatchAs { - range: 400..401, node_index: NodeIndex(None), + range: 400..401, pattern: None, name: Some( Identifier { @@ -633,8 +633,8 @@ Module( }, pattern: MatchAs( PatternMatchAs { - range: 405..406, node_index: NodeIndex(None), + range: 405..406, pattern: None, name: Some( Identifier { @@ -674,13 +674,13 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 433..439, node_index: NodeIndex(None), + range: 433..439, pattern: Some( MatchAs( PatternMatchAs { - range: 433..434, node_index: NodeIndex(None), + range: 433..434, pattern: None, name: Some( Identifier { diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_0.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_0.py.snap index 27c349f705..d03bfe08c8 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_0.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_0.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchClass( PatternMatchClass { - range: 132..146, node_index: NodeIndex(None), + range: 132..146, cls: Name( ExprName { node_index: NodeIndex(None), @@ -44,8 +44,8 @@ Module( patterns: [ MatchAs( PatternMatchAs { - range: 141..142, node_index: NodeIndex(None), + range: 141..142, pattern: None, name: Some( Identifier { @@ -58,8 +58,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 144..145, node_index: NodeIndex(None), + range: 144..145, pattern: None, name: Some( Identifier { diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_1.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_1.py.snap index 4ef2b99dcf..34809d2560 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_1.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_1.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 145..158, node_index: NodeIndex(None), + range: 145..158, value: BinOp( ExprBinOp { node_index: NodeIndex(None), diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_2.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_2.py.snap index b649717bab..34e3500f26 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_2.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_2.py.snap @@ -28,13 +28,13 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 164..170, node_index: NodeIndex(None), + range: 164..170, pattern: Some( MatchAs( PatternMatchAs { - range: 164..165, node_index: NodeIndex(None), + range: 164..165, pattern: None, name: Some( Identifier { diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_3.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_3.py.snap index 74014165fd..07cd1a64e6 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_3.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_3.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchClass( PatternMatchClass { - range: 108..117, node_index: NodeIndex(None), + range: 108..117, cls: Dict( ExprDict { node_index: NodeIndex(None), @@ -43,13 +43,13 @@ Module( patterns: [ MatchAs( PatternMatchAs { - range: 110..116, node_index: NodeIndex(None), + range: 110..116, pattern: Some( MatchAs( PatternMatchAs { - range: 110..111, node_index: NodeIndex(None), + range: 110..111, pattern: None, name: Some( Identifier { diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_4.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_4.py.snap index 4ec3c13511..771706eaed 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_4.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_4.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 161..172, node_index: NodeIndex(None), + range: 161..172, keys: [ Name( ExprName { @@ -51,8 +51,8 @@ Module( patterns: [ MatchAs( PatternMatchAs { - range: 164..166, node_index: NodeIndex(None), + range: 164..166, pattern: None, name: Some( Identifier { @@ -65,8 +65,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 170..171, node_index: NodeIndex(None), + range: 170..171, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__invalid_class_pattern.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__invalid_class_pattern.py.snap index e5f771dfd8..67b1874089 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__invalid_class_pattern.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__invalid_class_pattern.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchClass( PatternMatchClass { - range: 68..83, node_index: NodeIndex(None), + range: 68..83, cls: Name( ExprName { node_index: NodeIndex(None), @@ -53,8 +53,8 @@ Module( }, pattern: MatchValue( PatternMatchValue { - range: 81..82, node_index: NodeIndex(None), + range: 81..82, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -86,8 +86,8 @@ Module( node_index: NodeIndex(None), pattern: MatchClass( PatternMatchClass { - range: 107..121, node_index: NodeIndex(None), + range: 107..121, cls: Name( ExprName { node_index: NodeIndex(None), @@ -111,8 +111,8 @@ Module( }, pattern: MatchValue( PatternMatchValue { - range: 119..120, node_index: NodeIndex(None), + range: 119..120, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -144,8 +144,8 @@ Module( node_index: NodeIndex(None), pattern: MatchClass( PatternMatchClass { - range: 145..160, node_index: NodeIndex(None), + range: 145..160, cls: Name( ExprName { node_index: NodeIndex(None), @@ -169,8 +169,8 @@ Module( }, pattern: MatchValue( PatternMatchValue { - range: 158..159, node_index: NodeIndex(None), + range: 158..159, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -202,8 +202,8 @@ Module( node_index: NodeIndex(None), pattern: MatchClass( PatternMatchClass { - range: 184..203, node_index: NodeIndex(None), + range: 184..203, cls: Name( ExprName { node_index: NodeIndex(None), @@ -227,8 +227,8 @@ Module( }, pattern: MatchValue( PatternMatchValue { - range: 201..202, node_index: NodeIndex(None), + range: 201..202, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -260,8 +260,8 @@ Module( node_index: NodeIndex(None), pattern: MatchClass( PatternMatchClass { - range: 227..235, node_index: NodeIndex(None), + range: 227..235, cls: Name( ExprName { node_index: NodeIndex(None), @@ -285,8 +285,8 @@ Module( }, pattern: MatchValue( PatternMatchValue { - range: 233..234, node_index: NodeIndex(None), + range: 233..234, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -318,8 +318,8 @@ Module( node_index: NodeIndex(None), pattern: MatchClass( PatternMatchClass { - range: 259..271, node_index: NodeIndex(None), + range: 259..271, cls: Name( ExprName { node_index: NodeIndex(None), @@ -343,8 +343,8 @@ Module( }, pattern: MatchValue( PatternMatchValue { - range: 269..270, node_index: NodeIndex(None), + range: 269..270, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__invalid_lhs_or_rhs_pattern.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__invalid_lhs_or_rhs_pattern.py.snap index 978a1633e1..4f3a4512a1 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__invalid_lhs_or_rhs_pattern.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__invalid_lhs_or_rhs_pattern.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 36..46, node_index: NodeIndex(None), + range: 36..46, value: BinOp( ExprBinOp { node_index: NodeIndex(None), @@ -84,8 +84,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 70..76, node_index: NodeIndex(None), + range: 70..76, value: BinOp( ExprBinOp { node_index: NodeIndex(None), @@ -128,8 +128,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 100..106, node_index: NodeIndex(None), + range: 100..106, value: BinOp( ExprBinOp { node_index: NodeIndex(None), @@ -172,8 +172,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 130..142, node_index: NodeIndex(None), + range: 130..142, value: BinOp( ExprBinOp { node_index: NodeIndex(None), @@ -233,8 +233,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 166..177, node_index: NodeIndex(None), + range: 166..177, value: BinOp( ExprBinOp { node_index: NodeIndex(None), @@ -296,8 +296,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 201..215, node_index: NodeIndex(None), + range: 201..215, value: BinOp( ExprBinOp { node_index: NodeIndex(None), @@ -360,8 +360,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 239..246, node_index: NodeIndex(None), + range: 239..246, value: BinOp( ExprBinOp { node_index: NodeIndex(None), @@ -406,8 +406,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 270..278, node_index: NodeIndex(None), + range: 270..278, value: BinOp( ExprBinOp { node_index: NodeIndex(None), @@ -459,8 +459,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 302..318, node_index: NodeIndex(None), + range: 302..318, value: BinOp( ExprBinOp { node_index: NodeIndex(None), @@ -540,8 +540,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 370..379, node_index: NodeIndex(None), + range: 370..379, value: BinOp( ExprBinOp { node_index: NodeIndex(None), @@ -595,8 +595,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 403..408, node_index: NodeIndex(None), + range: 403..408, value: BinOp( ExprBinOp { node_index: NodeIndex(None), @@ -638,8 +638,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 432..437, node_index: NodeIndex(None), + range: 432..437, value: BinOp( ExprBinOp { node_index: NodeIndex(None), @@ -681,8 +681,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 461..472, node_index: NodeIndex(None), + range: 461..472, value: BinOp( ExprBinOp { node_index: NodeIndex(None), @@ -741,8 +741,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 496..506, node_index: NodeIndex(None), + range: 496..506, value: BinOp( ExprBinOp { node_index: NodeIndex(None), @@ -803,8 +803,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 530..543, node_index: NodeIndex(None), + range: 530..543, value: BinOp( ExprBinOp { node_index: NodeIndex(None), @@ -866,8 +866,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 567..572, node_index: NodeIndex(None), + range: 567..572, value: BinOp( ExprBinOp { node_index: NodeIndex(None), @@ -910,8 +910,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 596..611, node_index: NodeIndex(None), + range: 596..611, value: BinOp( ExprBinOp { node_index: NodeIndex(None), @@ -990,8 +990,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 667..680, node_index: NodeIndex(None), + range: 667..680, value: BinOp( ExprBinOp { node_index: NodeIndex(None), diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__invalid_mapping_pattern.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__invalid_mapping_pattern.py.snap index 67b66ad2ea..5592524488 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__invalid_mapping_pattern.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__invalid_mapping_pattern.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 85..91, node_index: NodeIndex(None), + range: 85..91, keys: [ Starred( ExprStarred { @@ -50,8 +50,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 90..90, node_index: NodeIndex(None), + range: 90..90, value: Name( ExprName { node_index: NodeIndex(None), @@ -81,8 +81,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 115..124, node_index: NodeIndex(None), + range: 115..124, keys: [ Starred( ExprStarred { @@ -103,8 +103,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 122..123, node_index: NodeIndex(None), + range: 122..123, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -135,8 +135,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 148..156, node_index: NodeIndex(None), + range: 148..156, keys: [ Starred( ExprStarred { @@ -157,8 +157,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 154..155, node_index: NodeIndex(None), + range: 154..155, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -189,8 +189,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 180..195, node_index: NodeIndex(None), + range: 180..195, keys: [ Starred( ExprStarred { @@ -217,8 +217,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 185..185, node_index: NodeIndex(None), + range: 185..185, value: Name( ExprName { node_index: NodeIndex(None), @@ -231,8 +231,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 193..194, node_index: NodeIndex(None), + range: 193..194, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -279,8 +279,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 329..346, node_index: NodeIndex(None), + range: 329..346, keys: [ NoneLiteral( ExprNoneLiteral { @@ -292,8 +292,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 344..345, node_index: NodeIndex(None), + range: 344..345, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -330,8 +330,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 370..397, node_index: NodeIndex(None), + range: 370..397, keys: [ NoneLiteral( ExprNoneLiteral { @@ -343,8 +343,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 395..396, node_index: NodeIndex(None), + range: 395..396, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -381,8 +381,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 421..448, node_index: NodeIndex(None), + range: 421..448, keys: [ NoneLiteral( ExprNoneLiteral { @@ -394,8 +394,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 437..438, node_index: NodeIndex(None), + range: 437..438, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -448,8 +448,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 488..504, node_index: NodeIndex(None), + range: 488..504, keys: [ Call( ExprCall { @@ -484,8 +484,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 502..503, node_index: NodeIndex(None), + range: 502..503, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__star_pattern_usage.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__star_pattern_usage.py.snap index 8db3ef5b5b..364d382ff2 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__star_pattern_usage.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__star_pattern_usage.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchStar( PatternMatchStar { - range: 81..83, node_index: NodeIndex(None), + range: 81..83, name: None, }, ), @@ -48,13 +48,13 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 107..114, node_index: NodeIndex(None), + range: 107..114, pattern: Some( MatchStar( PatternMatchStar { - range: 107..109, node_index: NodeIndex(None), + range: 107..109, name: None, }, ), @@ -83,8 +83,8 @@ Module( node_index: NodeIndex(None), pattern: MatchStar( PatternMatchStar { - range: 138..142, node_index: NodeIndex(None), + range: 138..142, name: Some( Identifier { id: Name("foo"), @@ -109,13 +109,13 @@ Module( node_index: NodeIndex(None), pattern: MatchOr( PatternMatchOr { - range: 166..174, node_index: NodeIndex(None), + range: 166..174, patterns: [ MatchStar( PatternMatchStar { - range: 166..170, node_index: NodeIndex(None), + range: 166..170, name: Some( Identifier { id: Name("foo"), @@ -127,8 +127,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 173..174, node_index: NodeIndex(None), + range: 173..174, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -158,13 +158,13 @@ Module( node_index: NodeIndex(None), pattern: MatchOr( PatternMatchOr { - range: 198..206, node_index: NodeIndex(None), + range: 198..206, patterns: [ MatchValue( PatternMatchValue { - range: 198..199, node_index: NodeIndex(None), + range: 198..199, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -178,8 +178,8 @@ Module( ), MatchStar( PatternMatchStar { - range: 202..206, node_index: NodeIndex(None), + range: 202..206, name: Some( Identifier { id: Name("foo"), @@ -207,8 +207,8 @@ Module( node_index: NodeIndex(None), pattern: MatchClass( PatternMatchClass { - range: 230..237, node_index: NodeIndex(None), + range: 230..237, cls: Name( ExprName { node_index: NodeIndex(None), @@ -223,8 +223,8 @@ Module( patterns: [ MatchStar( PatternMatchStar { - range: 234..236, node_index: NodeIndex(None), + range: 234..236, name: None, }, ), @@ -248,8 +248,8 @@ Module( node_index: NodeIndex(None), pattern: MatchClass( PatternMatchClass { - range: 261..270, node_index: NodeIndex(None), + range: 261..270, cls: Name( ExprName { node_index: NodeIndex(None), @@ -273,8 +273,8 @@ Module( }, pattern: MatchStar( PatternMatchStar { - range: 267..269, node_index: NodeIndex(None), + range: 267..269, name: None, }, ), @@ -298,8 +298,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 294..298, node_index: NodeIndex(None), + range: 294..298, keys: [ Starred( ExprStarred { @@ -320,8 +320,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 297..297, node_index: NodeIndex(None), + range: 297..297, value: Name( ExprName { node_index: NodeIndex(None), @@ -351,8 +351,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 322..329, node_index: NodeIndex(None), + range: 322..329, keys: [ Starred( ExprStarred { @@ -373,8 +373,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 327..328, node_index: NodeIndex(None), + range: 327..328, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -405,8 +405,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 353..363, node_index: NodeIndex(None), + range: 353..363, keys: [ NoneLiteral( ExprNoneLiteral { @@ -418,8 +418,8 @@ Module( patterns: [ MatchStar( PatternMatchStar { - range: 360..362, node_index: NodeIndex(None), + range: 360..362, name: None, }, ), @@ -442,8 +442,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 387..393, node_index: NodeIndex(None), + range: 387..393, value: BinOp( ExprBinOp { node_index: NodeIndex(None), diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__unary_add_usage.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__unary_add_usage.py.snap index fe42f9c289..2fcc8cad93 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__unary_add_usage.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__unary_add_usage.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 98..100, node_index: NodeIndex(None), + range: 98..100, value: UnaryOp( ExprUnaryOp { node_index: NodeIndex(None), @@ -63,13 +63,13 @@ Module( node_index: NodeIndex(None), pattern: MatchOr( PatternMatchOr { - range: 124..135, node_index: NodeIndex(None), + range: 124..135, patterns: [ MatchValue( PatternMatchValue { - range: 124..125, node_index: NodeIndex(None), + range: 124..125, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -83,8 +83,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 128..130, node_index: NodeIndex(None), + range: 128..130, value: UnaryOp( ExprUnaryOp { node_index: NodeIndex(None), @@ -105,8 +105,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 133..135, node_index: NodeIndex(None), + range: 133..135, value: UnaryOp( ExprUnaryOp { node_index: NodeIndex(None), @@ -143,13 +143,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 159..170, node_index: NodeIndex(None), + range: 159..170, patterns: [ MatchValue( PatternMatchValue { - range: 160..161, node_index: NodeIndex(None), + range: 160..161, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -163,8 +163,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 163..165, node_index: NodeIndex(None), + range: 163..165, value: UnaryOp( ExprUnaryOp { node_index: NodeIndex(None), @@ -185,8 +185,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 167..169, node_index: NodeIndex(None), + range: 167..169, value: UnaryOp( ExprUnaryOp { node_index: NodeIndex(None), @@ -223,8 +223,8 @@ Module( node_index: NodeIndex(None), pattern: MatchClass( PatternMatchClass { - range: 194..209, node_index: NodeIndex(None), + range: 194..209, cls: Name( ExprName { node_index: NodeIndex(None), @@ -248,8 +248,8 @@ Module( }, pattern: MatchValue( PatternMatchValue { - range: 200..202, node_index: NodeIndex(None), + range: 200..202, value: UnaryOp( ExprUnaryOp { node_index: NodeIndex(None), @@ -279,8 +279,8 @@ Module( }, pattern: MatchValue( PatternMatchValue { - range: 206..208, node_index: NodeIndex(None), + range: 206..208, value: UnaryOp( ExprUnaryOp { node_index: NodeIndex(None), @@ -319,8 +319,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 233..254, node_index: NodeIndex(None), + range: 233..254, keys: [ BooleanLiteral( ExprBooleanLiteral { @@ -340,8 +340,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 240..242, node_index: NodeIndex(None), + range: 240..242, value: UnaryOp( ExprUnaryOp { node_index: NodeIndex(None), @@ -362,8 +362,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 251..253, node_index: NodeIndex(None), + range: 251..253, value: UnaryOp( ExprUnaryOp { node_index: NodeIndex(None), diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@class_keyword_in_case_pattern.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@class_keyword_in_case_pattern.py.snap index 12e1125f1a..a732e866b3 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@class_keyword_in_case_pattern.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@class_keyword_in_case_pattern.py.snap @@ -29,8 +29,8 @@ Module( node_index: NodeIndex(None), pattern: MatchClass( PatternMatchClass { - range: 18..28, node_index: NodeIndex(None), + range: 18..28, cls: Name( ExprName { node_index: NodeIndex(None), @@ -54,8 +54,8 @@ Module( }, pattern: MatchAs( PatternMatchAs { - range: 26..27, node_index: NodeIndex(None), + range: 26..27, pattern: None, name: Some( Identifier { diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@different_match_pattern_bindings.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@different_match_pattern_bindings.py.snap index 8f7ec2412e..2705218022 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@different_match_pattern_bindings.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@different_match_pattern_bindings.py.snap @@ -28,18 +28,18 @@ Module( node_index: NodeIndex(None), pattern: MatchOr( PatternMatchOr { - range: 18..27, node_index: NodeIndex(None), + range: 18..27, patterns: [ MatchSequence( PatternMatchSequence { - range: 18..21, node_index: NodeIndex(None), + range: 18..21, patterns: [ MatchAs( PatternMatchAs { - range: 19..20, node_index: NodeIndex(None), + range: 19..20, pattern: None, name: Some( Identifier { @@ -55,13 +55,13 @@ Module( ), MatchSequence( PatternMatchSequence { - range: 24..27, node_index: NodeIndex(None), + range: 24..27, patterns: [ MatchAs( PatternMatchAs { - range: 25..26, node_index: NodeIndex(None), + range: 25..26, pattern: None, name: Some( Identifier { @@ -99,18 +99,18 @@ Module( node_index: NodeIndex(None), pattern: MatchOr( PatternMatchOr { - range: 42..57, node_index: NodeIndex(None), + range: 42..57, patterns: [ MatchSequence( PatternMatchSequence { - range: 42..48, node_index: NodeIndex(None), + range: 42..48, patterns: [ MatchAs( PatternMatchAs { - range: 43..44, node_index: NodeIndex(None), + range: 43..44, pattern: None, name: Some( Identifier { @@ -123,8 +123,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 46..47, node_index: NodeIndex(None), + range: 46..47, pattern: None, name: Some( Identifier { @@ -140,13 +140,13 @@ Module( ), MatchSequence( PatternMatchSequence { - range: 51..57, node_index: NodeIndex(None), + range: 51..57, patterns: [ MatchAs( PatternMatchAs { - range: 52..53, node_index: NodeIndex(None), + range: 52..53, pattern: None, name: Some( Identifier { @@ -159,8 +159,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 55..56, node_index: NodeIndex(None), + range: 55..56, pattern: None, name: Some( Identifier { @@ -198,13 +198,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 72..84, node_index: NodeIndex(None), + range: 72..84, patterns: [ MatchAs( PatternMatchAs { - range: 73..74, node_index: NodeIndex(None), + range: 73..74, pattern: None, name: Some( Identifier { @@ -217,13 +217,13 @@ Module( ), MatchOr( PatternMatchOr { - range: 77..82, node_index: NodeIndex(None), + range: 77..82, patterns: [ MatchAs( PatternMatchAs { - range: 77..78, node_index: NodeIndex(None), + range: 77..78, pattern: None, name: Some( Identifier { @@ -236,8 +236,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 81..82, node_index: NodeIndex(None), + range: 81..82, pattern: None, name: Some( Identifier { @@ -275,18 +275,18 @@ Module( node_index: NodeIndex(None), pattern: MatchOr( PatternMatchOr { - range: 99..114, node_index: NodeIndex(None), + range: 99..114, patterns: [ MatchSequence( PatternMatchSequence { - range: 99..105, node_index: NodeIndex(None), + range: 99..105, patterns: [ MatchAs( PatternMatchAs { - range: 100..101, node_index: NodeIndex(None), + range: 100..101, pattern: None, name: Some( Identifier { @@ -299,8 +299,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 103..104, node_index: NodeIndex(None), + range: 103..104, pattern: None, name: None, }, @@ -310,13 +310,13 @@ Module( ), MatchSequence( PatternMatchSequence { - range: 108..114, node_index: NodeIndex(None), + range: 108..114, patterns: [ MatchAs( PatternMatchAs { - range: 109..110, node_index: NodeIndex(None), + range: 109..110, pattern: None, name: Some( Identifier { @@ -329,8 +329,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 112..113, node_index: NodeIndex(None), + range: 112..113, pattern: None, name: None, }, @@ -362,18 +362,18 @@ Module( node_index: NodeIndex(None), pattern: MatchOr( PatternMatchOr { - range: 129..141, node_index: NodeIndex(None), + range: 129..141, patterns: [ MatchSequence( PatternMatchSequence { - range: 129..132, node_index: NodeIndex(None), + range: 129..132, patterns: [ MatchAs( PatternMatchAs { - range: 130..131, node_index: NodeIndex(None), + range: 130..131, pattern: None, name: Some( Identifier { @@ -389,13 +389,13 @@ Module( ), MatchSequence( PatternMatchSequence { - range: 135..141, node_index: NodeIndex(None), + range: 135..141, patterns: [ MatchClass( PatternMatchClass { - range: 136..140, node_index: NodeIndex(None), + range: 136..140, cls: Name( ExprName { node_index: NodeIndex(None), @@ -410,8 +410,8 @@ Module( patterns: [ MatchAs( PatternMatchAs { - range: 138..139, node_index: NodeIndex(None), + range: 138..139, pattern: None, name: Some( Identifier { diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@duplicate_match_key_attr.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@duplicate_match_key_attr.py.snap index bb0ad14135..e090cde339 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@duplicate_match_key_attr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@duplicate_match_key_attr.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 18..34, node_index: NodeIndex(None), + range: 18..34, keys: [ Attribute( ExprAttribute { @@ -75,8 +75,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 24..25, node_index: NodeIndex(None), + range: 24..25, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -90,8 +90,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 32..33, node_index: NodeIndex(None), + range: 32..33, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__f_string.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__f_string.py.snap index e696d1c34a..a7a0f0c925 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__f_string.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__f_string.py.snap @@ -1077,8 +1077,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 274..279, node_index: NodeIndex(None), + range: 274..279, value: StringLiteral( ExprStringLiteral { node_index: NodeIndex(None), @@ -1117,8 +1117,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 303..331, node_index: NodeIndex(None), + range: 303..331, value: StringLiteral( ExprStringLiteral { node_index: NodeIndex(None), diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__t_string.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__t_string.py.snap index 0896a3ae47..ad30629e3a 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__t_string.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__t_string.py.snap @@ -1053,8 +1053,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 276..281, node_index: NodeIndex(None), + range: 276..281, value: StringLiteral( ExprStringLiteral { node_index: NodeIndex(None), @@ -1093,8 +1093,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 305..333, node_index: NodeIndex(None), + range: 305..333, value: StringLiteral( ExprStringLiteral { node_index: NodeIndex(None), diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@irrefutable_case_pattern_at_end.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@irrefutable_case_pattern_at_end.py.snap index 355e84ac03..ee291df133 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@irrefutable_case_pattern_at_end.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@irrefutable_case_pattern_at_end.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 18..19, node_index: NodeIndex(None), + range: 18..19, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -62,8 +62,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 34..37, node_index: NodeIndex(None), + range: 34..37, pattern: None, name: Some( Identifier { @@ -111,8 +111,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 61..62, node_index: NodeIndex(None), + range: 61..62, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -145,8 +145,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 77..78, node_index: NodeIndex(None), + range: 77..78, pattern: None, name: None, }, @@ -188,8 +188,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 102..105, node_index: NodeIndex(None), + range: 102..105, pattern: None, name: Some( Identifier { @@ -229,8 +229,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 169..170, node_index: NodeIndex(None), + range: 169..170, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_after_py310.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_after_py310.py.snap index 155afee96f..8169fc8654 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_after_py310.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_after_py310.py.snap @@ -29,8 +29,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 64..65, node_index: NodeIndex(None), + range: 64..65, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_as_pattern.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_as_pattern.py.snap index f69f8a5947..2ae3ea1e81 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_as_pattern.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_as_pattern.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 20..27, node_index: NodeIndex(None), + range: 20..27, pattern: None, name: Some( Identifier { @@ -77,8 +77,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 53..54, node_index: NodeIndex(None), + range: 53..54, pattern: None, name: None, }, diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_as_pattern_soft_keyword.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_as_pattern_soft_keyword.py.snap index 7795d1b45c..1d32832797 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_as_pattern_soft_keyword.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_as_pattern_soft_keyword.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 20..24, node_index: NodeIndex(None), + range: 20..24, pattern: None, name: Some( Identifier { @@ -77,8 +77,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 50..55, node_index: NodeIndex(None), + range: 50..55, pattern: None, name: Some( Identifier { @@ -126,8 +126,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 81..85, node_index: NodeIndex(None), + range: 81..85, pattern: None, name: Some( Identifier { diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_attr_pattern_soft_keyword.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_attr_pattern_soft_keyword.py.snap index 0f911c5ce4..5050a08ea5 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_attr_pattern_soft_keyword.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_attr_pattern_soft_keyword.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 20..29, node_index: NodeIndex(None), + range: 20..29, value: Attribute( ExprAttribute { node_index: NodeIndex(None), @@ -73,8 +73,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 44..52, node_index: NodeIndex(None), + range: 44..52, value: Attribute( ExprAttribute { node_index: NodeIndex(None), @@ -118,8 +118,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 67..75, node_index: NodeIndex(None), + range: 67..75, value: Attribute( ExprAttribute { node_index: NodeIndex(None), @@ -163,8 +163,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 90..125, node_index: NodeIndex(None), + range: 90..125, value: Attribute( ExprAttribute { node_index: NodeIndex(None), diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_classify_as_keyword_1.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_classify_as_keyword_1.py.snap index e7e54f42bb..3ff055535e 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_classify_as_keyword_1.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_classify_as_keyword_1.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 20..21, node_index: NodeIndex(None), + range: 20..21, pattern: None, name: None, }, @@ -72,8 +72,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 45..46, node_index: NodeIndex(None), + range: 45..46, pattern: None, name: None, }, @@ -116,8 +116,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 72..73, node_index: NodeIndex(None), + range: 72..73, pattern: None, name: None, }, @@ -161,8 +161,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 98..99, node_index: NodeIndex(None), + range: 98..99, pattern: None, name: None, }, @@ -217,8 +217,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 127..128, node_index: NodeIndex(None), + range: 127..128, pattern: None, name: None, }, @@ -300,8 +300,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 161..162, node_index: NodeIndex(None), + range: 161..162, pattern: None, name: None, }, @@ -361,8 +361,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 191..192, node_index: NodeIndex(None), + range: 191..192, pattern: None, name: None, }, @@ -411,8 +411,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 219..220, node_index: NodeIndex(None), + range: 219..220, pattern: None, name: None, }, @@ -452,8 +452,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 246..247, node_index: NodeIndex(None), + range: 246..247, pattern: None, name: None, }, @@ -502,8 +502,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 277..278, node_index: NodeIndex(None), + range: 277..278, pattern: None, name: None, }, @@ -563,8 +563,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 312..313, node_index: NodeIndex(None), + range: 312..313, pattern: None, name: None, }, @@ -639,8 +639,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 351..352, node_index: NodeIndex(None), + range: 351..352, pattern: None, name: None, }, diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_classify_as_keyword_2.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_classify_as_keyword_2.py.snap index 16ff76beb6..84a0f8c747 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_classify_as_keyword_2.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_classify_as_keyword_2.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 22..23, node_index: NodeIndex(None), + range: 22..23, pattern: None, name: None, }, @@ -71,8 +71,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 50..51, node_index: NodeIndex(None), + range: 50..51, pattern: None, name: None, }, @@ -114,8 +114,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 78..79, node_index: NodeIndex(None), + range: 78..79, pattern: None, name: None, }, @@ -155,8 +155,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 106..107, node_index: NodeIndex(None), + range: 106..107, pattern: None, name: None, }, @@ -197,8 +197,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 134..135, node_index: NodeIndex(None), + range: 134..135, pattern: None, name: None, }, @@ -239,8 +239,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 163..164, node_index: NodeIndex(None), + range: 163..164, pattern: None, name: None, }, diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_classify_as_keyword_or_identifier.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_classify_as_keyword_or_identifier.py.snap index 71fa711fb7..40eb8aafef 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_classify_as_keyword_or_identifier.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_classify_as_keyword_or_identifier.py.snap @@ -93,8 +93,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 61..62, node_index: NodeIndex(None), + range: 61..62, pattern: None, name: None, }, @@ -195,8 +195,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 127..128, node_index: NodeIndex(None), + range: 127..128, pattern: None, name: None, }, @@ -303,8 +303,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 218..219, node_index: NodeIndex(None), + range: 218..219, pattern: None, name: None, }, diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_sequence_pattern_parentheses_terminator.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_sequence_pattern_parentheses_terminator.py.snap index 4abf3285a6..4cc16363d2 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_sequence_pattern_parentheses_terminator.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_sequence_pattern_parentheses_terminator.py.snap @@ -28,13 +28,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 24..30, node_index: NodeIndex(None), + range: 24..30, patterns: [ MatchAs( PatternMatchAs { - range: 25..26, node_index: NodeIndex(None), + range: 25..26, pattern: None, name: Some( Identifier { @@ -47,8 +47,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 28..29, node_index: NodeIndex(None), + range: 28..29, pattern: None, name: Some( Identifier { @@ -83,13 +83,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 45..51, node_index: NodeIndex(None), + range: 45..51, patterns: [ MatchAs( PatternMatchAs { - range: 46..47, node_index: NodeIndex(None), + range: 46..47, pattern: None, name: Some( Identifier { @@ -102,8 +102,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 49..50, node_index: NodeIndex(None), + range: 49..50, pattern: None, name: Some( Identifier { diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_sequence_pattern_terminator.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_sequence_pattern_terminator.py.snap index d980cea8b2..361c36bae4 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_sequence_pattern_terminator.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_sequence_pattern_terminator.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 24..25, node_index: NodeIndex(None), + range: 24..25, pattern: None, name: Some( Identifier { @@ -70,13 +70,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 45..49, node_index: NodeIndex(None), + range: 45..49, patterns: [ MatchAs( PatternMatchAs { - range: 45..46, node_index: NodeIndex(None), + range: 45..46, pattern: None, name: Some( Identifier { @@ -89,8 +89,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 48..49, node_index: NodeIndex(None), + range: 48..49, pattern: None, name: Some( Identifier { @@ -125,13 +125,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 64..68, node_index: NodeIndex(None), + range: 64..68, patterns: [ MatchAs( PatternMatchAs { - range: 64..65, node_index: NodeIndex(None), + range: 64..65, pattern: None, name: Some( Identifier { @@ -144,8 +144,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 67..68, node_index: NodeIndex(None), + range: 67..68, pattern: None, name: Some( Identifier { @@ -189,8 +189,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 88..89, node_index: NodeIndex(None), + range: 88..89, pattern: None, name: Some( Identifier { diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_stmt_subject_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_stmt_subject_expr.py.snap index 43db08647c..de49fc65c0 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_stmt_subject_expr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_stmt_subject_expr.py.snap @@ -43,8 +43,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 23..24, node_index: NodeIndex(None), + range: 23..24, pattern: None, name: None, }, @@ -101,8 +101,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 55..56, node_index: NodeIndex(None), + range: 55..56, pattern: None, name: None, }, @@ -184,8 +184,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 147..148, node_index: NodeIndex(None), + range: 147..148, pattern: None, name: None, }, @@ -233,8 +233,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 178..179, node_index: NodeIndex(None), + range: 178..179, pattern: None, name: None, }, diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_stmt_valid_guard_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_stmt_valid_guard_expr.py.snap index ed559fabac..643a0bac5b 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_stmt_valid_guard_expr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_stmt_valid_guard_expr.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 18..19, node_index: NodeIndex(None), + range: 18..19, pattern: None, name: Some( Identifier { @@ -101,8 +101,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 53..54, node_index: NodeIndex(None), + range: 53..54, pattern: None, name: Some( Identifier { @@ -180,8 +180,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 98..99, node_index: NodeIndex(None), + range: 98..99, pattern: None, name: Some( Identifier { @@ -271,8 +271,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 138..139, node_index: NodeIndex(None), + range: 138..139, pattern: None, name: Some( Identifier { diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@multiple_assignment_in_case_pattern.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@multiple_assignment_in_case_pattern.py.snap index 1f7090f2c9..a37747203d 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@multiple_assignment_in_case_pattern.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@multiple_assignment_in_case_pattern.py.snap @@ -29,13 +29,13 @@ Module( node_index: NodeIndex(None), pattern: MatchOr( PatternMatchOr { - range: 18..36, node_index: NodeIndex(None), + range: 18..36, patterns: [ MatchClass( PatternMatchClass { - range: 18..26, node_index: NodeIndex(None), + range: 18..26, cls: Name( ExprName { node_index: NodeIndex(None), @@ -50,8 +50,8 @@ Module( patterns: [ MatchAs( PatternMatchAs { - range: 24..25, node_index: NodeIndex(None), + range: 24..25, pattern: None, name: Some( Identifier { @@ -69,13 +69,13 @@ Module( ), MatchSequence( PatternMatchSequence { - range: 29..32, node_index: NodeIndex(None), + range: 29..32, patterns: [ MatchAs( PatternMatchAs { - range: 30..31, node_index: NodeIndex(None), + range: 30..31, pattern: None, name: Some( Identifier { @@ -91,8 +91,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 35..36, node_index: NodeIndex(None), + range: 35..36, pattern: None, name: Some( Identifier { diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__match.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__match.py.snap index e10babe037..496319ea71 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__match.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__match.py.snap @@ -28,8 +28,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 85..88, node_index: NodeIndex(None), + range: 85..88, value: UnaryOp( ExprUnaryOp { node_index: NodeIndex(None), @@ -99,8 +99,8 @@ Module( node_index: NodeIndex(None), pattern: MatchClass( PatternMatchClass { - range: 144..152, node_index: NodeIndex(None), + range: 144..152, cls: Name( ExprName { node_index: NodeIndex(None), @@ -115,8 +115,8 @@ Module( patterns: [ MatchAs( PatternMatchAs { - range: 150..151, node_index: NodeIndex(None), + range: 150..151, pattern: None, name: Some( Identifier { @@ -182,8 +182,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 208..209, node_index: NodeIndex(None), + range: 208..209, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -239,8 +239,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 239..240, node_index: NodeIndex(None), + range: 239..240, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -313,13 +313,13 @@ Module( node_index: NodeIndex(None), pattern: MatchOr( PatternMatchOr { - range: 301..314, node_index: NodeIndex(None), + range: 301..314, patterns: [ MatchValue( PatternMatchValue { - range: 301..302, node_index: NodeIndex(None), + range: 301..302, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -333,8 +333,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 305..306, node_index: NodeIndex(None), + range: 305..306, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -348,8 +348,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 309..310, node_index: NodeIndex(None), + range: 309..310, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -363,8 +363,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 313..314, node_index: NodeIndex(None), + range: 313..314, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -427,18 +427,18 @@ Module( node_index: NodeIndex(None), pattern: MatchOr( PatternMatchOr { - range: 373..388, node_index: NodeIndex(None), + range: 373..388, patterns: [ MatchSequence( PatternMatchSequence { - range: 373..379, node_index: NodeIndex(None), + range: 373..379, patterns: [ MatchValue( PatternMatchValue { - range: 374..375, node_index: NodeIndex(None), + range: 374..375, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -452,8 +452,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 377..378, node_index: NodeIndex(None), + range: 377..378, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -470,13 +470,13 @@ Module( ), MatchSequence( PatternMatchSequence { - range: 382..388, node_index: NodeIndex(None), + range: 382..388, patterns: [ MatchValue( PatternMatchValue { - range: 383..384, node_index: NodeIndex(None), + range: 383..384, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -490,8 +490,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 386..387, node_index: NodeIndex(None), + range: 386..387, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -559,13 +559,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 463..467, node_index: NodeIndex(None), + range: 463..467, patterns: [ MatchStar( PatternMatchStar { - range: 464..466, node_index: NodeIndex(None), + range: 464..466, name: None, }, ), @@ -610,8 +610,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 499..501, node_index: NodeIndex(None), + range: 499..501, keys: [], patterns: [], rest: None, @@ -671,8 +671,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 564..579, node_index: NodeIndex(None), + range: 564..579, keys: [ NumberLiteral( ExprNumberLiteral { @@ -687,13 +687,13 @@ Module( patterns: [ MatchSequence( PatternMatchSequence { - range: 568..578, node_index: NodeIndex(None), + range: 568..578, patterns: [ MatchValue( PatternMatchValue { - range: 569..570, node_index: NodeIndex(None), + range: 569..570, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -707,8 +707,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 572..573, node_index: NodeIndex(None), + range: 572..573, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -722,8 +722,8 @@ Module( ), MatchMapping( PatternMatchMapping { - range: 575..577, node_index: NodeIndex(None), + range: 575..577, keys: [], patterns: [], rest: None, @@ -770,13 +770,13 @@ Module( node_index: NodeIndex(None), pattern: MatchOr( PatternMatchOr { - range: 604..672, node_index: NodeIndex(None), + range: 604..672, patterns: [ MatchMapping( PatternMatchMapping { - range: 604..626, node_index: NodeIndex(None), + range: 604..626, keys: [ NumberLiteral( ExprNumberLiteral { @@ -791,18 +791,18 @@ Module( patterns: [ MatchOr( PatternMatchOr { - range: 608..625, node_index: NodeIndex(None), + range: 608..625, patterns: [ MatchSequence( PatternMatchSequence { - range: 608..618, node_index: NodeIndex(None), + range: 608..618, patterns: [ MatchValue( PatternMatchValue { - range: 609..610, node_index: NodeIndex(None), + range: 609..610, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -816,8 +816,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 612..613, node_index: NodeIndex(None), + range: 612..613, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -831,8 +831,8 @@ Module( ), MatchMapping( PatternMatchMapping { - range: 615..617, node_index: NodeIndex(None), + range: 615..617, keys: [], patterns: [], rest: None, @@ -843,8 +843,8 @@ Module( ), MatchSingleton( PatternMatchSingleton { - range: 621..625, node_index: NodeIndex(None), + range: 621..625, value: True, }, ), @@ -857,8 +857,8 @@ Module( ), MatchMapping( PatternMatchMapping { - range: 629..638, node_index: NodeIndex(None), + range: 629..638, keys: [ NumberLiteral( ExprNumberLiteral { @@ -873,13 +873,13 @@ Module( patterns: [ MatchSequence( PatternMatchSequence { - range: 633..637, node_index: NodeIndex(None), + range: 633..637, patterns: [ MatchSequence( PatternMatchSequence { - range: 634..636, node_index: NodeIndex(None), + range: 634..636, patterns: [], }, ), @@ -892,8 +892,8 @@ Module( ), MatchMapping( PatternMatchMapping { - range: 641..656, node_index: NodeIndex(None), + range: 641..656, keys: [ NumberLiteral( ExprNumberLiteral { @@ -908,13 +908,13 @@ Module( patterns: [ MatchSequence( PatternMatchSequence { - range: 645..655, node_index: NodeIndex(None), + range: 645..655, patterns: [ MatchValue( PatternMatchValue { - range: 646..647, node_index: NodeIndex(None), + range: 646..647, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -928,8 +928,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 649..650, node_index: NodeIndex(None), + range: 649..650, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -943,8 +943,8 @@ Module( ), MatchMapping( PatternMatchMapping { - range: 652..654, node_index: NodeIndex(None), + range: 652..654, keys: [], patterns: [], rest: None, @@ -959,15 +959,15 @@ Module( ), MatchSequence( PatternMatchSequence { - range: 659..661, node_index: NodeIndex(None), + range: 659..661, patterns: [], }, ), MatchValue( PatternMatchValue { - range: 664..667, node_index: NodeIndex(None), + range: 664..667, value: StringLiteral( ExprStringLiteral { node_index: NodeIndex(None), @@ -993,8 +993,8 @@ Module( ), MatchMapping( PatternMatchMapping { - range: 670..672, node_index: NodeIndex(None), + range: 670..672, keys: [], patterns: [], rest: None, @@ -1037,8 +1037,8 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 697..699, node_index: NodeIndex(None), + range: 697..699, patterns: [], }, ), @@ -1092,8 +1092,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 755..767, node_index: NodeIndex(None), + range: 755..767, value: BinOp( ExprBinOp { node_index: NodeIndex(None), @@ -1172,8 +1172,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 823..826, node_index: NodeIndex(None), + range: 823..826, value: UnaryOp( ExprUnaryOp { node_index: NodeIndex(None), @@ -1244,13 +1244,13 @@ Module( node_index: NodeIndex(None), pattern: MatchOr( PatternMatchOr { - range: 882..895, node_index: NodeIndex(None), + range: 882..895, patterns: [ MatchValue( PatternMatchValue { - range: 882..883, node_index: NodeIndex(None), + range: 882..883, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -1264,8 +1264,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 886..887, node_index: NodeIndex(None), + range: 886..887, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -1279,8 +1279,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 890..891, node_index: NodeIndex(None), + range: 890..891, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -1294,8 +1294,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 894..895, node_index: NodeIndex(None), + range: 894..895, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -1358,8 +1358,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 954..955, node_index: NodeIndex(None), + range: 954..955, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -1430,8 +1430,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 1016..1022, node_index: NodeIndex(None), + range: 1016..1022, keys: [ NumberLiteral( ExprNumberLiteral { @@ -1446,8 +1446,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 1020..1021, node_index: NodeIndex(None), + range: 1020..1021, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -1497,8 +1497,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 1047..1053, node_index: NodeIndex(None), + range: 1047..1053, keys: [ NumberLiteral( ExprNumberLiteral { @@ -1513,8 +1513,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 1051..1052, node_index: NodeIndex(None), + range: 1051..1052, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -1564,8 +1564,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 1078..1083, node_index: NodeIndex(None), + range: 1078..1083, keys: [], patterns: [], rest: Some( @@ -1639,13 +1639,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 1143..1147, node_index: NodeIndex(None), + range: 1143..1147, patterns: [ MatchStar( PatternMatchStar { - range: 1144..1146, node_index: NodeIndex(None), + range: 1144..1146, name: None, }, ), @@ -1702,8 +1702,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 1203..1204, node_index: NodeIndex(None), + range: 1203..1204, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -1749,8 +1749,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 1229..1230, node_index: NodeIndex(None), + range: 1229..1230, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -1812,8 +1812,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 1286..1298, node_index: NodeIndex(None), + range: 1286..1298, keys: [ StringLiteral( ExprStringLiteral { @@ -1840,8 +1840,8 @@ Module( patterns: [ MatchAs( PatternMatchAs { - range: 1294..1297, node_index: NodeIndex(None), + range: 1294..1297, pattern: None, name: Some( Identifier { @@ -1934,13 +1934,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 1364..1377, node_index: NodeIndex(None), + range: 1364..1377, patterns: [ MatchValue( PatternMatchValue { - range: 1365..1366, node_index: NodeIndex(None), + range: 1365..1366, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -1954,8 +1954,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 1368..1369, node_index: NodeIndex(None), + range: 1368..1369, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -1969,8 +1969,8 @@ Module( ), MatchStar( PatternMatchStar { - range: 1371..1373, node_index: NodeIndex(None), + range: 1371..1373, name: Some( Identifier { id: Name("x"), @@ -1982,8 +1982,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 1375..1376, node_index: NodeIndex(None), + range: 1375..1376, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -2048,13 +2048,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 1433..1436, node_index: NodeIndex(None), + range: 1433..1436, patterns: [ MatchValue( PatternMatchValue { - range: 1434..1435, node_index: NodeIndex(None), + range: 1434..1435, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -2103,13 +2103,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 1461..1467, node_index: NodeIndex(None), + range: 1461..1467, patterns: [ MatchValue( PatternMatchValue { - range: 1462..1463, node_index: NodeIndex(None), + range: 1462..1463, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -2123,8 +2123,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 1465..1466, node_index: NodeIndex(None), + range: 1465..1466, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -2222,13 +2222,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 1508..1514, node_index: NodeIndex(None), + range: 1508..1514, patterns: [ MatchValue( PatternMatchValue { - range: 1509..1510, node_index: NodeIndex(None), + range: 1509..1510, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -2242,8 +2242,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 1512..1513, node_index: NodeIndex(None), + range: 1512..1513, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -2308,13 +2308,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 1570..1580, node_index: NodeIndex(None), + range: 1570..1580, patterns: [ MatchAs( PatternMatchAs { - range: 1571..1572, node_index: NodeIndex(None), + range: 1571..1572, pattern: None, name: Some( Identifier { @@ -2327,8 +2327,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 1574..1575, node_index: NodeIndex(None), + range: 1574..1575, pattern: None, name: Some( Identifier { @@ -2341,8 +2341,8 @@ Module( ), MatchStar( PatternMatchStar { - range: 1577..1579, node_index: NodeIndex(None), + range: 1577..1579, name: None, }, ), @@ -2399,8 +2399,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 1636..1649, node_index: NodeIndex(None), + range: 1636..1649, value: BinOp( ExprBinOp { node_index: NodeIndex(None), @@ -2496,13 +2496,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 1708..1711, node_index: NodeIndex(None), + range: 1708..1711, patterns: [ MatchAs( PatternMatchAs { - range: 1709..1710, node_index: NodeIndex(None), + range: 1709..1710, pattern: None, name: Some( Identifier { @@ -2566,8 +2566,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 1767..1774, node_index: NodeIndex(None), + range: 1767..1774, value: Attribute( ExprAttribute { node_index: NodeIndex(None), @@ -2664,8 +2664,8 @@ Module( node_index: NodeIndex(None), pattern: MatchSingleton( PatternMatchSingleton { - range: 1830..1834, node_index: NodeIndex(None), + range: 1830..1834, value: None, }, ), @@ -2719,8 +2719,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 1890..1891, node_index: NodeIndex(None), + range: 1890..1891, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -2782,8 +2782,8 @@ Module( node_index: NodeIndex(None), pattern: MatchSingleton( PatternMatchSingleton { - range: 1947..1952, node_index: NodeIndex(None), + range: 1947..1952, value: False, }, ), @@ -2837,8 +2837,8 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 2008..2010, node_index: NodeIndex(None), + range: 2008..2010, patterns: [], }, ), @@ -2876,13 +2876,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 2035..2039, node_index: NodeIndex(None), + range: 2035..2039, patterns: [ MatchValue( PatternMatchValue { - range: 2036..2038, node_index: NodeIndex(None), + range: 2036..2038, value: StringLiteral( ExprStringLiteral { node_index: NodeIndex(None), @@ -2943,8 +2943,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 2064..2066, node_index: NodeIndex(None), + range: 2064..2066, value: StringLiteral( ExprStringLiteral { node_index: NodeIndex(None), @@ -3018,8 +3018,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 2122..2123, node_index: NodeIndex(None), + range: 2122..2123, pattern: None, name: Some( Identifier { @@ -3080,13 +3080,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 2179..2192, node_index: NodeIndex(None), + range: 2179..2192, patterns: [ MatchAs( PatternMatchAs { - range: 2180..2181, node_index: NodeIndex(None), + range: 2180..2181, pattern: None, name: Some( Identifier { @@ -3099,8 +3099,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 2183..2184, node_index: NodeIndex(None), + range: 2183..2184, pattern: None, name: Some( Identifier { @@ -3113,8 +3113,8 @@ Module( ), MatchStar( PatternMatchStar { - range: 2186..2191, node_index: NodeIndex(None), + range: 2186..2191, name: Some( Identifier { id: Name("rest"), @@ -3177,18 +3177,18 @@ Module( node_index: NodeIndex(None), pattern: MatchOr( PatternMatchOr { - range: 2248..2278, node_index: NodeIndex(None), + range: 2248..2278, patterns: [ MatchAs( PatternMatchAs { - range: 2249..2255, node_index: NodeIndex(None), + range: 2249..2255, pattern: Some( MatchValue( PatternMatchValue { - range: 2249..2250, node_index: NodeIndex(None), + range: 2249..2250, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -3212,13 +3212,13 @@ Module( ), MatchAs( PatternMatchAs { - range: 2260..2266, node_index: NodeIndex(None), + range: 2260..2266, pattern: Some( MatchValue( PatternMatchValue { - range: 2260..2261, node_index: NodeIndex(None), + range: 2260..2261, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -3242,13 +3242,13 @@ Module( ), MatchAs( PatternMatchAs { - range: 2271..2277, node_index: NodeIndex(None), + range: 2271..2277, pattern: Some( MatchValue( PatternMatchValue { - range: 2271..2272, node_index: NodeIndex(None), + range: 2271..2272, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -3367,8 +3367,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 2348..2363, node_index: NodeIndex(None), + range: 2348..2363, keys: [ NumberLiteral( ExprNumberLiteral { @@ -3383,13 +3383,13 @@ Module( patterns: [ MatchSequence( PatternMatchSequence { - range: 2352..2362, node_index: NodeIndex(None), + range: 2352..2362, patterns: [ MatchValue( PatternMatchValue { - range: 2353..2354, node_index: NodeIndex(None), + range: 2353..2354, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -3403,8 +3403,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 2356..2357, node_index: NodeIndex(None), + range: 2356..2357, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -3418,8 +3418,8 @@ Module( ), MatchMapping( PatternMatchMapping { - range: 2359..2361, node_index: NodeIndex(None), + range: 2359..2361, keys: [], patterns: [], rest: None, @@ -3466,13 +3466,13 @@ Module( node_index: NodeIndex(None), pattern: MatchOr( PatternMatchOr { - range: 2388..2457, node_index: NodeIndex(None), + range: 2388..2457, patterns: [ MatchMapping( PatternMatchMapping { - range: 2388..2411, node_index: NodeIndex(None), + range: 2388..2411, keys: [ NumberLiteral( ExprNumberLiteral { @@ -3487,18 +3487,18 @@ Module( patterns: [ MatchOr( PatternMatchOr { - range: 2392..2410, node_index: NodeIndex(None), + range: 2392..2410, patterns: [ MatchSequence( PatternMatchSequence { - range: 2392..2402, node_index: NodeIndex(None), + range: 2392..2402, patterns: [ MatchValue( PatternMatchValue { - range: 2393..2394, node_index: NodeIndex(None), + range: 2393..2394, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -3512,8 +3512,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 2396..2397, node_index: NodeIndex(None), + range: 2396..2397, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -3527,8 +3527,8 @@ Module( ), MatchMapping( PatternMatchMapping { - range: 2399..2401, node_index: NodeIndex(None), + range: 2399..2401, keys: [], patterns: [], rest: None, @@ -3539,8 +3539,8 @@ Module( ), MatchSingleton( PatternMatchSingleton { - range: 2405..2410, node_index: NodeIndex(None), + range: 2405..2410, value: False, }, ), @@ -3553,8 +3553,8 @@ Module( ), MatchMapping( PatternMatchMapping { - range: 2414..2423, node_index: NodeIndex(None), + range: 2414..2423, keys: [ NumberLiteral( ExprNumberLiteral { @@ -3569,13 +3569,13 @@ Module( patterns: [ MatchSequence( PatternMatchSequence { - range: 2418..2422, node_index: NodeIndex(None), + range: 2418..2422, patterns: [ MatchSequence( PatternMatchSequence { - range: 2419..2421, node_index: NodeIndex(None), + range: 2419..2421, patterns: [], }, ), @@ -3588,8 +3588,8 @@ Module( ), MatchMapping( PatternMatchMapping { - range: 2426..2441, node_index: NodeIndex(None), + range: 2426..2441, keys: [ NumberLiteral( ExprNumberLiteral { @@ -3604,13 +3604,13 @@ Module( patterns: [ MatchSequence( PatternMatchSequence { - range: 2430..2440, node_index: NodeIndex(None), + range: 2430..2440, patterns: [ MatchValue( PatternMatchValue { - range: 2431..2432, node_index: NodeIndex(None), + range: 2431..2432, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -3624,8 +3624,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 2434..2435, node_index: NodeIndex(None), + range: 2434..2435, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -3639,8 +3639,8 @@ Module( ), MatchMapping( PatternMatchMapping { - range: 2437..2439, node_index: NodeIndex(None), + range: 2437..2439, keys: [], patterns: [], rest: None, @@ -3655,15 +3655,15 @@ Module( ), MatchSequence( PatternMatchSequence { - range: 2444..2446, node_index: NodeIndex(None), + range: 2444..2446, patterns: [], }, ), MatchValue( PatternMatchValue { - range: 2449..2452, node_index: NodeIndex(None), + range: 2449..2452, value: StringLiteral( ExprStringLiteral { node_index: NodeIndex(None), @@ -3689,8 +3689,8 @@ Module( ), MatchMapping( PatternMatchMapping { - range: 2455..2457, node_index: NodeIndex(None), + range: 2455..2457, keys: [], patterns: [], rest: None, @@ -3733,8 +3733,8 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 2482..2484, node_index: NodeIndex(None), + range: 2482..2484, patterns: [], }, ), @@ -3817,13 +3817,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 2548..2553, node_index: NodeIndex(None), + range: 2548..2553, patterns: [ MatchValue( PatternMatchValue { - range: 2548..2549, node_index: NodeIndex(None), + range: 2548..2549, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -3837,8 +3837,8 @@ Module( ), MatchStar( PatternMatchStar { - range: 2551..2553, node_index: NodeIndex(None), + range: 2551..2553, name: Some( Identifier { id: Name("x"), @@ -3930,13 +3930,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 2617..2623, node_index: NodeIndex(None), + range: 2617..2623, patterns: [ MatchStar( PatternMatchStar { - range: 2617..2619, node_index: NodeIndex(None), + range: 2617..2619, name: Some( Identifier { id: Name("x"), @@ -3948,8 +3948,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 2621..2622, node_index: NodeIndex(None), + range: 2621..2622, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -4024,13 +4024,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 2680..2682, node_index: NodeIndex(None), + range: 2680..2682, patterns: [ MatchAs( PatternMatchAs { - range: 2680..2681, node_index: NodeIndex(None), + range: 2680..2681, pattern: None, name: Some( Identifier { @@ -4112,13 +4112,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 2741..2745, node_index: NodeIndex(None), + range: 2741..2745, patterns: [ MatchAs( PatternMatchAs { - range: 2741..2742, node_index: NodeIndex(None), + range: 2741..2742, pattern: None, name: Some( Identifier { @@ -4131,8 +4131,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 2744..2745, node_index: NodeIndex(None), + range: 2744..2745, pattern: None, name: Some( Identifier { @@ -4220,18 +4220,18 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 2807..2814, node_index: NodeIndex(None), + range: 2807..2814, patterns: [ MatchAs( PatternMatchAs { - range: 2807..2813, node_index: NodeIndex(None), + range: 2807..2813, pattern: Some( MatchAs( PatternMatchAs { - range: 2807..2808, node_index: NodeIndex(None), + range: 2807..2808, pattern: None, name: Some( Identifier { @@ -4305,8 +4305,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 2932..2938, node_index: NodeIndex(None), + range: 2932..2938, value: FString( ExprFString { node_index: NodeIndex(None), @@ -4415,8 +4415,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 2981..3004, node_index: NodeIndex(None), + range: 2981..3004, keys: [], patterns: [], rest: Some( @@ -4534,8 +4534,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 3060..3107, node_index: NodeIndex(None), + range: 3060..3107, keys: [ StringLiteral( ExprStringLiteral { @@ -4562,18 +4562,18 @@ Module( patterns: [ MatchAs( PatternMatchAs { - range: 3079..3100, node_index: NodeIndex(None), + range: 3079..3100, pattern: Some( MatchOr( PatternMatchOr { - range: 3079..3091, node_index: NodeIndex(None), + range: 3079..3091, patterns: [ MatchClass( PatternMatchClass { - range: 3079..3084, node_index: NodeIndex(None), + range: 3079..3084, cls: Name( ExprName { node_index: NodeIndex(None), @@ -4592,8 +4592,8 @@ Module( ), MatchSingleton( PatternMatchSingleton { - range: 3087..3091, node_index: NodeIndex(None), + range: 3087..3091, value: None, }, ), @@ -4674,13 +4674,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 3148..3155, node_index: NodeIndex(None), + range: 3148..3155, patterns: [ MatchValue( PatternMatchValue { - range: 3149..3150, node_index: NodeIndex(None), + range: 3149..3150, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -4694,8 +4694,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 3152..3153, node_index: NodeIndex(None), + range: 3152..3153, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -4760,13 +4760,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 3189..3196, node_index: NodeIndex(None), + range: 3189..3196, patterns: [ MatchValue( PatternMatchValue { - range: 3190..3191, node_index: NodeIndex(None), + range: 3190..3191, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -4780,8 +4780,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 3193..3194, node_index: NodeIndex(None), + range: 3193..3194, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -4846,13 +4846,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 3230..3234, node_index: NodeIndex(None), + range: 3230..3234, patterns: [ MatchValue( PatternMatchValue { - range: 3231..3232, node_index: NodeIndex(None), + range: 3231..3232, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -4927,8 +4927,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 3269..3270, node_index: NodeIndex(None), + range: 3269..3270, pattern: None, name: Some( Identifier { @@ -4988,8 +4988,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 3306..3307, node_index: NodeIndex(None), + range: 3306..3307, pattern: None, name: Some( Identifier { @@ -5049,8 +5049,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 3344..3345, node_index: NodeIndex(None), + range: 3344..3345, pattern: None, name: Some( Identifier { @@ -5092,8 +5092,8 @@ Module( node_index: NodeIndex(None), pattern: MatchSingleton( PatternMatchSingleton { - range: 3403..3407, node_index: NodeIndex(None), + range: 3403..3407, value: None, }, ), @@ -5118,8 +5118,8 @@ Module( node_index: NodeIndex(None), pattern: MatchSingleton( PatternMatchSingleton { - range: 3430..3434, node_index: NodeIndex(None), + range: 3430..3434, value: True, }, ), @@ -5144,8 +5144,8 @@ Module( node_index: NodeIndex(None), pattern: MatchSingleton( PatternMatchSingleton { - range: 3457..3462, node_index: NodeIndex(None), + range: 3457..3462, value: False, }, ), @@ -5186,8 +5186,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 3515..3518, node_index: NodeIndex(None), + range: 3515..3518, value: Attribute( ExprAttribute { node_index: NodeIndex(None), @@ -5231,8 +5231,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 3541..3546, node_index: NodeIndex(None), + range: 3541..3546, value: Attribute( ExprAttribute { node_index: NodeIndex(None), @@ -5288,8 +5288,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 3569..3571, node_index: NodeIndex(None), + range: 3569..3571, value: StringLiteral( ExprStringLiteral { node_index: NodeIndex(None), @@ -5334,8 +5334,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 3594..3597, node_index: NodeIndex(None), + range: 3594..3597, value: BytesLiteral( ExprBytesLiteral { node_index: NodeIndex(None), @@ -5380,8 +5380,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 3620..3621, node_index: NodeIndex(None), + range: 3620..3621, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -5414,8 +5414,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 3644..3647, node_index: NodeIndex(None), + range: 3644..3647, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -5448,8 +5448,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 3670..3674, node_index: NodeIndex(None), + range: 3670..3674, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -5483,8 +5483,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 3697..3703, node_index: NodeIndex(None), + range: 3697..3703, value: BinOp( ExprBinOp { node_index: NodeIndex(None), @@ -5534,8 +5534,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 3726..3728, node_index: NodeIndex(None), + range: 3726..3728, value: UnaryOp( ExprUnaryOp { node_index: NodeIndex(None), @@ -5575,8 +5575,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 3751..3754, node_index: NodeIndex(None), + range: 3751..3754, value: UnaryOp( ExprUnaryOp { node_index: NodeIndex(None), @@ -5616,8 +5616,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 3777..3782, node_index: NodeIndex(None), + range: 3777..3782, value: UnaryOp( ExprUnaryOp { node_index: NodeIndex(None), @@ -5657,8 +5657,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 3806..3807, node_index: NodeIndex(None), + range: 3806..3807, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -5707,13 +5707,13 @@ Module( node_index: NodeIndex(None), pattern: MatchOr( PatternMatchOr { - range: 3858..3863, node_index: NodeIndex(None), + range: 3858..3863, patterns: [ MatchValue( PatternMatchValue { - range: 3858..3859, node_index: NodeIndex(None), + range: 3858..3859, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -5727,8 +5727,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 3862..3863, node_index: NodeIndex(None), + range: 3862..3863, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -5764,13 +5764,13 @@ Module( node_index: NodeIndex(None), pattern: MatchOr( PatternMatchOr { - range: 3886..3914, node_index: NodeIndex(None), + range: 3886..3914, patterns: [ MatchValue( PatternMatchValue { - range: 3886..3888, node_index: NodeIndex(None), + range: 3886..3888, value: StringLiteral( ExprStringLiteral { node_index: NodeIndex(None), @@ -5796,8 +5796,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 3891..3894, node_index: NodeIndex(None), + range: 3891..3894, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -5811,8 +5811,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 3897..3899, node_index: NodeIndex(None), + range: 3897..3899, value: UnaryOp( ExprUnaryOp { node_index: NodeIndex(None), @@ -5833,8 +5833,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 3902..3908, node_index: NodeIndex(None), + range: 3902..3908, value: BinOp( ExprBinOp { node_index: NodeIndex(None), @@ -5865,8 +5865,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 3911..3914, node_index: NodeIndex(None), + range: 3911..3914, value: Attribute( ExprAttribute { node_index: NodeIndex(None), @@ -5929,8 +5929,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 3964..3965, node_index: NodeIndex(None), + range: 3964..3965, pattern: None, name: Some( Identifier { @@ -5978,13 +5978,13 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 3997..4003, node_index: NodeIndex(None), + range: 3997..4003, pattern: Some( MatchAs( PatternMatchAs { - range: 3997..3998, node_index: NodeIndex(None), + range: 3997..3998, pattern: None, name: Some( Identifier { @@ -6042,18 +6042,18 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 4035..4047, node_index: NodeIndex(None), + range: 4035..4047, pattern: Some( MatchOr( PatternMatchOr { - range: 4035..4040, node_index: NodeIndex(None), + range: 4035..4040, patterns: [ MatchValue( PatternMatchValue { - range: 4035..4036, node_index: NodeIndex(None), + range: 4035..4036, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -6067,8 +6067,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 4039..4040, node_index: NodeIndex(None), + range: 4039..4040, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -6114,13 +6114,13 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 4070..4083, node_index: NodeIndex(None), + range: 4070..4083, pattern: Some( MatchValue( PatternMatchValue { - range: 4070..4076, node_index: NodeIndex(None), + range: 4070..4076, value: BinOp( ExprBinOp { node_index: NodeIndex(None), @@ -6180,13 +6180,13 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 4106..4115, node_index: NodeIndex(None), + range: 4106..4115, pattern: Some( MatchValue( PatternMatchValue { - range: 4106..4109, node_index: NodeIndex(None), + range: 4106..4109, value: Attribute( ExprAttribute { node_index: NodeIndex(None), @@ -6240,13 +6240,13 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 4138..4144, node_index: NodeIndex(None), + range: 4138..4144, pattern: Some( MatchAs( PatternMatchAs { - range: 4138..4139, node_index: NodeIndex(None), + range: 4138..4139, pattern: None, name: None, }, @@ -6298,8 +6298,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 4176..4177, node_index: NodeIndex(None), + range: 4176..4177, pattern: None, name: None, }, @@ -6341,13 +6341,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 4233..4240, node_index: NodeIndex(None), + range: 4233..4240, patterns: [ MatchValue( PatternMatchValue { - range: 4233..4234, node_index: NodeIndex(None), + range: 4233..4234, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -6361,8 +6361,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 4236..4237, node_index: NodeIndex(None), + range: 4236..4237, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -6376,8 +6376,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 4239..4240, node_index: NodeIndex(None), + range: 4239..4240, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -6413,13 +6413,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 4263..4273, node_index: NodeIndex(None), + range: 4263..4273, patterns: [ MatchValue( PatternMatchValue { - range: 4264..4265, node_index: NodeIndex(None), + range: 4264..4265, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -6433,8 +6433,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 4267..4268, node_index: NodeIndex(None), + range: 4267..4268, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -6448,8 +6448,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 4270..4271, node_index: NodeIndex(None), + range: 4270..4271, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -6485,13 +6485,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 4296..4318, node_index: NodeIndex(None), + range: 4296..4318, patterns: [ MatchValue( PatternMatchValue { - range: 4297..4303, node_index: NodeIndex(None), + range: 4297..4303, value: BinOp( ExprBinOp { node_index: NodeIndex(None), @@ -6522,8 +6522,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 4305..4306, node_index: NodeIndex(None), + range: 4305..4306, pattern: None, name: Some( Identifier { @@ -6536,15 +6536,15 @@ Module( ), MatchSingleton( PatternMatchSingleton { - range: 4308..4312, node_index: NodeIndex(None), + range: 4308..4312, value: None, }, ), MatchValue( PatternMatchValue { - range: 4314..4317, node_index: NodeIndex(None), + range: 4314..4317, value: Attribute( ExprAttribute { node_index: NodeIndex(None), @@ -6591,23 +6591,23 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 4341..4357, node_index: NodeIndex(None), + range: 4341..4357, pattern: Some( MatchSequence( PatternMatchSequence { - range: 4341..4352, node_index: NodeIndex(None), + range: 4341..4352, patterns: [ MatchAs( PatternMatchAs { - range: 4342..4348, node_index: NodeIndex(None), + range: 4342..4348, pattern: Some( MatchValue( PatternMatchValue { - range: 4342..4343, node_index: NodeIndex(None), + range: 4342..4343, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -6631,8 +6631,8 @@ Module( ), MatchAs( PatternMatchAs { - range: 4350..4351, node_index: NodeIndex(None), + range: 4350..4351, pattern: None, name: Some( Identifier { @@ -6677,13 +6677,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 4380..4394, node_index: NodeIndex(None), + range: 4380..4394, patterns: [ MatchValue( PatternMatchValue { - range: 4381..4382, node_index: NodeIndex(None), + range: 4381..4382, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -6697,8 +6697,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 4384..4385, node_index: NodeIndex(None), + range: 4384..4385, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -6712,8 +6712,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 4387..4393, node_index: NodeIndex(None), + range: 4387..4393, value: BinOp( ExprBinOp { node_index: NodeIndex(None), @@ -6766,18 +6766,18 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 4417..4427, node_index: NodeIndex(None), + range: 4417..4427, patterns: [ MatchSequence( PatternMatchSequence { - range: 4418..4423, node_index: NodeIndex(None), + range: 4418..4423, patterns: [ MatchValue( PatternMatchValue { - range: 4419..4420, node_index: NodeIndex(None), + range: 4419..4420, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -6791,8 +6791,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 4421..4422, node_index: NodeIndex(None), + range: 4421..4422, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -6809,8 +6809,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 4425..4426, node_index: NodeIndex(None), + range: 4425..4426, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -6846,13 +6846,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 4450..4453, node_index: NodeIndex(None), + range: 4450..4453, patterns: [ MatchValue( PatternMatchValue { - range: 4451..4452, node_index: NodeIndex(None), + range: 4451..4452, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -6904,13 +6904,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 4505..4508, node_index: NodeIndex(None), + range: 4505..4508, patterns: [ MatchStar( PatternMatchStar { - range: 4505..4507, node_index: NodeIndex(None), + range: 4505..4507, name: Some( Identifier { id: Name("a"), @@ -6944,13 +6944,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 4531..4534, node_index: NodeIndex(None), + range: 4531..4534, patterns: [ MatchStar( PatternMatchStar { - range: 4531..4533, node_index: NodeIndex(None), + range: 4531..4533, name: None, }, ), @@ -6978,13 +6978,13 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 4557..4570, node_index: NodeIndex(None), + range: 4557..4570, patterns: [ MatchValue( PatternMatchValue { - range: 4558..4559, node_index: NodeIndex(None), + range: 4558..4559, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -6998,8 +6998,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 4561..4562, node_index: NodeIndex(None), + range: 4561..4562, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -7013,8 +7013,8 @@ Module( ), MatchStar( PatternMatchStar { - range: 4564..4569, node_index: NodeIndex(None), + range: 4564..4569, name: Some( Identifier { id: Name("rest"), @@ -7048,20 +7048,20 @@ Module( node_index: NodeIndex(None), pattern: MatchSequence( PatternMatchSequence { - range: 4593..4603, node_index: NodeIndex(None), + range: 4593..4603, patterns: [ MatchStar( PatternMatchStar { - range: 4594..4596, node_index: NodeIndex(None), + range: 4594..4596, name: None, }, ), MatchValue( PatternMatchValue { - range: 4598..4599, node_index: NodeIndex(None), + range: 4598..4599, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -7075,8 +7075,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 4601..4602, node_index: NodeIndex(None), + range: 4601..4602, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -7128,8 +7128,8 @@ Module( node_index: NodeIndex(None), pattern: MatchClass( PatternMatchClass { - range: 4656..4663, node_index: NodeIndex(None), + range: 4656..4663, cls: Name( ExprName { node_index: NodeIndex(None), @@ -7167,8 +7167,8 @@ Module( node_index: NodeIndex(None), pattern: MatchClass( PatternMatchClass { - range: 4686..4697, node_index: NodeIndex(None), + range: 4686..4697, cls: Attribute( ExprAttribute { node_index: NodeIndex(None), @@ -7230,8 +7230,8 @@ Module( node_index: NodeIndex(None), pattern: MatchClass( PatternMatchClass { - range: 4720..4732, node_index: NodeIndex(None), + range: 4720..4732, cls: Name( ExprName { node_index: NodeIndex(None), @@ -7255,8 +7255,8 @@ Module( }, pattern: MatchValue( PatternMatchValue { - range: 4730..4731, node_index: NodeIndex(None), + range: 4730..4731, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -7294,8 +7294,8 @@ Module( node_index: NodeIndex(None), pattern: MatchClass( PatternMatchClass { - range: 4755..4773, node_index: NodeIndex(None), + range: 4755..4773, cls: Name( ExprName { node_index: NodeIndex(None), @@ -7319,8 +7319,8 @@ Module( }, pattern: MatchValue( PatternMatchValue { - range: 4765..4766, node_index: NodeIndex(None), + range: 4765..4766, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -7343,8 +7343,8 @@ Module( }, pattern: MatchValue( PatternMatchValue { - range: 4770..4771, node_index: NodeIndex(None), + range: 4770..4771, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -7382,8 +7382,8 @@ Module( node_index: NodeIndex(None), pattern: MatchClass( PatternMatchClass { - range: 4796..4809, node_index: NodeIndex(None), + range: 4796..4809, cls: Name( ExprName { node_index: NodeIndex(None), @@ -7398,8 +7398,8 @@ Module( patterns: [ MatchValue( PatternMatchValue { - range: 4804..4805, node_index: NodeIndex(None), + range: 4804..4805, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -7413,8 +7413,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 4807..4808, node_index: NodeIndex(None), + range: 4807..4808, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -7452,8 +7452,8 @@ Module( node_index: NodeIndex(None), pattern: MatchClass( PatternMatchClass { - range: 4832..4852, node_index: NodeIndex(None), + range: 4832..4852, cls: Name( ExprName { node_index: NodeIndex(None), @@ -7468,13 +7468,13 @@ Module( patterns: [ MatchSequence( PatternMatchSequence { - range: 4840..4846, node_index: NodeIndex(None), + range: 4840..4846, patterns: [ MatchValue( PatternMatchValue { - range: 4841..4842, node_index: NodeIndex(None), + range: 4841..4842, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -7488,8 +7488,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 4844..4845, node_index: NodeIndex(None), + range: 4844..4845, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -7516,8 +7516,8 @@ Module( }, pattern: MatchValue( PatternMatchValue { - range: 4850..4851, node_index: NodeIndex(None), + range: 4850..4851, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -7555,8 +7555,8 @@ Module( node_index: NodeIndex(None), pattern: MatchClass( PatternMatchClass { - range: 4875..4897, node_index: NodeIndex(None), + range: 4875..4897, cls: Name( ExprName { node_index: NodeIndex(None), @@ -7580,13 +7580,13 @@ Module( }, pattern: MatchSequence( PatternMatchSequence { - range: 4885..4891, node_index: NodeIndex(None), + range: 4885..4891, patterns: [ MatchValue( PatternMatchValue { - range: 4886..4887, node_index: NodeIndex(None), + range: 4886..4887, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -7600,8 +7600,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 4889..4890, node_index: NodeIndex(None), + range: 4889..4890, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -7627,8 +7627,8 @@ Module( }, pattern: MatchValue( PatternMatchValue { - range: 4895..4896, node_index: NodeIndex(None), + range: 4895..4896, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -7696,8 +7696,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 4957..4963, node_index: NodeIndex(None), + range: 4957..4963, keys: [ NumberLiteral( ExprNumberLiteral { @@ -7712,8 +7712,8 @@ Module( patterns: [ MatchAs( PatternMatchAs { - range: 4961..4962, node_index: NodeIndex(None), + range: 4961..4962, pattern: None, name: None, }, @@ -7743,8 +7743,8 @@ Module( node_index: NodeIndex(None), pattern: MatchMapping( PatternMatchMapping { - range: 4986..5015, node_index: NodeIndex(None), + range: 4986..5015, keys: [ StringLiteral( ExprStringLiteral { @@ -7777,8 +7777,8 @@ Module( patterns: [ MatchAs( PatternMatchAs { - range: 4991..4992, node_index: NodeIndex(None), + range: 4991..4992, pattern: None, name: Some( Identifier { @@ -7791,13 +7791,13 @@ Module( ), MatchSequence( PatternMatchSequence { - range: 5000..5006, node_index: NodeIndex(None), + range: 5000..5006, patterns: [ MatchValue( PatternMatchValue { - range: 5001..5002, node_index: NodeIndex(None), + range: 5001..5002, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -7811,8 +7811,8 @@ Module( ), MatchValue( PatternMatchValue { - range: 5004..5005, node_index: NodeIndex(None), + range: 5004..5005, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -7874,8 +7874,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 5064..5065, node_index: NodeIndex(None), + range: 5064..5065, pattern: None, name: Some( Identifier { @@ -7930,8 +7930,8 @@ Module( node_index: NodeIndex(None), pattern: MatchAs( PatternMatchAs { - range: 5090..5091, node_index: NodeIndex(None), + range: 5090..5091, pattern: None, name: Some( Identifier { @@ -8763,8 +8763,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 5683..5684, node_index: NodeIndex(None), + range: 5683..5684, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None), @@ -8791,8 +8791,8 @@ Module( node_index: NodeIndex(None), pattern: MatchValue( PatternMatchValue { - range: 5700..5701, node_index: NodeIndex(None), + range: 5700..5701, value: NumberLiteral( ExprNumberLiteral { node_index: NodeIndex(None),