diff --git a/Cargo.toml b/Cargo.toml index e5502ba..96c1b0f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,6 +32,8 @@ rand = "0.8.5" serde = "1.0" static_assertions = "1.1" unicode_names2 = { version = "0.6.0", git = "https://github.com/youknowone/unicode_names2.git", rev = "4ce16aa85cbcdd9cc830410f1a72ef9a235f2fde" } +ruff_python_ast = { git = "https://github.com/youknowone/ruff.git", rev = "583df5c1fa43b2732896219f8ab425116c140c80" } +# ruff_python_ast = { path = "../ruff/crates/ruff_python_ast" } [profile.dev.package."*"] opt-level = 3 diff --git a/ast/asdl_rs.py b/ast/asdl_rs.py index 2b9d192..1da5d4e 100755 --- a/ast/asdl_rs.py +++ b/ast/asdl_rs.py @@ -761,7 +761,11 @@ class TraitImplVisitor(EmitVisitor): def extract_location(self, typename, depth): row = self.decode_field(asdl.Field("int", "lineno"), typename) column = self.decode_field(asdl.Field("int", "col_offset"), typename) - self.emit(f"let _location = Location::new({row}, {column});", depth) + self.emit(f"""let _location = {{ + let row = try_location_field({row}, _vm)?; + let column = try_location_field({column}, _vm)?; + SourceLocation {{ row, column }} + }};""", depth) def decode_field(self, field, typename): name = json.dumps(field.name) @@ -785,10 +789,7 @@ def write_generic_def(mod, typeinfo, f): f.write( textwrap.dedent( """ - #![allow(clippy::derive_partial_eq_without_eq)] - pub use crate::{Attributed, constant::*}; - use rustpython_compiler_core::{text_size::{TextSize, TextRange}}; type Ident = String; \n @@ -804,15 +805,15 @@ def write_located_def(typeinfo, f): f.write( textwrap.dedent( """ - use rustpython_compiler_core::LocationRange; + use crate::location::SourceRange; - pub type Located = super::generic::Attributed; + pub type Located = super::generic::Attributed; """ ) ) for info in typeinfo.values(): if info.has_userdata: - generics = "::" + generics = "::" else: generics = "" f.write( diff --git a/ast/src/attributed.rs b/ast/src/attributed.rs index 381d46f..9bf2fbc 100644 --- a/ast/src/attributed.rs +++ b/ast/src/attributed.rs @@ -1,7 +1,5 @@ -use rustpython_compiler_core::{ - text_size::{TextRange, TextSize}, - Location, LocationRange, -}; +use crate::location::{SourceLocation, SourceRange}; +use rustpython_compiler_core::text_size::{TextRange, TextSize}; #[derive(Clone, Debug, PartialEq)] pub struct Attributed { @@ -53,16 +51,16 @@ impl Attributed { } } -impl Attributed { +impl Attributed { /// Returns the absolute start position of the node from the beginning of the document. #[inline] - pub const fn location(&self) -> Location { + pub const fn location(&self) -> SourceLocation { self.custom.start } /// Returns the absolute position at which the node ends in the source document. #[inline] - pub const fn end_location(&self) -> Location { + pub const fn end_location(&self) -> Option { self.custom.end } } diff --git a/ast/src/generic.rs b/ast/src/gen/generic.rs similarity index 99% rename from ast/src/generic.rs rename to ast/src/gen/generic.rs index 6c108f9..1b18324 100644 --- a/ast/src/generic.rs +++ b/ast/src/gen/generic.rs @@ -1,9 +1,6 @@ // File automatically generated by ast/asdl_rs.py. -#![allow(clippy::derive_partial_eq_without_eq)] - pub use crate::{constant::*, Attributed}; -use rustpython_compiler_core::text_size::{TextRange, TextSize}; type Ident = String; diff --git a/ast/src/gen/located.rs b/ast/src/gen/located.rs new file mode 100644 index 0000000..84ef959 --- /dev/null +++ b/ast/src/gen/located.rs @@ -0,0 +1,95 @@ +// File automatically generated by ast/asdl_rs.py. + +use crate::location::SourceRange; + +pub type Located = super::generic::Attributed; +pub type Mod = super::generic::Mod; +pub type ModModule = super::generic::ModModule; +pub type ModInteractive = super::generic::ModInteractive; +pub type ModExpression = super::generic::ModExpression; +pub type ModFunctionType = super::generic::ModFunctionType; +pub type Stmt = super::generic::Stmt; +pub type StmtKind = super::generic::StmtKind; +pub type StmtFunctionDef = super::generic::StmtFunctionDef; +pub type StmtAsyncFunctionDef = super::generic::StmtAsyncFunctionDef; +pub type StmtClassDef = super::generic::StmtClassDef; +pub type StmtReturn = super::generic::StmtReturn; +pub type StmtDelete = super::generic::StmtDelete; +pub type StmtAssign = super::generic::StmtAssign; +pub type StmtAugAssign = super::generic::StmtAugAssign; +pub type StmtAnnAssign = super::generic::StmtAnnAssign; +pub type StmtFor = super::generic::StmtFor; +pub type StmtAsyncFor = super::generic::StmtAsyncFor; +pub type StmtWhile = super::generic::StmtWhile; +pub type StmtIf = super::generic::StmtIf; +pub type StmtWith = super::generic::StmtWith; +pub type StmtAsyncWith = super::generic::StmtAsyncWith; +pub type StmtMatch = super::generic::StmtMatch; +pub type StmtRaise = super::generic::StmtRaise; +pub type StmtTry = super::generic::StmtTry; +pub type StmtTryStar = super::generic::StmtTryStar; +pub type StmtAssert = super::generic::StmtAssert; +pub type StmtImport = super::generic::StmtImport; +pub type StmtImportFrom = super::generic::StmtImportFrom; +pub type StmtGlobal = super::generic::StmtGlobal; +pub type StmtNonlocal = super::generic::StmtNonlocal; +pub type StmtExpr = super::generic::StmtExpr; +pub type Expr = super::generic::Expr; +pub type ExprKind = super::generic::ExprKind; +pub type ExprBoolOp = super::generic::ExprBoolOp; +pub type ExprNamedExpr = super::generic::ExprNamedExpr; +pub type ExprBinOp = super::generic::ExprBinOp; +pub type ExprUnaryOp = super::generic::ExprUnaryOp; +pub type ExprLambda = super::generic::ExprLambda; +pub type ExprIfExp = super::generic::ExprIfExp; +pub type ExprDict = super::generic::ExprDict; +pub type ExprSet = super::generic::ExprSet; +pub type ExprListComp = super::generic::ExprListComp; +pub type ExprSetComp = super::generic::ExprSetComp; +pub type ExprDictComp = super::generic::ExprDictComp; +pub type ExprGeneratorExp = super::generic::ExprGeneratorExp; +pub type ExprAwait = super::generic::ExprAwait; +pub type ExprYield = super::generic::ExprYield; +pub type ExprYieldFrom = super::generic::ExprYieldFrom; +pub type ExprCompare = super::generic::ExprCompare; +pub type ExprCall = super::generic::ExprCall; +pub type ExprFormattedValue = super::generic::ExprFormattedValue; +pub type ExprJoinedStr = super::generic::ExprJoinedStr; +pub type ExprConstant = super::generic::ExprConstant; +pub type ExprAttribute = super::generic::ExprAttribute; +pub type ExprSubscript = super::generic::ExprSubscript; +pub type ExprStarred = super::generic::ExprStarred; +pub type ExprName = super::generic::ExprName; +pub type ExprList = super::generic::ExprList; +pub type ExprTuple = super::generic::ExprTuple; +pub type ExprSlice = super::generic::ExprSlice; +pub type ExprContext = super::generic::ExprContext; +pub type Boolop = super::generic::Boolop; +pub type Operator = super::generic::Operator; +pub type Unaryop = super::generic::Unaryop; +pub type Cmpop = super::generic::Cmpop; +pub type Comprehension = super::generic::Comprehension; +pub type Excepthandler = super::generic::Excepthandler; +pub type ExcepthandlerKind = super::generic::ExcepthandlerKind; +pub type ExcepthandlerExceptHandler = super::generic::ExcepthandlerExceptHandler; +pub type Arguments = super::generic::Arguments; +pub type Arg = super::generic::Arg; +pub type ArgData = super::generic::ArgData; +pub type Keyword = super::generic::Keyword; +pub type KeywordData = super::generic::KeywordData; +pub type Alias = super::generic::Alias; +pub type AliasData = super::generic::AliasData; +pub type Withitem = super::generic::Withitem; +pub type MatchCase = super::generic::MatchCase; +pub type Pattern = super::generic::Pattern; +pub type PatternKind = super::generic::PatternKind; +pub type PatternMatchValue = super::generic::PatternMatchValue; +pub type PatternMatchSingleton = super::generic::PatternMatchSingleton; +pub type PatternMatchSequence = super::generic::PatternMatchSequence; +pub type PatternMatchMapping = super::generic::PatternMatchMapping; +pub type PatternMatchClass = super::generic::PatternMatchClass; +pub type PatternMatchStar = super::generic::PatternMatchStar; +pub type PatternMatchAs = super::generic::PatternMatchAs; +pub type PatternMatchOr = super::generic::PatternMatchOr; +pub type TypeIgnore = super::generic::TypeIgnore; +pub type TypeIgnoreTypeIgnore = super::generic::TypeIgnoreTypeIgnore; diff --git a/ast/src/lib.rs b/ast/src/lib.rs index 37014c7..56c6263 100644 --- a/ast/src/lib.rs +++ b/ast/src/lib.rs @@ -2,12 +2,21 @@ mod attributed; mod constant; #[cfg(feature = "fold")] mod fold_helpers; -mod generic; +mod generic { + #![allow(clippy::derive_partial_eq_without_eq)] + include!("gen/generic.rs"); +} mod impls; #[cfg(feature = "location")] -pub mod located; +pub mod located { + include!("gen/located.rs"); +} #[cfg(feature = "location")] mod locator; +#[cfg(feature = "location")] +pub use crate::locator::locate; +#[cfg(feature = "location")] +pub use rustpython_compiler_core::SourceLocator; #[cfg(feature = "unparse")] mod unparse; @@ -15,7 +24,36 @@ mod unparse; pub use attributed::Attributed; pub use constant::{Constant, ConversionFlag}; pub use generic::*; -#[cfg(feature = "location")] -pub use locator::Locator; pub type Suite = Vec>; + +pub mod location { + pub use rustpython_compiler_core::source_code::{OneIndexed, SourceLocation}; + + #[derive(Debug)] + pub struct SourceRange { + pub start: SourceLocation, + pub end: Option, + } + + impl SourceRange { + pub fn new(start: SourceLocation, end: SourceLocation) -> Self { + Self { + start, + end: Some(end), + } + } + pub fn unwrap_end(&self) -> SourceLocation { + self.end.unwrap() + } + } + + impl From> for SourceRange { + fn from(value: std::ops::Range) -> Self { + Self { + start: value.start, + end: Some(value.end), + } + } + } +} diff --git a/ast/src/located.rs b/ast/src/located.rs deleted file mode 100644 index ad5c27d..0000000 --- a/ast/src/located.rs +++ /dev/null @@ -1,95 +0,0 @@ -// File automatically generated by ast/asdl_rs.py. - -use rustpython_compiler_core::LocationRange; - -pub type Located = super::generic::Attributed; -pub type Mod = super::generic::Mod; -pub type ModModule = super::generic::ModModule; -pub type ModInteractive = super::generic::ModInteractive; -pub type ModExpression = super::generic::ModExpression; -pub type ModFunctionType = super::generic::ModFunctionType; -pub type Stmt = super::generic::Stmt; -pub type StmtKind = super::generic::StmtKind; -pub type StmtFunctionDef = super::generic::StmtFunctionDef; -pub type StmtAsyncFunctionDef = super::generic::StmtAsyncFunctionDef; -pub type StmtClassDef = super::generic::StmtClassDef; -pub type StmtReturn = super::generic::StmtReturn; -pub type StmtDelete = super::generic::StmtDelete; -pub type StmtAssign = super::generic::StmtAssign; -pub type StmtAugAssign = super::generic::StmtAugAssign; -pub type StmtAnnAssign = super::generic::StmtAnnAssign; -pub type StmtFor = super::generic::StmtFor; -pub type StmtAsyncFor = super::generic::StmtAsyncFor; -pub type StmtWhile = super::generic::StmtWhile; -pub type StmtIf = super::generic::StmtIf; -pub type StmtWith = super::generic::StmtWith; -pub type StmtAsyncWith = super::generic::StmtAsyncWith; -pub type StmtMatch = super::generic::StmtMatch; -pub type StmtRaise = super::generic::StmtRaise; -pub type StmtTry = super::generic::StmtTry; -pub type StmtTryStar = super::generic::StmtTryStar; -pub type StmtAssert = super::generic::StmtAssert; -pub type StmtImport = super::generic::StmtImport; -pub type StmtImportFrom = super::generic::StmtImportFrom; -pub type StmtGlobal = super::generic::StmtGlobal; -pub type StmtNonlocal = super::generic::StmtNonlocal; -pub type StmtExpr = super::generic::StmtExpr; -pub type Expr = super::generic::Expr; -pub type ExprKind = super::generic::ExprKind; -pub type ExprBoolOp = super::generic::ExprBoolOp; -pub type ExprNamedExpr = super::generic::ExprNamedExpr; -pub type ExprBinOp = super::generic::ExprBinOp; -pub type ExprUnaryOp = super::generic::ExprUnaryOp; -pub type ExprLambda = super::generic::ExprLambda; -pub type ExprIfExp = super::generic::ExprIfExp; -pub type ExprDict = super::generic::ExprDict; -pub type ExprSet = super::generic::ExprSet; -pub type ExprListComp = super::generic::ExprListComp; -pub type ExprSetComp = super::generic::ExprSetComp; -pub type ExprDictComp = super::generic::ExprDictComp; -pub type ExprGeneratorExp = super::generic::ExprGeneratorExp; -pub type ExprAwait = super::generic::ExprAwait; -pub type ExprYield = super::generic::ExprYield; -pub type ExprYieldFrom = super::generic::ExprYieldFrom; -pub type ExprCompare = super::generic::ExprCompare; -pub type ExprCall = super::generic::ExprCall; -pub type ExprFormattedValue = super::generic::ExprFormattedValue; -pub type ExprJoinedStr = super::generic::ExprJoinedStr; -pub type ExprConstant = super::generic::ExprConstant; -pub type ExprAttribute = super::generic::ExprAttribute; -pub type ExprSubscript = super::generic::ExprSubscript; -pub type ExprStarred = super::generic::ExprStarred; -pub type ExprName = super::generic::ExprName; -pub type ExprList = super::generic::ExprList; -pub type ExprTuple = super::generic::ExprTuple; -pub type ExprSlice = super::generic::ExprSlice; -pub type ExprContext = super::generic::ExprContext; -pub type Boolop = super::generic::Boolop; -pub type Operator = super::generic::Operator; -pub type Unaryop = super::generic::Unaryop; -pub type Cmpop = super::generic::Cmpop; -pub type Comprehension = super::generic::Comprehension; -pub type Excepthandler = super::generic::Excepthandler; -pub type ExcepthandlerKind = super::generic::ExcepthandlerKind; -pub type ExcepthandlerExceptHandler = super::generic::ExcepthandlerExceptHandler; -pub type Arguments = super::generic::Arguments; -pub type Arg = super::generic::Arg; -pub type ArgData = super::generic::ArgData; -pub type Keyword = super::generic::Keyword; -pub type KeywordData = super::generic::KeywordData; -pub type Alias = super::generic::Alias; -pub type AliasData = super::generic::AliasData; -pub type Withitem = super::generic::Withitem; -pub type MatchCase = super::generic::MatchCase; -pub type Pattern = super::generic::Pattern; -pub type PatternKind = super::generic::PatternKind; -pub type PatternMatchValue = super::generic::PatternMatchValue; -pub type PatternMatchSingleton = super::generic::PatternMatchSingleton; -pub type PatternMatchSequence = super::generic::PatternMatchSequence; -pub type PatternMatchMapping = super::generic::PatternMatchMapping; -pub type PatternMatchClass = super::generic::PatternMatchClass; -pub type PatternMatchStar = super::generic::PatternMatchStar; -pub type PatternMatchAs = super::generic::PatternMatchAs; -pub type PatternMatchOr = super::generic::PatternMatchOr; -pub type TypeIgnore = super::generic::TypeIgnore; -pub type TypeIgnoreTypeIgnore = super::generic::TypeIgnoreTypeIgnore; diff --git a/ast/src/locator.rs b/ast/src/locator.rs index 83a86b1..888161c 100644 --- a/ast/src/locator.rs +++ b/ast/src/locator.rs @@ -1,41 +1,14 @@ use crate::attributed::Attributed; use crate::fold_helpers::Foldable; -use rustpython_compiler_core::{ - text_size::{TextRange, TextSize}, - Location, LocationRange, -}; +use crate::location::SourceRange; +use rustpython_compiler_core::SourceLocator; -/// Converts source code byte-offset to Python convention line and column numbers. -#[derive(Default)] -pub struct Locator<'a> { - source: &'a str, +pub fn locate>(locator: &mut SourceLocator, ast: X) -> X::Mapped { + ast.fold(locator).unwrap() } -impl<'a> Locator<'a> { - #[inline] - pub fn new(source: &'a str) -> Self { - Self { source } - } - - pub fn source(&'a self) -> &'a str { - self.source - } - - pub fn locate(&mut self, offset: TextSize) -> Location { - todo!() - } - - pub fn locate_range(&mut self, range: TextRange) -> LocationRange { - self.locate(range.start())..self.locate(range.end()) - } - - pub fn locate_ast>(&mut self, ast: X) -> X::Mapped { - ast.fold(self).unwrap() - } -} - -impl crate::fold::Fold<()> for Locator<'_> { - type TargetU = LocationRange; +impl crate::fold::Fold<()> for SourceLocator<'_> { + type TargetU = SourceRange; type Error = std::convert::Infallible; #[cold] @@ -47,10 +20,11 @@ impl crate::fold::Fold<()> for Locator<'_> { &mut self, node: Attributed, ) -> Result, Self::Error> { - let location = self.locate_range(node.range); + let start = self.locate(node.range.start()); + let end = self.locate(node.range.end()); Ok(Attributed { range: node.range, - custom: location, + custom: (start..end).into(), node: node.node, }) } diff --git a/core/Cargo.toml b/core/Cargo.toml index 2614245..c8add56 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -14,6 +14,7 @@ num-bigint = { workspace = true } num-complex = { workspace = true } serde = { version = "1.0.133", optional = true, default-features = false, features = ["derive"] } ruff_text_size = { path = "../ruff_text_size" } +ruff_python_ast = { workspace = true } lz4_flex = "0.9.2" diff --git a/core/src/bytecode.rs b/core/src/bytecode.rs index a522d3f..842d499 100644 --- a/core/src/bytecode.rs +++ b/core/src/bytecode.rs @@ -1,7 +1,10 @@ //! Implement python as a virtual machine with bytecode. This module //! implements bytecode structure. -use crate::{marshal, Location}; +use crate::{ + marshal, + source_code::{OneIndexed, SourceLocation}, +}; use bitflags::bitflags; use itertools::Itertools; use num_bigint::BigInt; @@ -89,14 +92,14 @@ impl ConstantBag for BasicBag { #[derive(Clone)] pub struct CodeObject { pub instructions: Box<[CodeUnit]>, - pub locations: Box<[Location]>, + pub locations: Box<[SourceLocation]>, pub flags: CodeFlags, pub posonlyarg_count: u32, // Number of positional-only arguments pub arg_count: u32, pub kwonlyarg_count: u32, pub source_path: C::Name, - pub first_line_number: u32, + pub first_line_number: OneIndexed, pub max_stackdepth: u32, pub obj_name: C::Name, // Name of the object that created this code object @@ -974,14 +977,14 @@ impl CodeObject { let label_targets = self.label_targets(); let line_digits = (3).max(self.locations.last().unwrap().row.to_string().len()); let offset_digits = (4).max(self.instructions.len().to_string().len()); - let mut last_line = u32::MAX; + let mut last_line = OneIndexed::MAX; let mut arg_state = OpArgState::default(); for (offset, &instruction) in self.instructions.iter().enumerate() { let (instruction, arg) = arg_state.get(instruction); // optional line number let line = self.locations[offset].row; if line != last_line { - if last_line != u32::MAX { + if last_line != OneIndexed::MAX { writeln!(f)?; } last_line = line; diff --git a/core/src/error.rs b/core/src/error.rs index 2380926..7eafa48 100644 --- a/core/src/error.rs +++ b/core/src/error.rs @@ -1,4 +1,4 @@ -use crate::{text_size::TextSize, Location}; +use crate::{source_code::SourceLocation, text_size::TextSize}; use std::fmt::Display; #[derive(Debug, PartialEq, Eq)] @@ -62,18 +62,23 @@ impl BaseError { BaseError::from(self) } - pub fn into_located(self, locator: &str) -> LocatedError + pub fn into_located(self, locator: &mut super::SourceLocator) -> LocatedError where T: Into, { - todo!() + let location = locator.locate(self.offset); + LocatedError { + error: self.error.into(), + location: Some(location), + source_path: self.source_path, + } } } #[derive(Debug, PartialEq, Eq)] pub struct LocatedError { pub error: T, - pub location: Location, + pub location: Option, pub source_path: String, } @@ -99,6 +104,17 @@ impl LocatedError { { LocatedError::from(self) } + + pub fn python_location(&self) -> (usize, usize) { + if let Some(location) = self.location { + ( + location.row.to_one_indexed(), + location.column.to_one_indexed(), + ) + } else { + (0, 0) + } + } } impl Display for LocatedError @@ -106,11 +122,10 @@ where T: std::fmt::Display, { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - write!( - f, - "{} at row {} col {}", - &self.error, self.location.row, self.location.column, - ) + let (row, column) = self.location.map_or((0, 0), |l| { + (l.row.to_one_indexed(), l.column.to_one_indexed()) + }); + write!(f, "{} at row {} col {}", &self.error, row, column,) } } diff --git a/core/src/lib.rs b/core/src/lib.rs index 596da01..7cefaea 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -1,20 +1,41 @@ #![doc(html_logo_url = "https://raw.githubusercontent.com/RustPython/RustPython/main/logo.png")] #![doc(html_root_url = "https://docs.rs/rustpython-compiler-core/")] -mod bytecode; +// parser core mod error; -mod location; -pub mod marshal; mod mode; -pub use bytecode::*; -pub use error::{BaseError, LocatedError}; -pub use location::{Location, LocationRange}; +pub use error::BaseError; pub use mode::Mode; - pub use ruff_text_size as text_size; // re-export mandatory and frequently accessed dependency -// FIXME: temp code -pub fn to_location(offset: &text_size::TextSize, source: &str) -> Location { - todo!() +// compiler core +mod bytecode; +pub mod marshal; + +pub use bytecode::*; +pub use error::LocatedError; +pub use ruff_python_ast::source_code; +pub use ruff_python_ast::source_code::OneIndexed as LineNumber; + +use source_code::{LineIndex, SourceCode, SourceLocation}; +use text_size::TextSize; +/// Converts source code byte-offset to Python convention line and column numbers. +pub struct SourceLocator<'a> { + pub source: &'a str, + index: LineIndex, +} + +impl<'a> SourceLocator<'a> { + #[inline] + pub fn new(source: &'a str) -> Self { + let index = LineIndex::from_source_text(source); + Self { source, index } + } + + pub fn locate(&mut self, offset: TextSize) -> SourceLocation { + let code = SourceCode::new(self.source, &self.index); + let offset = unsafe { std::mem::transmute(offset) }; // temp code to fix text_size dependency + code.source_location(offset) + } } diff --git a/core/src/location.rs b/core/src/location.rs deleted file mode 100644 index 65f9c9c..0000000 --- a/core/src/location.rs +++ /dev/null @@ -1,127 +0,0 @@ -/// Source code location. -#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -pub struct Location { - pub(super) row: u32, - pub(super) column: u32, -} - -impl Default for Location { - fn default() -> Self { - Self { row: 1, column: 0 } - } -} - -impl Location { - pub fn fmt_with( - &self, - f: &mut impl std::fmt::Write, - e: &impl std::fmt::Display, - ) -> std::fmt::Result { - write!(f, "{} at line {} column {}", e, self.row(), self.column()) - } -} - -impl Location { - /// Creates a new Location object at the given row and column. - /// - /// # Example - /// ``` - /// use rustpython_compiler_core::Location; - /// let loc = Location::new(10, 10); - /// ``` - pub fn new(row: usize, column: usize) -> Self { - let row = row.try_into().expect("Location::row over u32"); - let column = column.try_into().expect("Location::column over u32"); - Location { row, column } - } - - /// Current row - pub fn row(&self) -> usize { - self.row as usize - } - - /// Current column - pub fn column(&self) -> usize { - self.column as usize - } - - pub fn reset(&mut self) { - self.row = 1; - self.column = 0; - } - - pub fn go_right(&mut self) { - self.column += 1; - } - - pub fn go_left(&mut self) { - self.column -= 1; - } - - pub fn newline(&mut self) { - self.row += 1; - self.column = 0; - } - - pub fn with_col_offset>(&self, offset: T) -> Self - where - >::Error: std::fmt::Debug, - { - let column = (self.column as isize - + offset - .try_into() - .expect("offset should be able to convert to isize")) as u32; - Self { - row: self.row, - column, - } - } - - pub fn with_row_offset>(&self, offset: T) -> Self - where - >::Error: std::fmt::Debug, - { - let row = (self.row as isize - + offset - .try_into() - .expect("offset should be able to convert to isize")) as u32; - Self { - row, - column: self.column, - } - } -} - -pub type LocationRange = std::ops::Range; - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_gt() { - assert!(Location::new(1, 2) > Location::new(1, 1)); - assert!(Location::new(2, 1) > Location::new(1, 1)); - assert!(Location::new(2, 1) > Location::new(1, 2)); - } - - #[test] - fn test_lt() { - assert!(Location::new(1, 1) < Location::new(1, 2)); - assert!(Location::new(1, 1) < Location::new(2, 1)); - assert!(Location::new(1, 2) < Location::new(2, 1)); - } - - #[test] - fn test_with_col_offset() { - assert_eq!(Location::new(1, 1).with_col_offset(1), Location::new(1, 2)); - assert_eq!(Location::new(1, 1).with_col_offset(-1), Location::new(1, 0)); - } - - #[test] - fn test_with_row_offset() { - assert_eq!(Location::new(1, 1).with_row_offset(1), Location::new(2, 1)); - assert_eq!(Location::new(1, 1).with_row_offset(-1), Location::new(0, 1)); - } -} diff --git a/core/src/marshal.rs b/core/src/marshal.rs index e9f962f..6e6f6aa 100644 --- a/core/src/marshal.rs +++ b/core/src/marshal.rs @@ -4,7 +4,10 @@ use std::convert::Infallible; use num_bigint::{BigInt, Sign}; use num_complex::Complex64; -use crate::{bytecode::*, Location}; +use crate::{ + bytecode::*, + source_code::{OneIndexed, SourceLocation}, +}; pub const FORMAT_VERSION: u32 = 4; @@ -16,6 +19,8 @@ pub enum MarshalError { InvalidBytecode, /// Invalid utf8 in string InvalidUtf8, + /// Invalid source location + InvalidLocation, /// Bad type marker BadType, } @@ -26,6 +31,7 @@ impl fmt::Display for MarshalError { Self::Eof => f.write_str("unexpected end of data"), Self::InvalidBytecode => f.write_str("invalid bytecode"), Self::InvalidUtf8 => f.write_str("invalid utf8"), + Self::InvalidLocation => f.write_str("invalid source location"), Self::BadType => f.write_str("bad type marker"), } } @@ -183,12 +189,12 @@ pub fn deserialize_code( let len = rdr.read_u32()?; let locations = (0..len) .map(|_| { - Ok(Location { - row: rdr.read_u32()?, - column: rdr.read_u32()?, + Ok(SourceLocation { + row: OneIndexed::new(rdr.read_u32()?).ok_or(MarshalError::InvalidLocation)?, + column: OneIndexed::new(rdr.read_u32()?).ok_or(MarshalError::InvalidLocation)?, }) }) - .collect::>>()?; + .collect::>>()?; let flags = CodeFlags::from_bits_truncate(rdr.read_u16()?); @@ -199,7 +205,8 @@ pub fn deserialize_code( let len = rdr.read_u32()?; let source_path = bag.make_name(rdr.read_str(len)?); - let first_line_number = rdr.read_u32()?; + let first_line_number = + OneIndexed::new(rdr.read_u32()?).ok_or(MarshalError::InvalidLocation)?; let max_stackdepth = rdr.read_u32()?; let len = rdr.read_u32()?; @@ -586,8 +593,8 @@ pub fn serialize_code(buf: &mut W, code: &CodeObject) write_len(buf, code.locations.len()); for loc in &*code.locations { - buf.write_u32(loc.row); - buf.write_u32(loc.column); + buf.write_u32(loc.row.get() as _); + buf.write_u32(loc.column.get() as _); } buf.write_u16(code.flags.bits()); @@ -598,7 +605,7 @@ pub fn serialize_code(buf: &mut W, code: &CodeObject) write_vec(buf, code.source_path.as_ref().as_bytes()); - buf.write_u32(code.first_line_number); + buf.write_u32(code.first_line_number.get()); buf.write_u32(code.max_stackdepth); write_vec(buf, code.obj_name.as_ref().as_bytes()); diff --git a/parser/src/function.rs b/parser/src/function.rs index 803ede1..d443dea 100644 --- a/parser/src/function.rs +++ b/parser/src/function.rs @@ -19,7 +19,7 @@ type ParameterDef = (ast::Arg, Option); pub(crate) fn validate_arguments( arguments: ast::Arguments, ) -> Result { - let mut all_args: Vec<&ast::Located> = vec![]; + let mut all_args: Vec<&ast::Attributed> = vec![]; all_args.extend(arguments.posonlyargs.iter()); all_args.extend(arguments.args.iter()); diff --git a/parser/src/snapshots/rustpython_parser__context__tests__ann_assign_name.snap b/parser/src/snapshots/rustpython_parser__context__tests__ann_assign_name.snap index b835058..b16b3ed 100644 --- a/parser/src/snapshots/rustpython_parser__context__tests__ann_assign_name.snap +++ b/parser/src/snapshots/rustpython_parser__context__tests__ann_assign_name.snap @@ -3,12 +3,12 @@ source: parser/src/context.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..10, custom: (), node: AnnAssign( StmtAnnAssign { - target: Located { + target: Attributed { range: 0..1, custom: (), node: Name( @@ -18,7 +18,7 @@ expression: parse_ast }, ), }, - annotation: Located { + annotation: Attributed { range: 3..6, custom: (), node: Name( @@ -29,7 +29,7 @@ expression: parse_ast ), }, value: Some( - Located { + Attributed { range: 9..10, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__context__tests__assign_attribute.snap b/parser/src/snapshots/rustpython_parser__context__tests__assign_attribute.snap index 63f9fbd..29a81c2 100644 --- a/parser/src/snapshots/rustpython_parser__context__tests__assign_attribute.snap +++ b/parser/src/snapshots/rustpython_parser__context__tests__assign_attribute.snap @@ -3,18 +3,18 @@ source: parser/src/context.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..15, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 0..3, custom: (), node: Attribute( ExprAttribute { - value: Located { + value: Attributed { range: 0..1, custom: (), node: Name( @@ -30,13 +30,13 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 6..15, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 7..8, custom: (), node: Constant( @@ -48,7 +48,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 10..11, custom: (), node: Constant( @@ -60,7 +60,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 13..14, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__context__tests__assign_for.snap b/parser/src/snapshots/rustpython_parser__context__tests__assign_for.snap index ca80fea..2503c80 100644 --- a/parser/src/snapshots/rustpython_parser__context__tests__assign_for.snap +++ b/parser/src/snapshots/rustpython_parser__context__tests__assign_for.snap @@ -3,12 +3,12 @@ source: parser/src/context.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..24, custom: (), node: For( StmtFor { - target: Located { + target: Attributed { range: 4..5, custom: (), node: Name( @@ -18,13 +18,13 @@ expression: parse_ast }, ), }, - iter: Located { + iter: Attributed { range: 9..18, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 10..11, custom: (), node: Constant( @@ -36,7 +36,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 13..14, custom: (), node: Constant( @@ -48,7 +48,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 16..17, custom: (), node: Constant( @@ -66,7 +66,7 @@ expression: parse_ast ), }, body: [ - Located { + Attributed { range: 20..24, custom: (), node: Pass, diff --git a/parser/src/snapshots/rustpython_parser__context__tests__assign_list.snap b/parser/src/snapshots/rustpython_parser__context__tests__assign_list.snap index bef4e47..e9ea713 100644 --- a/parser/src/snapshots/rustpython_parser__context__tests__assign_list.snap +++ b/parser/src/snapshots/rustpython_parser__context__tests__assign_list.snap @@ -3,19 +3,19 @@ source: parser/src/context.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..18, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 0..6, custom: (), node: List( ExprList { elts: [ - Located { + Attributed { range: 1..2, custom: (), node: Name( @@ -25,7 +25,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 4..5, custom: (), node: Name( @@ -41,13 +41,13 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 9..18, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 10..11, custom: (), node: Constant( @@ -59,7 +59,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 13..14, custom: (), node: Constant( @@ -71,7 +71,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 16..17, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__context__tests__assign_list_comp.snap b/parser/src/snapshots/rustpython_parser__context__tests__assign_list_comp.snap index a9da09d..126dbaf 100644 --- a/parser/src/snapshots/rustpython_parser__context__tests__assign_list_comp.snap +++ b/parser/src/snapshots/rustpython_parser__context__tests__assign_list_comp.snap @@ -3,13 +3,13 @@ source: parser/src/context.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..26, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 0..1, custom: (), node: Name( @@ -20,12 +20,12 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 4..26, custom: (), node: ListComp( ExprListComp { - elt: Located { + elt: Attributed { range: 5..6, custom: (), node: Name( @@ -37,7 +37,7 @@ expression: parse_ast }, generators: [ Comprehension { - target: Located { + target: Attributed { range: 11..12, custom: (), node: Name( @@ -47,13 +47,13 @@ expression: parse_ast }, ), }, - iter: Located { + iter: Attributed { range: 16..25, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 17..18, custom: (), node: Constant( @@ -65,7 +65,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 20..21, custom: (), node: Constant( @@ -77,7 +77,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 23..24, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__context__tests__assign_name.snap b/parser/src/snapshots/rustpython_parser__context__tests__assign_name.snap index 0df239b..1aa9eb7 100644 --- a/parser/src/snapshots/rustpython_parser__context__tests__assign_name.snap +++ b/parser/src/snapshots/rustpython_parser__context__tests__assign_name.snap @@ -3,13 +3,13 @@ source: parser/src/context.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..13, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 0..1, custom: (), node: Name( @@ -20,13 +20,13 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 4..13, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 5..6, custom: (), node: Constant( @@ -38,7 +38,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 8..9, custom: (), node: Constant( @@ -50,7 +50,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 11..12, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__context__tests__assign_named_expr.snap b/parser/src/snapshots/rustpython_parser__context__tests__assign_named_expr.snap index 8825d43..763a446 100644 --- a/parser/src/snapshots/rustpython_parser__context__tests__assign_named_expr.snap +++ b/parser/src/snapshots/rustpython_parser__context__tests__assign_named_expr.snap @@ -3,17 +3,17 @@ source: parser/src/context.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..14, custom: (), node: If( StmtIf { - test: Located { + test: Attributed { range: 3..8, custom: (), node: NamedExpr( ExprNamedExpr { - target: Located { + target: Attributed { range: 3..4, custom: (), node: Name( @@ -23,7 +23,7 @@ expression: parse_ast }, ), }, - value: Located { + value: Attributed { range: 7..8, custom: (), node: Constant( @@ -39,7 +39,7 @@ expression: parse_ast ), }, body: [ - Located { + Attributed { range: 10..14, custom: (), node: Pass, diff --git a/parser/src/snapshots/rustpython_parser__context__tests__assign_set_comp.snap b/parser/src/snapshots/rustpython_parser__context__tests__assign_set_comp.snap index d362192..3430ae0 100644 --- a/parser/src/snapshots/rustpython_parser__context__tests__assign_set_comp.snap +++ b/parser/src/snapshots/rustpython_parser__context__tests__assign_set_comp.snap @@ -3,13 +3,13 @@ source: parser/src/context.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..26, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 0..1, custom: (), node: Name( @@ -20,12 +20,12 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 4..26, custom: (), node: SetComp( ExprSetComp { - elt: Located { + elt: Attributed { range: 5..6, custom: (), node: Name( @@ -37,7 +37,7 @@ expression: parse_ast }, generators: [ Comprehension { - target: Located { + target: Attributed { range: 11..12, custom: (), node: Name( @@ -47,13 +47,13 @@ expression: parse_ast }, ), }, - iter: Located { + iter: Attributed { range: 16..25, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 17..18, custom: (), node: Constant( @@ -65,7 +65,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 20..21, custom: (), node: Constant( @@ -77,7 +77,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 23..24, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__context__tests__assign_starred.snap b/parser/src/snapshots/rustpython_parser__context__tests__assign_starred.snap index 470adc5..37e0720 100644 --- a/parser/src/snapshots/rustpython_parser__context__tests__assign_starred.snap +++ b/parser/src/snapshots/rustpython_parser__context__tests__assign_starred.snap @@ -3,19 +3,19 @@ source: parser/src/context.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..19, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 0..7, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 1..2, custom: (), node: Name( @@ -25,12 +25,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 4..6, custom: (), node: Starred( ExprStarred { - value: Located { + value: Attributed { range: 5..6, custom: (), node: Name( @@ -50,13 +50,13 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 10..19, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 11..12, custom: (), node: Constant( @@ -68,7 +68,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 14..15, custom: (), node: Constant( @@ -80,7 +80,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 17..18, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__context__tests__assign_subscript.snap b/parser/src/snapshots/rustpython_parser__context__tests__assign_subscript.snap index 77f6e07..305363c 100644 --- a/parser/src/snapshots/rustpython_parser__context__tests__assign_subscript.snap +++ b/parser/src/snapshots/rustpython_parser__context__tests__assign_subscript.snap @@ -3,18 +3,18 @@ source: parser/src/context.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..16, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 0..4, custom: (), node: Subscript( ExprSubscript { - value: Located { + value: Attributed { range: 0..1, custom: (), node: Name( @@ -24,7 +24,7 @@ expression: parse_ast }, ), }, - slice: Located { + slice: Attributed { range: 2..3, custom: (), node: Name( @@ -39,13 +39,13 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 7..16, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 8..9, custom: (), node: Constant( @@ -57,7 +57,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 11..12, custom: (), node: Constant( @@ -69,7 +69,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 14..15, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__context__tests__assign_tuple.snap b/parser/src/snapshots/rustpython_parser__context__tests__assign_tuple.snap index 2d5f82d..d3989b7 100644 --- a/parser/src/snapshots/rustpython_parser__context__tests__assign_tuple.snap +++ b/parser/src/snapshots/rustpython_parser__context__tests__assign_tuple.snap @@ -3,19 +3,19 @@ source: parser/src/context.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..18, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 0..6, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 1..2, custom: (), node: Name( @@ -25,7 +25,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 4..5, custom: (), node: Name( @@ -41,13 +41,13 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 9..18, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 10..11, custom: (), node: Constant( @@ -59,7 +59,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 13..14, custom: (), node: Constant( @@ -71,7 +71,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 16..17, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__context__tests__assign_with.snap b/parser/src/snapshots/rustpython_parser__context__tests__assign_with.snap index b4c7126..5d41c63 100644 --- a/parser/src/snapshots/rustpython_parser__context__tests__assign_with.snap +++ b/parser/src/snapshots/rustpython_parser__context__tests__assign_with.snap @@ -3,14 +3,14 @@ source: parser/src/context.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..17, custom: (), node: With( StmtWith { items: [ Withitem { - context_expr: Located { + context_expr: Attributed { range: 5..6, custom: (), node: Constant( @@ -23,7 +23,7 @@ expression: parse_ast ), }, optional_vars: Some( - Located { + Attributed { range: 10..11, custom: (), node: Name( @@ -37,7 +37,7 @@ expression: parse_ast }, ], body: [ - Located { + Attributed { range: 13..17, custom: (), node: Pass, diff --git a/parser/src/snapshots/rustpython_parser__context__tests__aug_assign_attribute.snap b/parser/src/snapshots/rustpython_parser__context__tests__aug_assign_attribute.snap index 461554e..c358427 100644 --- a/parser/src/snapshots/rustpython_parser__context__tests__aug_assign_attribute.snap +++ b/parser/src/snapshots/rustpython_parser__context__tests__aug_assign_attribute.snap @@ -3,17 +3,17 @@ source: parser/src/context.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..16, custom: (), node: AugAssign( StmtAugAssign { - target: Located { + target: Attributed { range: 0..3, custom: (), node: Attribute( ExprAttribute { - value: Located { + value: Attributed { range: 0..1, custom: (), node: Name( @@ -29,13 +29,13 @@ expression: parse_ast ), }, op: Add, - value: Located { + value: Attributed { range: 7..16, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 8..9, custom: (), node: Constant( @@ -47,7 +47,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 11..12, custom: (), node: Constant( @@ -59,7 +59,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 14..15, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__context__tests__aug_assign_name.snap b/parser/src/snapshots/rustpython_parser__context__tests__aug_assign_name.snap index 28835f7..c698608 100644 --- a/parser/src/snapshots/rustpython_parser__context__tests__aug_assign_name.snap +++ b/parser/src/snapshots/rustpython_parser__context__tests__aug_assign_name.snap @@ -3,12 +3,12 @@ source: parser/src/context.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..6, custom: (), node: AugAssign( StmtAugAssign { - target: Located { + target: Attributed { range: 0..1, custom: (), node: Name( @@ -19,7 +19,7 @@ expression: parse_ast ), }, op: Add, - value: Located { + value: Attributed { range: 5..6, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__context__tests__aug_assign_subscript.snap b/parser/src/snapshots/rustpython_parser__context__tests__aug_assign_subscript.snap index 39b2317..8f18562 100644 --- a/parser/src/snapshots/rustpython_parser__context__tests__aug_assign_subscript.snap +++ b/parser/src/snapshots/rustpython_parser__context__tests__aug_assign_subscript.snap @@ -3,17 +3,17 @@ source: parser/src/context.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..17, custom: (), node: AugAssign( StmtAugAssign { - target: Located { + target: Attributed { range: 0..4, custom: (), node: Subscript( ExprSubscript { - value: Located { + value: Attributed { range: 0..1, custom: (), node: Name( @@ -23,7 +23,7 @@ expression: parse_ast }, ), }, - slice: Located { + slice: Attributed { range: 2..3, custom: (), node: Name( @@ -38,13 +38,13 @@ expression: parse_ast ), }, op: Add, - value: Located { + value: Attributed { range: 8..17, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 9..10, custom: (), node: Constant( @@ -56,7 +56,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 12..13, custom: (), node: Constant( @@ -68,7 +68,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 15..16, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__context__tests__del_attribute.snap b/parser/src/snapshots/rustpython_parser__context__tests__del_attribute.snap index f97be3a..260304e 100644 --- a/parser/src/snapshots/rustpython_parser__context__tests__del_attribute.snap +++ b/parser/src/snapshots/rustpython_parser__context__tests__del_attribute.snap @@ -3,18 +3,18 @@ source: parser/src/context.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..7, custom: (), node: Delete( StmtDelete { targets: [ - Located { + Attributed { range: 4..7, custom: (), node: Attribute( ExprAttribute { - value: Located { + value: Attributed { range: 4..5, custom: (), node: Name( diff --git a/parser/src/snapshots/rustpython_parser__context__tests__del_name.snap b/parser/src/snapshots/rustpython_parser__context__tests__del_name.snap index 5e5998e..b471be6 100644 --- a/parser/src/snapshots/rustpython_parser__context__tests__del_name.snap +++ b/parser/src/snapshots/rustpython_parser__context__tests__del_name.snap @@ -3,13 +3,13 @@ source: parser/src/context.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..5, custom: (), node: Delete( StmtDelete { targets: [ - Located { + Attributed { range: 4..5, custom: (), node: Name( diff --git a/parser/src/snapshots/rustpython_parser__context__tests__del_subscript.snap b/parser/src/snapshots/rustpython_parser__context__tests__del_subscript.snap index c4cb6ce..a6c7bb1 100644 --- a/parser/src/snapshots/rustpython_parser__context__tests__del_subscript.snap +++ b/parser/src/snapshots/rustpython_parser__context__tests__del_subscript.snap @@ -3,18 +3,18 @@ source: parser/src/context.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..8, custom: (), node: Delete( StmtDelete { targets: [ - Located { + Attributed { range: 4..8, custom: (), node: Subscript( ExprSubscript { - value: Located { + value: Attributed { range: 4..5, custom: (), node: Name( @@ -24,7 +24,7 @@ expression: parse_ast }, ), }, - slice: Located { + slice: Attributed { range: 6..7, custom: (), node: Name( diff --git a/parser/src/snapshots/rustpython_parser__function__tests__function_kw_only_args.snap b/parser/src/snapshots/rustpython_parser__function__tests__function_kw_only_args.snap index 9dedeee..1fc7c2a 100644 --- a/parser/src/snapshots/rustpython_parser__function__tests__function_kw_only_args.snap +++ b/parser/src/snapshots/rustpython_parser__function__tests__function_kw_only_args.snap @@ -4,7 +4,7 @@ expression: parse_ast --- Ok( [ - Located { + Attributed { range: 0..23, custom: (), node: FunctionDef( @@ -15,7 +15,7 @@ Ok( args: [], vararg: None, kwonlyargs: [ - Located { + Attributed { range: 9..10, custom: (), node: ArgData { @@ -24,7 +24,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 12..13, custom: (), node: ArgData { @@ -33,7 +33,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 15..16, custom: (), node: ArgData { @@ -48,7 +48,7 @@ Ok( defaults: [], }, body: [ - Located { + Attributed { range: 19..23, custom: (), node: Pass, diff --git a/parser/src/snapshots/rustpython_parser__function__tests__function_kw_only_args_with_defaults.snap b/parser/src/snapshots/rustpython_parser__function__tests__function_kw_only_args_with_defaults.snap index d6616db..4913a30 100644 --- a/parser/src/snapshots/rustpython_parser__function__tests__function_kw_only_args_with_defaults.snap +++ b/parser/src/snapshots/rustpython_parser__function__tests__function_kw_only_args_with_defaults.snap @@ -4,7 +4,7 @@ expression: parse_ast --- Ok( [ - Located { + Attributed { range: 0..29, custom: (), node: FunctionDef( @@ -15,7 +15,7 @@ Ok( args: [], vararg: None, kwonlyargs: [ - Located { + Attributed { range: 9..10, custom: (), node: ArgData { @@ -24,7 +24,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 12..13, custom: (), node: ArgData { @@ -33,7 +33,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 18..19, custom: (), node: ArgData { @@ -44,7 +44,7 @@ Ok( }, ], kw_defaults: [ - Located { + Attributed { range: 14..16, custom: (), node: Constant( @@ -56,7 +56,7 @@ Ok( }, ), }, - Located { + Attributed { range: 20..22, custom: (), node: Constant( @@ -73,7 +73,7 @@ Ok( defaults: [], }, body: [ - Located { + Attributed { range: 25..29, custom: (), node: Pass, diff --git a/parser/src/snapshots/rustpython_parser__function__tests__function_no_args.snap b/parser/src/snapshots/rustpython_parser__function__tests__function_no_args.snap index a340a3b..99751da 100644 --- a/parser/src/snapshots/rustpython_parser__function__tests__function_no_args.snap +++ b/parser/src/snapshots/rustpython_parser__function__tests__function_no_args.snap @@ -4,7 +4,7 @@ expression: parse_ast --- Ok( [ - Located { + Attributed { range: 0..13, custom: (), node: FunctionDef( @@ -20,7 +20,7 @@ Ok( defaults: [], }, body: [ - Located { + Attributed { range: 9..13, custom: (), node: Pass, diff --git a/parser/src/snapshots/rustpython_parser__function__tests__function_pos_and_kw_only_args.snap b/parser/src/snapshots/rustpython_parser__function__tests__function_pos_and_kw_only_args.snap index 9dd1517..abb30d1 100644 --- a/parser/src/snapshots/rustpython_parser__function__tests__function_pos_and_kw_only_args.snap +++ b/parser/src/snapshots/rustpython_parser__function__tests__function_pos_and_kw_only_args.snap @@ -4,7 +4,7 @@ expression: parse_ast --- Ok( [ - Located { + Attributed { range: 0..32, custom: (), node: FunctionDef( @@ -13,7 +13,7 @@ Ok( args: Arguments { posonlyargs: [], args: [ - Located { + Attributed { range: 6..7, custom: (), node: ArgData { @@ -22,7 +22,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 9..10, custom: (), node: ArgData { @@ -31,7 +31,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 12..13, custom: (), node: ArgData { @@ -43,7 +43,7 @@ Ok( ], vararg: None, kwonlyargs: [ - Located { + Attributed { range: 18..19, custom: (), node: ArgData { @@ -52,7 +52,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 21..22, custom: (), node: ArgData { @@ -61,7 +61,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 24..25, custom: (), node: ArgData { @@ -76,7 +76,7 @@ Ok( defaults: [], }, body: [ - Located { + Attributed { range: 28..32, custom: (), node: Pass, diff --git a/parser/src/snapshots/rustpython_parser__function__tests__function_pos_and_kw_only_args_with_defaults.snap b/parser/src/snapshots/rustpython_parser__function__tests__function_pos_and_kw_only_args_with_defaults.snap index cd88580..fa0e448 100644 --- a/parser/src/snapshots/rustpython_parser__function__tests__function_pos_and_kw_only_args_with_defaults.snap +++ b/parser/src/snapshots/rustpython_parser__function__tests__function_pos_and_kw_only_args_with_defaults.snap @@ -4,7 +4,7 @@ expression: parse_ast --- Ok( [ - Located { + Attributed { range: 0..38, custom: (), node: FunctionDef( @@ -13,7 +13,7 @@ Ok( args: Arguments { posonlyargs: [], args: [ - Located { + Attributed { range: 6..7, custom: (), node: ArgData { @@ -22,7 +22,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 9..10, custom: (), node: ArgData { @@ -31,7 +31,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 12..13, custom: (), node: ArgData { @@ -43,7 +43,7 @@ Ok( ], vararg: None, kwonlyargs: [ - Located { + Attributed { range: 18..19, custom: (), node: ArgData { @@ -52,7 +52,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 21..22, custom: (), node: ArgData { @@ -61,7 +61,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 27..28, custom: (), node: ArgData { @@ -72,7 +72,7 @@ Ok( }, ], kw_defaults: [ - Located { + Attributed { range: 23..25, custom: (), node: Constant( @@ -84,7 +84,7 @@ Ok( }, ), }, - Located { + Attributed { range: 29..31, custom: (), node: Constant( @@ -101,7 +101,7 @@ Ok( defaults: [], }, body: [ - Located { + Attributed { range: 34..38, custom: (), node: Pass, diff --git a/parser/src/snapshots/rustpython_parser__function__tests__function_pos_and_kw_only_args_with_defaults_and_varargs.snap b/parser/src/snapshots/rustpython_parser__function__tests__function_pos_and_kw_only_args_with_defaults_and_varargs.snap index ee2fb9b..c56eb25 100644 --- a/parser/src/snapshots/rustpython_parser__function__tests__function_pos_and_kw_only_args_with_defaults_and_varargs.snap +++ b/parser/src/snapshots/rustpython_parser__function__tests__function_pos_and_kw_only_args_with_defaults_and_varargs.snap @@ -4,7 +4,7 @@ expression: parse_ast --- Ok( [ - Located { + Attributed { range: 0..42, custom: (), node: FunctionDef( @@ -13,7 +13,7 @@ Ok( args: Arguments { posonlyargs: [], args: [ - Located { + Attributed { range: 6..7, custom: (), node: ArgData { @@ -22,7 +22,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 9..10, custom: (), node: ArgData { @@ -31,7 +31,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 12..13, custom: (), node: ArgData { @@ -42,7 +42,7 @@ Ok( }, ], vararg: Some( - Located { + Attributed { range: 16..20, custom: (), node: ArgData { @@ -53,7 +53,7 @@ Ok( }, ), kwonlyargs: [ - Located { + Attributed { range: 22..23, custom: (), node: ArgData { @@ -62,7 +62,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 25..26, custom: (), node: ArgData { @@ -71,7 +71,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 31..32, custom: (), node: ArgData { @@ -82,7 +82,7 @@ Ok( }, ], kw_defaults: [ - Located { + Attributed { range: 27..29, custom: (), node: Constant( @@ -94,7 +94,7 @@ Ok( }, ), }, - Located { + Attributed { range: 33..35, custom: (), node: Constant( @@ -111,7 +111,7 @@ Ok( defaults: [], }, body: [ - Located { + Attributed { range: 38..42, custom: (), node: Pass, diff --git a/parser/src/snapshots/rustpython_parser__function__tests__function_pos_and_kw_only_args_with_defaults_and_varargs_and_kwargs.snap b/parser/src/snapshots/rustpython_parser__function__tests__function_pos_and_kw_only_args_with_defaults_and_varargs_and_kwargs.snap index 447195f..0c3716b 100644 --- a/parser/src/snapshots/rustpython_parser__function__tests__function_pos_and_kw_only_args_with_defaults_and_varargs_and_kwargs.snap +++ b/parser/src/snapshots/rustpython_parser__function__tests__function_pos_and_kw_only_args_with_defaults_and_varargs_and_kwargs.snap @@ -4,7 +4,7 @@ expression: parse_ast --- Ok( [ - Located { + Attributed { range: 0..52, custom: (), node: FunctionDef( @@ -13,7 +13,7 @@ Ok( args: Arguments { posonlyargs: [], args: [ - Located { + Attributed { range: 6..7, custom: (), node: ArgData { @@ -22,7 +22,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 9..10, custom: (), node: ArgData { @@ -31,7 +31,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 12..13, custom: (), node: ArgData { @@ -42,7 +42,7 @@ Ok( }, ], vararg: Some( - Located { + Attributed { range: 16..20, custom: (), node: ArgData { @@ -53,7 +53,7 @@ Ok( }, ), kwonlyargs: [ - Located { + Attributed { range: 22..23, custom: (), node: ArgData { @@ -62,7 +62,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 25..26, custom: (), node: ArgData { @@ -71,7 +71,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 31..32, custom: (), node: ArgData { @@ -82,7 +82,7 @@ Ok( }, ], kw_defaults: [ - Located { + Attributed { range: 27..29, custom: (), node: Constant( @@ -94,7 +94,7 @@ Ok( }, ), }, - Located { + Attributed { range: 33..35, custom: (), node: Constant( @@ -108,7 +108,7 @@ Ok( }, ], kwarg: Some( - Located { + Attributed { range: 39..45, custom: (), node: ArgData { @@ -121,7 +121,7 @@ Ok( defaults: [], }, body: [ - Located { + Attributed { range: 48..52, custom: (), node: Pass, diff --git a/parser/src/snapshots/rustpython_parser__function__tests__function_pos_args.snap b/parser/src/snapshots/rustpython_parser__function__tests__function_pos_args.snap index b72c0da..391eddf 100644 --- a/parser/src/snapshots/rustpython_parser__function__tests__function_pos_args.snap +++ b/parser/src/snapshots/rustpython_parser__function__tests__function_pos_args.snap @@ -4,7 +4,7 @@ expression: parse_ast --- Ok( [ - Located { + Attributed { range: 0..20, custom: (), node: FunctionDef( @@ -13,7 +13,7 @@ Ok( args: Arguments { posonlyargs: [], args: [ - Located { + Attributed { range: 6..7, custom: (), node: ArgData { @@ -22,7 +22,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 9..10, custom: (), node: ArgData { @@ -31,7 +31,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 12..13, custom: (), node: ArgData { @@ -48,7 +48,7 @@ Ok( defaults: [], }, body: [ - Located { + Attributed { range: 16..20, custom: (), node: Pass, diff --git a/parser/src/snapshots/rustpython_parser__function__tests__function_pos_args_with_defaults.snap b/parser/src/snapshots/rustpython_parser__function__tests__function_pos_args_with_defaults.snap index 84d0d98..8df4a31 100644 --- a/parser/src/snapshots/rustpython_parser__function__tests__function_pos_args_with_defaults.snap +++ b/parser/src/snapshots/rustpython_parser__function__tests__function_pos_args_with_defaults.snap @@ -4,7 +4,7 @@ expression: parse_ast --- Ok( [ - Located { + Attributed { range: 0..26, custom: (), node: FunctionDef( @@ -13,7 +13,7 @@ Ok( args: Arguments { posonlyargs: [], args: [ - Located { + Attributed { range: 6..7, custom: (), node: ArgData { @@ -22,7 +22,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 9..10, custom: (), node: ArgData { @@ -31,7 +31,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 15..16, custom: (), node: ArgData { @@ -46,7 +46,7 @@ Ok( kw_defaults: [], kwarg: None, defaults: [ - Located { + Attributed { range: 11..13, custom: (), node: Constant( @@ -58,7 +58,7 @@ Ok( }, ), }, - Located { + Attributed { range: 17..19, custom: (), node: Constant( @@ -73,7 +73,7 @@ Ok( ], }, body: [ - Located { + Attributed { range: 22..26, custom: (), node: Pass, diff --git a/parser/src/snapshots/rustpython_parser__function__tests__lambda_kw_only_args.snap b/parser/src/snapshots/rustpython_parser__function__tests__lambda_kw_only_args.snap index be95fae..5b9a063 100644 --- a/parser/src/snapshots/rustpython_parser__function__tests__lambda_kw_only_args.snap +++ b/parser/src/snapshots/rustpython_parser__function__tests__lambda_kw_only_args.snap @@ -4,12 +4,12 @@ expression: parse_ast --- Ok( [ - Located { + Attributed { range: 0..20, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..20, custom: (), node: Lambda( @@ -19,7 +19,7 @@ Ok( args: [], vararg: None, kwonlyargs: [ - Located { + Attributed { range: 10..11, custom: (), node: ArgData { @@ -28,7 +28,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 13..14, custom: (), node: ArgData { @@ -37,7 +37,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 16..17, custom: (), node: ArgData { @@ -51,7 +51,7 @@ Ok( kwarg: None, defaults: [], }, - body: Located { + body: Attributed { range: 19..20, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__function__tests__lambda_kw_only_args_with_defaults.snap b/parser/src/snapshots/rustpython_parser__function__tests__lambda_kw_only_args_with_defaults.snap index b992c29..d326c8b 100644 --- a/parser/src/snapshots/rustpython_parser__function__tests__lambda_kw_only_args_with_defaults.snap +++ b/parser/src/snapshots/rustpython_parser__function__tests__lambda_kw_only_args_with_defaults.snap @@ -4,12 +4,12 @@ expression: parse_ast --- Ok( [ - Located { + Attributed { range: 0..26, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..26, custom: (), node: Lambda( @@ -19,7 +19,7 @@ Ok( args: [], vararg: None, kwonlyargs: [ - Located { + Attributed { range: 10..11, custom: (), node: ArgData { @@ -28,7 +28,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 13..14, custom: (), node: ArgData { @@ -37,7 +37,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 19..20, custom: (), node: ArgData { @@ -48,7 +48,7 @@ Ok( }, ], kw_defaults: [ - Located { + Attributed { range: 15..17, custom: (), node: Constant( @@ -60,7 +60,7 @@ Ok( }, ), }, - Located { + Attributed { range: 21..23, custom: (), node: Constant( @@ -76,7 +76,7 @@ Ok( kwarg: None, defaults: [], }, - body: Located { + body: Attributed { range: 25..26, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__function__tests__lambda_no_args.snap b/parser/src/snapshots/rustpython_parser__function__tests__lambda_no_args.snap index c957331..3a92e72 100644 --- a/parser/src/snapshots/rustpython_parser__function__tests__lambda_no_args.snap +++ b/parser/src/snapshots/rustpython_parser__function__tests__lambda_no_args.snap @@ -4,12 +4,12 @@ expression: parse_ast --- Ok( [ - Located { + Attributed { range: 0..9, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..9, custom: (), node: Lambda( @@ -23,7 +23,7 @@ Ok( kwarg: None, defaults: [], }, - body: Located { + body: Attributed { range: 8..9, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__function__tests__lambda_pos_and_kw_only_args.snap b/parser/src/snapshots/rustpython_parser__function__tests__lambda_pos_and_kw_only_args.snap index 876aa6c..47b8bd2 100644 --- a/parser/src/snapshots/rustpython_parser__function__tests__lambda_pos_and_kw_only_args.snap +++ b/parser/src/snapshots/rustpython_parser__function__tests__lambda_pos_and_kw_only_args.snap @@ -4,12 +4,12 @@ expression: parse_ast --- Ok( [ - Located { + Attributed { range: 0..26, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..26, custom: (), node: Lambda( @@ -17,7 +17,7 @@ Ok( args: Arguments { posonlyargs: [], args: [ - Located { + Attributed { range: 7..8, custom: (), node: ArgData { @@ -26,7 +26,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 10..11, custom: (), node: ArgData { @@ -35,7 +35,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 13..14, custom: (), node: ArgData { @@ -47,7 +47,7 @@ Ok( ], vararg: None, kwonlyargs: [ - Located { + Attributed { range: 19..20, custom: (), node: ArgData { @@ -56,7 +56,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 22..23, custom: (), node: ArgData { @@ -70,7 +70,7 @@ Ok( kwarg: None, defaults: [], }, - body: Located { + body: Attributed { range: 25..26, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__function__tests__lambda_pos_args.snap b/parser/src/snapshots/rustpython_parser__function__tests__lambda_pos_args.snap index 43133dc..6e786c6 100644 --- a/parser/src/snapshots/rustpython_parser__function__tests__lambda_pos_args.snap +++ b/parser/src/snapshots/rustpython_parser__function__tests__lambda_pos_args.snap @@ -4,12 +4,12 @@ expression: parse_ast --- Ok( [ - Located { + Attributed { range: 0..17, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..17, custom: (), node: Lambda( @@ -17,7 +17,7 @@ Ok( args: Arguments { posonlyargs: [], args: [ - Located { + Attributed { range: 7..8, custom: (), node: ArgData { @@ -26,7 +26,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 10..11, custom: (), node: ArgData { @@ -35,7 +35,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 13..14, custom: (), node: ArgData { @@ -51,7 +51,7 @@ Ok( kwarg: None, defaults: [], }, - body: Located { + body: Attributed { range: 16..17, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__function__tests__lambda_pos_args_with_defaults.snap b/parser/src/snapshots/rustpython_parser__function__tests__lambda_pos_args_with_defaults.snap index ee752af..9235b93 100644 --- a/parser/src/snapshots/rustpython_parser__function__tests__lambda_pos_args_with_defaults.snap +++ b/parser/src/snapshots/rustpython_parser__function__tests__lambda_pos_args_with_defaults.snap @@ -4,12 +4,12 @@ expression: parse_ast --- Ok( [ - Located { + Attributed { range: 0..23, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..23, custom: (), node: Lambda( @@ -17,7 +17,7 @@ Ok( args: Arguments { posonlyargs: [], args: [ - Located { + Attributed { range: 7..8, custom: (), node: ArgData { @@ -26,7 +26,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 10..11, custom: (), node: ArgData { @@ -35,7 +35,7 @@ Ok( type_comment: None, }, }, - Located { + Attributed { range: 16..17, custom: (), node: ArgData { @@ -50,7 +50,7 @@ Ok( kw_defaults: [], kwarg: None, defaults: [ - Located { + Attributed { range: 12..14, custom: (), node: Constant( @@ -62,7 +62,7 @@ Ok( }, ), }, - Located { + Attributed { range: 18..20, custom: (), node: Constant( @@ -76,7 +76,7 @@ Ok( }, ], }, - body: Located { + body: Attributed { range: 22..23, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__dict_unpacking.snap b/parser/src/snapshots/rustpython_parser__parser__tests__dict_unpacking.snap index c2fda08..ba820b1 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__dict_unpacking.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__dict_unpacking.snap @@ -2,14 +2,14 @@ source: parser/src/parser.rs expression: parse_ast --- -Located { +Attributed { range: 0..25, custom: (), node: Dict( ExprDict { keys: [ Some( - Located { + Attributed { range: 1..4, custom: (), node: Constant( @@ -24,7 +24,7 @@ Located { ), None, Some( - Located { + Attributed { range: 16..19, custom: (), node: Constant( @@ -39,7 +39,7 @@ Located { ), ], values: [ - Located { + Attributed { range: 6..9, custom: (), node: Constant( @@ -51,7 +51,7 @@ Located { }, ), }, - Located { + Attributed { range: 13..14, custom: (), node: Name( @@ -61,7 +61,7 @@ Located { }, ), }, - Located { + Attributed { range: 21..24, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__generator_expression_argument.snap b/parser/src/snapshots/rustpython_parser__parser__tests__generator_expression_argument.snap index e06e3e2..e3b2181 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__generator_expression_argument.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__generator_expression_argument.snap @@ -2,17 +2,17 @@ source: parser/src/parser.rs expression: parse_ast --- -Located { +Attributed { range: 0..141, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 0..8, custom: (), node: Attribute( ExprAttribute { - value: Located { + value: Attributed { range: 0..3, custom: (), node: Constant( @@ -30,12 +30,12 @@ Located { ), }, args: [ - Located { + Attributed { range: 14..139, custom: (), node: GeneratorExp( ExprGeneratorExp { - elt: Located { + elt: Attributed { range: 14..17, custom: (), node: Name( @@ -47,7 +47,7 @@ Located { }, generators: [ Comprehension { - target: Located { + target: Attributed { range: 26..29, custom: (), node: Name( @@ -57,18 +57,18 @@ Located { }, ), }, - iter: Located { + iter: Attributed { range: 33..139, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 43..80, custom: (), node: IfExp( ExprIfExp { - test: Located { + test: Attributed { range: 65..70, custom: (), node: Name( @@ -78,12 +78,12 @@ Located { }, ), }, - body: Located { + body: Attributed { range: 43..61, custom: (), node: BinOp( ExprBinOp { - left: Located { + left: Attributed { range: 43..53, custom: (), node: Constant( @@ -96,7 +96,7 @@ Located { ), }, op: Mod, - right: Located { + right: Attributed { range: 56..61, custom: (), node: Name( @@ -109,7 +109,7 @@ Located { }, ), }, - orelse: Located { + orelse: Attributed { range: 76..80, custom: (), node: Constant( @@ -122,12 +122,12 @@ Located { }, ), }, - Located { + Attributed { range: 90..132, custom: (), node: IfExp( ExprIfExp { - test: Located { + test: Attributed { range: 116..122, custom: (), node: Name( @@ -137,12 +137,12 @@ Located { }, ), }, - body: Located { + body: Attributed { range: 91..111, custom: (), node: BinOp( ExprBinOp { - left: Located { + left: Attributed { range: 91..102, custom: (), node: Constant( @@ -155,7 +155,7 @@ Located { ), }, op: Mod, - right: Located { + right: Attributed { range: 105..111, custom: (), node: Name( @@ -168,7 +168,7 @@ Located { }, ), }, - orelse: Located { + orelse: Attributed { range: 128..132, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__match.snap b/parser/src/snapshots/rustpython_parser__parser__tests__match.snap index b9292bb..cd90075 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__match.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__match.snap @@ -3,19 +3,19 @@ source: parser/src/parser.rs expression: parse_ast --- [ - Located { + Attributed { range: 1..73, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 7..18, custom: (), node: Dict( ExprDict { keys: [ Some( - Located { + Attributed { range: 8..14, custom: (), node: Constant( @@ -30,7 +30,7 @@ expression: parse_ast ), ], values: [ - Located { + Attributed { range: 16..17, custom: (), node: Constant( @@ -48,7 +48,7 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 29..52, custom: (), node: MatchMapping( @@ -63,17 +63,17 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 62..73, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 62..73, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 62..67, custom: (), node: Name( @@ -84,7 +84,7 @@ expression: parse_ast ), }, args: [ - Located { + Attributed { range: 68..72, custom: (), node: Name( @@ -108,19 +108,19 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 74..177, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 80..97, custom: (), node: Dict( ExprDict { keys: [ Some( - Located { + Attributed { range: 81..88, custom: (), node: Constant( @@ -135,7 +135,7 @@ expression: parse_ast ), ], values: [ - Located { + Attributed { range: 90..96, custom: (), node: Constant( @@ -153,13 +153,13 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 108..155, custom: (), node: MatchMapping( PatternMatchMapping { keys: [ - Located { + Attributed { range: 118..125, custom: (), node: Constant( @@ -173,24 +173,24 @@ expression: parse_ast }, ], patterns: [ - Located { + Attributed { range: 127..148, custom: (), node: MatchAs( PatternMatchAs { pattern: Some( - Located { + Attributed { range: 127..139, custom: (), node: MatchOr( PatternMatchOr { patterns: [ - Located { + Attributed { range: 127..132, custom: (), node: MatchClass( PatternMatchClass { - cls: Located { + cls: Attributed { range: 127..130, custom: (), node: Name( @@ -206,7 +206,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 135..139, custom: (), node: MatchSingleton( @@ -233,17 +233,17 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 165..177, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 165..177, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 165..170, custom: (), node: Name( @@ -254,7 +254,7 @@ expression: parse_ast ), }, args: [ - Located { + Attributed { range: 171..176, custom: (), node: Name( @@ -278,12 +278,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 178..218, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 184..185, custom: (), node: Name( @@ -295,18 +295,18 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 196..203, custom: (), node: MatchSequence( PatternMatchSequence { patterns: [ - Located { + Attributed { range: 197..198, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 197..198, custom: (), node: Constant( @@ -321,12 +321,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 200..201, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 200..201, custom: (), node: Constant( @@ -347,13 +347,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 213..218, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 213..214, custom: (), node: Name( @@ -364,7 +364,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 217..218, custom: (), node: Constant( @@ -386,12 +386,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 219..259, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 225..226, custom: (), node: Name( @@ -403,18 +403,18 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 237..244, custom: (), node: MatchSequence( PatternMatchSequence { patterns: [ - Located { + Attributed { range: 238..239, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 238..239, custom: (), node: Constant( @@ -429,12 +429,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 241..242, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 241..242, custom: (), node: Constant( @@ -455,13 +455,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 254..259, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 254..255, custom: (), node: Name( @@ -472,7 +472,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 258..259, custom: (), node: Constant( @@ -494,12 +494,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 260..297, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 266..267, custom: (), node: Name( @@ -511,18 +511,18 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 278..282, custom: (), node: MatchSequence( PatternMatchSequence { patterns: [ - Located { + Attributed { range: 279..280, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 279..280, custom: (), node: Constant( @@ -543,13 +543,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 292..297, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 292..293, custom: (), node: Name( @@ -560,7 +560,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 296..297, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__match_as_identifier.snap b/parser/src/snapshots/rustpython_parser__parser__tests__match_as_identifier.snap index fff0e58..568ebb4 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__match_as_identifier.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__match_as_identifier.snap @@ -3,28 +3,28 @@ source: parser/src/parser.rs expression: parse_ast --- [ - Located { + Attributed { range: 1..16, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 1..16, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 1..13, custom: (), node: BinOp( ExprBinOp { - left: Located { + left: Attributed { range: 1..9, custom: (), node: BinOp( ExprBinOp { - left: Located { + left: Attributed { range: 1..6, custom: (), node: Name( @@ -35,7 +35,7 @@ expression: parse_ast ), }, op: Mult, - right: Located { + right: Attributed { range: 8..9, custom: (), node: Name( @@ -49,7 +49,7 @@ expression: parse_ast ), }, op: Add, - right: Located { + right: Attributed { range: 12..13, custom: (), node: Name( @@ -62,7 +62,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 15..16, custom: (), node: Name( @@ -80,23 +80,23 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 42..59, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 42..59, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 42..56, custom: (), node: BinOp( ExprBinOp { - left: Located { + left: Attributed { range: 42..47, custom: (), node: Name( @@ -107,12 +107,12 @@ expression: parse_ast ), }, op: Mult, - right: Located { + right: Attributed { range: 50..55, custom: (), node: BinOp( ExprBinOp { - left: Located { + left: Attributed { range: 50..51, custom: (), node: Name( @@ -123,7 +123,7 @@ expression: parse_ast ), }, op: Add, - right: Located { + right: Attributed { range: 54..55, custom: (), node: Name( @@ -139,7 +139,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 58..59, custom: (), node: Name( @@ -157,17 +157,17 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 85..102, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 85..102, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 85..90, custom: (), node: Name( @@ -178,17 +178,17 @@ expression: parse_ast ), }, args: [ - Located { + Attributed { range: 92..98, custom: (), node: Starred( ExprStarred { - value: Located { + value: Attributed { range: 93..98, custom: (), node: BinOp( ExprBinOp { - left: Located { + left: Attributed { range: 93..94, custom: (), node: Name( @@ -199,7 +199,7 @@ expression: parse_ast ), }, op: Add, - right: Located { + right: Attributed { range: 97..98, custom: (), node: Name( @@ -216,7 +216,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 100..101, custom: (), node: Name( @@ -234,22 +234,22 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 129..145, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 129..145, custom: (), node: BinOp( ExprBinOp { - left: Located { + left: Attributed { range: 129..141, custom: (), node: BinOp( ExprBinOp { - left: Located { + left: Attributed { range: 129..134, custom: (), node: Name( @@ -260,12 +260,12 @@ expression: parse_ast ), }, op: Sub, - right: Located { + right: Attributed { range: 136..141, custom: (), node: BinOp( ExprBinOp { - left: Located { + left: Attributed { range: 136..137, custom: (), node: Name( @@ -276,7 +276,7 @@ expression: parse_ast ), }, op: Mult, - right: Located { + right: Attributed { range: 140..141, custom: (), node: Name( @@ -293,7 +293,7 @@ expression: parse_ast ), }, op: Add, - right: Located { + right: Attributed { range: 144..145, custom: (), node: Name( @@ -309,22 +309,22 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 172..190, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 172..190, custom: (), node: BinOp( ExprBinOp { - left: Located { + left: Attributed { range: 172..186, custom: (), node: BinOp( ExprBinOp { - left: Located { + left: Attributed { range: 172..177, custom: (), node: Name( @@ -335,12 +335,12 @@ expression: parse_ast ), }, op: Sub, - right: Located { + right: Attributed { range: 180..185, custom: (), node: BinOp( ExprBinOp { - left: Located { + left: Attributed { range: 180..181, custom: (), node: Name( @@ -351,7 +351,7 @@ expression: parse_ast ), }, op: Mult, - right: Located { + right: Attributed { range: 184..185, custom: (), node: Name( @@ -368,7 +368,7 @@ expression: parse_ast ), }, op: Add, - right: Located { + right: Attributed { range: 189..190, custom: (), node: Name( @@ -384,27 +384,27 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 217..235, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 217..235, custom: (), node: BinOp( ExprBinOp { - left: Located { + left: Attributed { range: 217..231, custom: (), node: BinOp( ExprBinOp { - left: Located { + left: Attributed { range: 217..227, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 217..222, custom: (), node: Name( @@ -415,13 +415,13 @@ expression: parse_ast ), }, args: [ - Located { + Attributed { range: 224..226, custom: (), node: UnaryOp( ExprUnaryOp { op: USub, - operand: Located { + operand: Attributed { range: 225..226, custom: (), node: Name( @@ -440,7 +440,7 @@ expression: parse_ast ), }, op: Mult, - right: Located { + right: Attributed { range: 230..231, custom: (), node: Name( @@ -454,7 +454,7 @@ expression: parse_ast ), }, op: Add, - right: Located { + right: Attributed { range: 234..235, custom: (), node: Name( @@ -470,22 +470,22 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 263..273, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 263..273, custom: (), node: Attribute( ExprAttribute { - value: Located { + value: Attributed { range: 263..271, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 263..268, custom: (), node: Name( @@ -508,22 +508,22 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 290..302, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 290..302, custom: (), node: Attribute( ExprAttribute { - value: Located { + value: Attributed { range: 290..300, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 290..295, custom: (), node: Name( @@ -534,7 +534,7 @@ expression: parse_ast ), }, args: [ - Located { + Attributed { range: 297..299, custom: (), node: Tuple( @@ -557,22 +557,22 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 321..334, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 321..334, custom: (), node: Attribute( ExprAttribute { - value: Located { + value: Attributed { range: 321..332, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 321..326, custom: (), node: Name( @@ -583,7 +583,7 @@ expression: parse_ast ), }, args: [ - Located { + Attributed { range: 328..330, custom: (), node: Tuple( @@ -606,22 +606,22 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 353..364, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 353..364, custom: (), node: Attribute( ExprAttribute { - value: Located { + value: Attributed { range: 353..362, custom: (), node: Subscript( ExprSubscript { - value: Located { + value: Attributed { range: 353..358, custom: (), node: Name( @@ -631,7 +631,7 @@ expression: parse_ast }, ), }, - slice: Located { + slice: Attributed { range: 360..361, custom: (), node: Name( @@ -653,22 +653,22 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 382..394, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 382..394, custom: (), node: Attribute( ExprAttribute { - value: Located { + value: Attributed { range: 382..392, custom: (), node: Subscript( ExprSubscript { - value: Located { + value: Attributed { range: 382..387, custom: (), node: Name( @@ -678,13 +678,13 @@ expression: parse_ast }, ), }, - slice: Located { + slice: Attributed { range: 389..391, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 389..390, custom: (), node: Name( @@ -711,22 +711,22 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 435..449, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 435..449, custom: (), node: Attribute( ExprAttribute { - value: Located { + value: Attributed { range: 435..447, custom: (), node: Subscript( ExprSubscript { - value: Located { + value: Attributed { range: 435..440, custom: (), node: Name( @@ -736,13 +736,13 @@ expression: parse_ast }, ), }, - slice: Located { + slice: Attributed { range: 442..446, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 443..444, custom: (), node: Name( @@ -769,22 +769,22 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 470..487, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 470..487, custom: (), node: Subscript( ExprSubscript { - value: Located { + value: Attributed { range: 470..477, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 470..475, custom: (), node: Name( @@ -799,13 +799,13 @@ expression: parse_ast }, ), }, - slice: Located { + slice: Attributed { range: 478..486, custom: (), node: Slice( ExprSlice { lower: Some( - Located { + Attributed { range: 478..479, custom: (), node: Name( @@ -817,7 +817,7 @@ expression: parse_ast }, ), upper: Some( - Located { + Attributed { range: 485..486, custom: (), node: Name( @@ -839,17 +839,17 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 507..526, custom: (), node: If( StmtIf { - test: Located { + test: Attributed { range: 510..520, custom: (), node: NamedExpr( ExprNamedExpr { - target: Located { + target: Attributed { range: 510..515, custom: (), node: Name( @@ -859,7 +859,7 @@ expression: parse_ast }, ), }, - value: Located { + value: Attributed { range: 519..520, custom: (), node: Constant( @@ -875,7 +875,7 @@ expression: parse_ast ), }, body: [ - Located { + Attributed { range: 522..526, custom: (), node: Pass, @@ -885,12 +885,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 527..581, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 533..538, custom: (), node: Name( @@ -902,12 +902,12 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 549..550, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 549..550, custom: (), node: Constant( @@ -924,7 +924,7 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 552..556, custom: (), node: Pass, @@ -932,12 +932,12 @@ expression: parse_ast ], }, MatchCase { - pattern: Located { + pattern: Attributed { range: 566..567, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 566..567, custom: (), node: Constant( @@ -954,7 +954,7 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 577..581, custom: (), node: Pass, @@ -965,13 +965,13 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 582..618, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 582..587, custom: (), node: Name( @@ -982,7 +982,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 590..618, custom: (), node: Lambda( @@ -990,7 +990,7 @@ expression: parse_ast args: Arguments { posonlyargs: [], args: [ - Located { + Attributed { range: 597..602, custom: (), node: ArgData { @@ -1006,12 +1006,12 @@ expression: parse_ast kwarg: None, defaults: [], }, - body: Located { + body: Attributed { range: 604..618, custom: (), node: Compare( ExprCompare { - left: Located { + left: Attributed { range: 604..609, custom: (), node: Name( @@ -1025,7 +1025,7 @@ expression: parse_ast Eq, ], comparators: [ - Located { + Attributed { range: 613..618, custom: (), node: Name( @@ -1046,17 +1046,17 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 619..635, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 619..635, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 619..624, custom: (), node: Name( @@ -1067,12 +1067,12 @@ expression: parse_ast ), }, args: [ - Located { + Attributed { range: 625..634, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 625..630, custom: (), node: Name( @@ -1083,7 +1083,7 @@ expression: parse_ast ), }, args: [ - Located { + Attributed { range: 631..633, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__parse_bool_op_and.snap b/parser/src/snapshots/rustpython_parser__parser__tests__parse_bool_op_and.snap index 490379b..84cb86c 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__parse_bool_op_and.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__parse_bool_op_and.snap @@ -2,14 +2,14 @@ source: parser/src/parser.rs expression: parse_ast --- -Located { +Attributed { range: 0..7, custom: (), node: BoolOp( ExprBoolOp { op: And, values: [ - Located { + Attributed { range: 0..1, custom: (), node: Name( @@ -19,7 +19,7 @@ Located { }, ), }, - Located { + Attributed { range: 6..7, custom: (), node: Name( diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__parse_bool_op_or.snap b/parser/src/snapshots/rustpython_parser__parser__tests__parse_bool_op_or.snap index 5f9754f..39fb24f 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__parse_bool_op_or.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__parse_bool_op_or.snap @@ -2,14 +2,14 @@ source: parser/src/parser.rs expression: parse_ast --- -Located { +Attributed { range: 0..6, custom: (), node: BoolOp( ExprBoolOp { op: Or, values: [ - Located { + Attributed { range: 0..1, custom: (), node: Name( @@ -19,7 +19,7 @@ Located { }, ), }, - Located { + Attributed { range: 5..6, custom: (), node: Name( diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__parse_class.snap b/parser/src/snapshots/rustpython_parser__parser__tests__parse_class.snap index 8c86884..334c6f6 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__parse_class.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__parse_class.snap @@ -3,14 +3,14 @@ source: parser/src/parser.rs expression: "parse_program(source, \"\").unwrap()" --- [ - Located { + Attributed { range: 0..98, custom: (), node: ClassDef( StmtClassDef { name: "Foo", bases: [ - Located { + Attributed { range: 10..11, custom: (), node: Name( @@ -20,7 +20,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 13..14, custom: (), node: Name( @@ -33,7 +33,7 @@ expression: "parse_program(source, \"\").unwrap()" ], keywords: [], body: [ - Located { + Attributed { range: 18..44, custom: (), node: FunctionDef( @@ -42,7 +42,7 @@ expression: "parse_program(source, \"\").unwrap()" args: Arguments { posonlyargs: [], args: [ - Located { + Attributed { range: 31..35, custom: (), node: ArgData { @@ -59,7 +59,7 @@ expression: "parse_program(source, \"\").unwrap()" defaults: [], }, body: [ - Located { + Attributed { range: 40..44, custom: (), node: Pass, @@ -71,7 +71,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 46..98, custom: (), node: FunctionDef( @@ -80,7 +80,7 @@ expression: "parse_program(source, \"\").unwrap()" args: Arguments { posonlyargs: [], args: [ - Located { + Attributed { range: 70..74, custom: (), node: ArgData { @@ -89,7 +89,7 @@ expression: "parse_program(source, \"\").unwrap()" type_comment: None, }, }, - Located { + Attributed { range: 76..79, custom: (), node: ArgData { @@ -104,7 +104,7 @@ expression: "parse_program(source, \"\").unwrap()" kw_defaults: [], kwarg: None, defaults: [ - Located { + Attributed { range: 80..89, custom: (), node: Constant( @@ -119,7 +119,7 @@ expression: "parse_program(source, \"\").unwrap()" ], }, body: [ - Located { + Attributed { range: 94..98, custom: (), node: Pass, diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__parse_dict_comprehension.snap b/parser/src/snapshots/rustpython_parser__parser__tests__parse_dict_comprehension.snap index a90f990..465215e 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__parse_dict_comprehension.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__parse_dict_comprehension.snap @@ -2,12 +2,12 @@ source: parser/src/parser.rs expression: parse_ast --- -Located { +Attributed { range: 0..19, custom: (), node: DictComp( ExprDictComp { - key: Located { + key: Attributed { range: 1..3, custom: (), node: Name( @@ -17,7 +17,7 @@ Located { }, ), }, - value: Located { + value: Attributed { range: 5..7, custom: (), node: Name( @@ -29,7 +29,7 @@ Located { }, generators: [ Comprehension { - target: Located { + target: Attributed { range: 12..13, custom: (), node: Name( @@ -39,7 +39,7 @@ Located { }, ), }, - iter: Located { + iter: Attributed { range: 17..18, custom: (), node: Name( diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__parse_double_list_comprehension.snap b/parser/src/snapshots/rustpython_parser__parser__tests__parse_double_list_comprehension.snap index 7b56bfa..325a0f9 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__parse_double_list_comprehension.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__parse_double_list_comprehension.snap @@ -2,12 +2,12 @@ source: parser/src/parser.rs expression: parse_ast --- -Located { +Attributed { range: 0..48, custom: (), node: ListComp( ExprListComp { - elt: Located { + elt: Attributed { range: 1..2, custom: (), node: Name( @@ -19,13 +19,13 @@ Located { }, generators: [ Comprehension { - target: Located { + target: Attributed { range: 7..12, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 7..8, custom: (), node: Name( @@ -35,7 +35,7 @@ Located { }, ), }, - Located { + Attributed { range: 10..12, custom: (), node: Name( @@ -50,7 +50,7 @@ Located { }, ), }, - iter: Located { + iter: Attributed { range: 16..17, custom: (), node: Name( @@ -64,7 +64,7 @@ Located { is_async: 0, }, Comprehension { - target: Located { + target: Attributed { range: 22..23, custom: (), node: Name( @@ -74,7 +74,7 @@ Located { }, ), }, - iter: Located { + iter: Attributed { range: 27..28, custom: (), node: Name( @@ -85,12 +85,12 @@ Located { ), }, ifs: [ - Located { + Attributed { range: 32..37, custom: (), node: Compare( ExprCompare { - left: Located { + left: Attributed { range: 32..33, custom: (), node: Name( @@ -104,7 +104,7 @@ Located { Lt, ], comparators: [ - Located { + Attributed { range: 36..37, custom: (), node: Constant( @@ -120,12 +120,12 @@ Located { }, ), }, - Located { + Attributed { range: 41..47, custom: (), node: Compare( ExprCompare { - left: Located { + left: Attributed { range: 41..42, custom: (), node: Name( @@ -139,7 +139,7 @@ Located { Gt, ], comparators: [ - Located { + Attributed { range: 45..47, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__parse_f_string.snap b/parser/src/snapshots/rustpython_parser__parser__tests__parse_f_string.snap index bfbd69e..7fd3d4f 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__parse_f_string.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__parse_f_string.snap @@ -3,18 +3,18 @@ source: parser/src/parser.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..14, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..14, custom: (), node: JoinedStr( ExprJoinedStr { values: [ - Located { + Attributed { range: 0..14, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__parse_generator_comprehension.snap b/parser/src/snapshots/rustpython_parser__parser__tests__parse_generator_comprehension.snap index 491209f..e0b1b9b 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__parse_generator_comprehension.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__parse_generator_comprehension.snap @@ -2,12 +2,12 @@ source: parser/src/parser.rs expression: parse_ast --- -Located { +Attributed { range: 0..14, custom: (), node: GeneratorExp( ExprGeneratorExp { - elt: Located { + elt: Attributed { range: 1..2, custom: (), node: Name( @@ -19,7 +19,7 @@ Located { }, generators: [ Comprehension { - target: Located { + target: Attributed { range: 7..8, custom: (), node: Name( @@ -29,7 +29,7 @@ Located { }, ), }, - iter: Located { + iter: Attributed { range: 12..13, custom: (), node: Name( diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__parse_if_elif_else.snap b/parser/src/snapshots/rustpython_parser__parser__tests__parse_if_elif_else.snap index c657e36..9d0d3b3 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__parse_if_elif_else.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__parse_if_elif_else.snap @@ -3,12 +3,12 @@ source: parser/src/parser.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..28, custom: (), node: If( StmtIf { - test: Located { + test: Attributed { range: 3..4, custom: (), node: Constant( @@ -21,12 +21,12 @@ expression: parse_ast ), }, body: [ - Located { + Attributed { range: 6..8, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 6..8, custom: (), node: Constant( @@ -43,12 +43,12 @@ expression: parse_ast }, ], orelse: [ - Located { + Attributed { range: 9..28, custom: (), node: If( StmtIf { - test: Located { + test: Attributed { range: 14..15, custom: (), node: Constant( @@ -61,12 +61,12 @@ expression: parse_ast ), }, body: [ - Located { + Attributed { range: 17..19, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 17..19, custom: (), node: Constant( @@ -83,12 +83,12 @@ expression: parse_ast }, ], orelse: [ - Located { + Attributed { range: 26..28, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 26..28, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__parse_if_else_generator_comprehension.snap b/parser/src/snapshots/rustpython_parser__parser__tests__parse_if_else_generator_comprehension.snap index 7113c31..660f392 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__parse_if_else_generator_comprehension.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__parse_if_else_generator_comprehension.snap @@ -2,17 +2,17 @@ source: parser/src/parser.rs expression: parse_ast --- -Located { +Attributed { range: 0..26, custom: (), node: GeneratorExp( ExprGeneratorExp { - elt: Located { + elt: Attributed { range: 1..14, custom: (), node: IfExp( ExprIfExp { - test: Located { + test: Attributed { range: 6..7, custom: (), node: Name( @@ -22,7 +22,7 @@ Located { }, ), }, - body: Located { + body: Attributed { range: 1..2, custom: (), node: Name( @@ -32,7 +32,7 @@ Located { }, ), }, - orelse: Located { + orelse: Attributed { range: 13..14, custom: (), node: Name( @@ -47,7 +47,7 @@ Located { }, generators: [ Comprehension { - target: Located { + target: Attributed { range: 19..20, custom: (), node: Name( @@ -57,7 +57,7 @@ Located { }, ), }, - iter: Located { + iter: Attributed { range: 24..25, custom: (), node: Name( diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__parse_kwargs.snap b/parser/src/snapshots/rustpython_parser__parser__tests__parse_kwargs.snap index 1ddc35c..3b22c95 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__parse_kwargs.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__parse_kwargs.snap @@ -3,17 +3,17 @@ source: parser/src/parser.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..32, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..32, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 0..7, custom: (), node: Name( @@ -24,7 +24,7 @@ expression: parse_ast ), }, args: [ - Located { + Attributed { range: 8..20, custom: (), node: Constant( @@ -38,14 +38,14 @@ expression: parse_ast }, ], keywords: [ - Located { + Attributed { range: 22..31, custom: (), node: KeywordData { arg: Some( "keyword", ), - value: Located { + value: Attributed { range: 30..31, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__parse_lambda.snap b/parser/src/snapshots/rustpython_parser__parser__tests__parse_lambda.snap index 8fd9e6e..f43fddf 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__parse_lambda.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__parse_lambda.snap @@ -3,12 +3,12 @@ source: parser/src/parser.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..18, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..18, custom: (), node: Lambda( @@ -16,7 +16,7 @@ expression: parse_ast args: Arguments { posonlyargs: [], args: [ - Located { + Attributed { range: 7..8, custom: (), node: ArgData { @@ -25,7 +25,7 @@ expression: parse_ast type_comment: None, }, }, - Located { + Attributed { range: 10..11, custom: (), node: ArgData { @@ -41,12 +41,12 @@ expression: parse_ast kwarg: None, defaults: [], }, - body: Located { + body: Attributed { range: 13..18, custom: (), node: BinOp( ExprBinOp { - left: Located { + left: Attributed { range: 13..14, custom: (), node: Name( @@ -57,7 +57,7 @@ expression: parse_ast ), }, op: Mult, - right: Located { + right: Attributed { range: 17..18, custom: (), node: Name( diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__parse_list_comprehension.snap b/parser/src/snapshots/rustpython_parser__parser__tests__parse_list_comprehension.snap index cd675a0..8b18151 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__parse_list_comprehension.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__parse_list_comprehension.snap @@ -2,12 +2,12 @@ source: parser/src/parser.rs expression: parse_ast --- -Located { +Attributed { range: 0..14, custom: (), node: ListComp( ExprListComp { - elt: Located { + elt: Attributed { range: 1..2, custom: (), node: Name( @@ -19,7 +19,7 @@ Located { }, generators: [ Comprehension { - target: Located { + target: Attributed { range: 7..8, custom: (), node: Name( @@ -29,7 +29,7 @@ Located { }, ), }, - iter: Located { + iter: Attributed { range: 12..13, custom: (), node: Name( diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__parse_named_expression_generator_comprehension.snap b/parser/src/snapshots/rustpython_parser__parser__tests__parse_named_expression_generator_comprehension.snap index d999c7a..abd39b1 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__parse_named_expression_generator_comprehension.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__parse_named_expression_generator_comprehension.snap @@ -2,17 +2,17 @@ source: parser/src/parser.rs expression: parse_ast --- -Located { +Attributed { range: 0..23, custom: (), node: GeneratorExp( ExprGeneratorExp { - elt: Located { + elt: Attributed { range: 1..11, custom: (), node: NamedExpr( ExprNamedExpr { - target: Located { + target: Attributed { range: 1..2, custom: (), node: Name( @@ -22,12 +22,12 @@ Located { }, ), }, - value: Located { + value: Attributed { range: 6..11, custom: (), node: BinOp( ExprBinOp { - left: Located { + left: Attributed { range: 6..7, custom: (), node: Name( @@ -38,7 +38,7 @@ Located { ), }, op: Add, - right: Located { + right: Attributed { range: 10..11, custom: (), node: Constant( @@ -58,7 +58,7 @@ Located { }, generators: [ Comprehension { - target: Located { + target: Attributed { range: 16..17, custom: (), node: Name( @@ -68,7 +68,7 @@ Located { }, ), }, - iter: Located { + iter: Attributed { range: 21..22, custom: (), node: Name( diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__parse_print_2.snap b/parser/src/snapshots/rustpython_parser__parser__tests__parse_print_2.snap index c437b3c..a9d1ecc 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__parse_print_2.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__parse_print_2.snap @@ -3,17 +3,17 @@ source: parser/src/parser.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..23, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..23, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 0..5, custom: (), node: Name( @@ -24,7 +24,7 @@ expression: parse_ast ), }, args: [ - Located { + Attributed { range: 6..19, custom: (), node: Constant( @@ -36,7 +36,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 21..22, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__parse_print_hello.snap b/parser/src/snapshots/rustpython_parser__parser__tests__parse_print_hello.snap index 97a506d..2fc07ef 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__parse_print_hello.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__parse_print_hello.snap @@ -3,17 +3,17 @@ source: parser/src/parser.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..20, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..20, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 0..5, custom: (), node: Name( @@ -24,7 +24,7 @@ expression: parse_ast ), }, args: [ - Located { + Attributed { range: 6..19, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__parse_string.snap b/parser/src/snapshots/rustpython_parser__parser__tests__parse_string.snap index aaa9633..726f4c6 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__parse_string.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__parse_string.snap @@ -3,12 +3,12 @@ source: parser/src/parser.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..13, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..13, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__parse_tuples.snap b/parser/src/snapshots/rustpython_parser__parser__tests__parse_tuples.snap index fdd4177..c3e7a36 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__parse_tuples.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__parse_tuples.snap @@ -3,19 +3,19 @@ source: parser/src/parser.rs expression: "parse_program(source, \"\").unwrap()" --- [ - Located { + Attributed { range: 0..11, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 0..4, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 0..1, custom: (), node: Name( @@ -25,7 +25,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 3..4, custom: (), node: Name( @@ -41,13 +41,13 @@ expression: "parse_program(source, \"\").unwrap()" ), }, ], - value: Located { + value: Attributed { range: 7..11, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 7..8, custom: (), node: Constant( @@ -59,7 +59,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 10..11, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__patma.snap b/parser/src/snapshots/rustpython_parser__parser__tests__patma.snap index 4da93f1..e3d8a34 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__patma.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__patma.snap @@ -3,12 +3,12 @@ source: parser/src/parser.rs expression: parse_ast --- [ - Located { + Attributed { range: 67..103, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 73..74, custom: (), node: Name( @@ -20,18 +20,18 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 85..88, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 85..88, custom: (), node: UnaryOp( ExprUnaryOp { op: USub, - operand: Located { + operand: Attributed { range: 86..88, custom: (), node: Constant( @@ -52,13 +52,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 98..103, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 98..99, custom: (), node: Name( @@ -69,7 +69,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 102..103, custom: (), node: Constant( @@ -91,12 +91,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 126..167, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 132..133, custom: (), node: Name( @@ -108,12 +108,12 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 144..152, custom: (), node: MatchClass( PatternMatchClass { - cls: Located { + cls: Attributed { range: 144..149, custom: (), node: Name( @@ -124,7 +124,7 @@ expression: parse_ast ), }, patterns: [ - Located { + Attributed { range: 150..151, custom: (), node: MatchAs( @@ -144,13 +144,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 162..167, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 162..163, custom: (), node: Name( @@ -161,7 +161,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 166..167, custom: (), node: Constant( @@ -183,12 +183,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 190..260, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 196..197, custom: (), node: Name( @@ -200,12 +200,12 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 208..209, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 208..209, custom: (), node: Constant( @@ -221,7 +221,7 @@ expression: parse_ast ), }, guard: Some( - Located { + Attributed { range: 213..214, custom: (), node: Constant( @@ -235,13 +235,13 @@ expression: parse_ast }, ), body: [ - Located { + Attributed { range: 224..229, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 224..225, custom: (), node: Name( @@ -252,7 +252,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 228..229, custom: (), node: Constant( @@ -271,12 +271,12 @@ expression: parse_ast ], }, MatchCase { - pattern: Located { + pattern: Attributed { range: 239..240, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 239..240, custom: (), node: Constant( @@ -292,7 +292,7 @@ expression: parse_ast ), }, guard: Some( - Located { + Attributed { range: 244..245, custom: (), node: Constant( @@ -306,13 +306,13 @@ expression: parse_ast }, ), body: [ - Located { + Attributed { range: 255..260, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 255..256, custom: (), node: Name( @@ -323,7 +323,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 259..260, custom: (), node: Constant( @@ -345,12 +345,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 283..332, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 289..290, custom: (), node: Constant( @@ -364,18 +364,18 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 301..314, custom: (), node: MatchOr( PatternMatchOr { patterns: [ - Located { + Attributed { range: 301..302, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 301..302, custom: (), node: Constant( @@ -390,12 +390,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 305..306, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 305..306, custom: (), node: Constant( @@ -410,12 +410,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 309..310, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 309..310, custom: (), node: Constant( @@ -430,12 +430,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 313..314, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 313..314, custom: (), node: Constant( @@ -456,13 +456,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 324..332, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 324..325, custom: (), node: Name( @@ -473,7 +473,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 328..332, custom: (), node: Constant( @@ -495,12 +495,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 355..403, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 361..362, custom: (), node: Name( @@ -512,24 +512,24 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 373..388, custom: (), node: MatchOr( PatternMatchOr { patterns: [ - Located { + Attributed { range: 373..379, custom: (), node: MatchSequence( PatternMatchSequence { patterns: [ - Located { + Attributed { range: 374..375, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 374..375, custom: (), node: Constant( @@ -544,12 +544,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 377..378, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 377..378, custom: (), node: Constant( @@ -568,18 +568,18 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 382..388, custom: (), node: MatchSequence( PatternMatchSequence { patterns: [ - Located { + Attributed { range: 383..384, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 383..384, custom: (), node: Constant( @@ -594,12 +594,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 386..387, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 386..387, custom: (), node: Constant( @@ -624,13 +624,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 398..403, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 398..399, custom: (), node: Name( @@ -641,7 +641,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 402..403, custom: (), node: Constant( @@ -663,12 +663,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 445..523, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 451..452, custom: (), node: Name( @@ -680,13 +680,13 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 463..467, custom: (), node: MatchSequence( PatternMatchSequence { patterns: [ - Located { + Attributed { range: 464..466, custom: (), node: MatchStar( @@ -701,13 +701,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 477..489, custom: (), node: Return( StmtReturn { value: Some( - Located { + Attributed { range: 484..489, custom: (), node: Constant( @@ -726,7 +726,7 @@ expression: parse_ast ], }, MatchCase { - pattern: Located { + pattern: Attributed { range: 499..501, custom: (), node: MatchMapping( @@ -739,13 +739,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 511..523, custom: (), node: Return( StmtReturn { value: Some( - Located { + Attributed { range: 518..523, custom: (), node: Constant( @@ -767,12 +767,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 546..714, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 552..553, custom: (), node: Name( @@ -784,13 +784,13 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 564..579, custom: (), node: MatchMapping( PatternMatchMapping { keys: [ - Located { + Attributed { range: 565..566, custom: (), node: Constant( @@ -804,18 +804,18 @@ expression: parse_ast }, ], patterns: [ - Located { + Attributed { range: 568..578, custom: (), node: MatchSequence( PatternMatchSequence { patterns: [ - Located { + Attributed { range: 569..570, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 569..570, custom: (), node: Constant( @@ -830,12 +830,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 572..573, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 572..573, custom: (), node: Constant( @@ -850,7 +850,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 575..577, custom: (), node: MatchMapping( @@ -872,13 +872,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 589..594, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 589..590, custom: (), node: Name( @@ -889,7 +889,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 593..594, custom: (), node: Constant( @@ -908,19 +908,19 @@ expression: parse_ast ], }, MatchCase { - pattern: Located { + pattern: Attributed { range: 604..672, custom: (), node: MatchOr( PatternMatchOr { patterns: [ - Located { + Attributed { range: 604..626, custom: (), node: MatchMapping( PatternMatchMapping { keys: [ - Located { + Attributed { range: 605..606, custom: (), node: Constant( @@ -934,24 +934,24 @@ expression: parse_ast }, ], patterns: [ - Located { + Attributed { range: 608..625, custom: (), node: MatchOr( PatternMatchOr { patterns: [ - Located { + Attributed { range: 608..618, custom: (), node: MatchSequence( PatternMatchSequence { patterns: [ - Located { + Attributed { range: 609..610, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 609..610, custom: (), node: Constant( @@ -966,12 +966,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 612..613, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 612..613, custom: (), node: Constant( @@ -986,7 +986,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 615..617, custom: (), node: MatchMapping( @@ -1001,7 +1001,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 621..625, custom: (), node: MatchSingleton( @@ -1021,13 +1021,13 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 629..638, custom: (), node: MatchMapping( PatternMatchMapping { keys: [ - Located { + Attributed { range: 630..631, custom: (), node: Constant( @@ -1041,13 +1041,13 @@ expression: parse_ast }, ], patterns: [ - Located { + Attributed { range: 633..637, custom: (), node: MatchSequence( PatternMatchSequence { patterns: [ - Located { + Attributed { range: 634..636, custom: (), node: MatchSequence( @@ -1065,13 +1065,13 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 641..656, custom: (), node: MatchMapping( PatternMatchMapping { keys: [ - Located { + Attributed { range: 642..643, custom: (), node: Constant( @@ -1085,18 +1085,18 @@ expression: parse_ast }, ], patterns: [ - Located { + Attributed { range: 645..655, custom: (), node: MatchSequence( PatternMatchSequence { patterns: [ - Located { + Attributed { range: 646..647, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 646..647, custom: (), node: Constant( @@ -1111,12 +1111,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 649..650, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 649..650, custom: (), node: Constant( @@ -1131,7 +1131,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 652..654, custom: (), node: MatchMapping( @@ -1151,7 +1151,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 659..661, custom: (), node: MatchSequence( @@ -1160,12 +1160,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 664..667, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 664..667, custom: (), node: Constant( @@ -1180,7 +1180,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 670..672, custom: (), node: MatchMapping( @@ -1197,13 +1197,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 682..687, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 682..683, custom: (), node: Name( @@ -1214,7 +1214,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 686..687, custom: (), node: Constant( @@ -1233,7 +1233,7 @@ expression: parse_ast ], }, MatchCase { - pattern: Located { + pattern: Attributed { range: 697..699, custom: (), node: MatchSequence( @@ -1244,13 +1244,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 709..714, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 709..710, custom: (), node: Name( @@ -1261,7 +1261,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 713..714, custom: (), node: Constant( @@ -1283,12 +1283,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 737..782, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 743..744, custom: (), node: Name( @@ -1300,17 +1300,17 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 755..767, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 755..767, custom: (), node: BinOp( ExprBinOp { - left: Located { + left: Attributed { range: 755..759, custom: (), node: Constant( @@ -1323,7 +1323,7 @@ expression: parse_ast ), }, op: Add, - right: Located { + right: Attributed { range: 762..767, custom: (), node: Constant( @@ -1344,13 +1344,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 777..782, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 777..778, custom: (), node: Name( @@ -1361,7 +1361,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 781..782, custom: (), node: Constant( @@ -1383,12 +1383,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 805..841, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 811..812, custom: (), node: Name( @@ -1400,18 +1400,18 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 823..826, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 823..826, custom: (), node: UnaryOp( ExprUnaryOp { op: USub, - operand: Located { + operand: Attributed { range: 824..826, custom: (), node: Constant( @@ -1432,13 +1432,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 836..841, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 836..837, custom: (), node: Name( @@ -1449,7 +1449,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 840..841, custom: (), node: Constant( @@ -1471,12 +1471,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 864..913, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 870..871, custom: (), node: Constant( @@ -1490,18 +1490,18 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 882..895, custom: (), node: MatchOr( PatternMatchOr { patterns: [ - Located { + Attributed { range: 882..883, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 882..883, custom: (), node: Constant( @@ -1516,12 +1516,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 886..887, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 886..887, custom: (), node: Constant( @@ -1536,12 +1536,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 890..891, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 890..891, custom: (), node: Constant( @@ -1556,12 +1556,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 894..895, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 894..895, custom: (), node: Constant( @@ -1582,13 +1582,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 905..913, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 905..906, custom: (), node: Name( @@ -1599,7 +1599,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 909..913, custom: (), node: Constant( @@ -1621,12 +1621,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 936..975, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 942..943, custom: (), node: Name( @@ -1638,12 +1638,12 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 954..955, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 954..955, custom: (), node: Constant( @@ -1659,7 +1659,7 @@ expression: parse_ast ), }, guard: Some( - Located { + Attributed { range: 959..960, custom: (), node: Name( @@ -1671,13 +1671,13 @@ expression: parse_ast }, ), body: [ - Located { + Attributed { range: 970..975, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 970..971, custom: (), node: Name( @@ -1688,7 +1688,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 974..975, custom: (), node: Constant( @@ -1710,12 +1710,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 998..1098, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 1004..1005, custom: (), node: Name( @@ -1727,13 +1727,13 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 1016..1022, custom: (), node: MatchMapping( PatternMatchMapping { keys: [ - Located { + Attributed { range: 1017..1018, custom: (), node: Constant( @@ -1747,12 +1747,12 @@ expression: parse_ast }, ], patterns: [ - Located { + Attributed { range: 1020..1021, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 1020..1021, custom: (), node: Constant( @@ -1774,13 +1774,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 1032..1037, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 1032..1033, custom: (), node: Name( @@ -1791,7 +1791,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 1036..1037, custom: (), node: Constant( @@ -1810,13 +1810,13 @@ expression: parse_ast ], }, MatchCase { - pattern: Located { + pattern: Attributed { range: 1047..1053, custom: (), node: MatchMapping( PatternMatchMapping { keys: [ - Located { + Attributed { range: 1048..1049, custom: (), node: Constant( @@ -1830,12 +1830,12 @@ expression: parse_ast }, ], patterns: [ - Located { + Attributed { range: 1051..1052, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 1051..1052, custom: (), node: Constant( @@ -1857,13 +1857,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 1063..1068, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 1063..1064, custom: (), node: Name( @@ -1874,7 +1874,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 1067..1068, custom: (), node: Constant( @@ -1893,7 +1893,7 @@ expression: parse_ast ], }, MatchCase { - pattern: Located { + pattern: Attributed { range: 1078..1083, custom: (), node: MatchMapping( @@ -1908,13 +1908,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 1093..1098, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 1093..1094, custom: (), node: Name( @@ -1925,7 +1925,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 1097..1098, custom: (), node: Constant( @@ -1947,17 +1947,17 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 1121..1162, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 1127..1132, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 1127..1130, custom: (), node: Name( @@ -1974,13 +1974,13 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 1143..1147, custom: (), node: MatchSequence( PatternMatchSequence { patterns: [ - Located { + Attributed { range: 1144..1146, custom: (), node: MatchStar( @@ -1995,13 +1995,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 1157..1162, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 1157..1158, custom: (), node: Name( @@ -2012,7 +2012,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 1161..1162, custom: (), node: Constant( @@ -2034,12 +2034,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 1185..1245, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 1191..1192, custom: (), node: Name( @@ -2051,12 +2051,12 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 1203..1204, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 1203..1204, custom: (), node: Constant( @@ -2073,13 +2073,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 1214..1219, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 1214..1215, custom: (), node: Name( @@ -2090,7 +2090,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 1218..1219, custom: (), node: Constant( @@ -2109,12 +2109,12 @@ expression: parse_ast ], }, MatchCase { - pattern: Located { + pattern: Attributed { range: 1229..1230, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 1229..1230, custom: (), node: Constant( @@ -2131,13 +2131,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 1240..1245, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 1240..1241, custom: (), node: Name( @@ -2148,7 +2148,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 1244..1245, custom: (), node: Constant( @@ -2170,12 +2170,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 1268..1315, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 1274..1275, custom: (), node: Name( @@ -2187,13 +2187,13 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 1286..1298, custom: (), node: MatchMapping( PatternMatchMapping { keys: [ - Located { + Attributed { range: 1287..1292, custom: (), node: Constant( @@ -2207,7 +2207,7 @@ expression: parse_ast }, ], patterns: [ - Located { + Attributed { range: 1294..1297, custom: (), node: MatchAs( @@ -2226,13 +2226,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 1308..1315, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 1308..1309, custom: (), node: Name( @@ -2243,7 +2243,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 1312..1315, custom: (), node: Name( @@ -2263,18 +2263,18 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 1338..1392, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 1344..1353, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 1345..1346, custom: (), node: Constant( @@ -2286,7 +2286,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 1348..1349, custom: (), node: Constant( @@ -2298,7 +2298,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 1351..1352, custom: (), node: Constant( @@ -2317,18 +2317,18 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 1364..1377, custom: (), node: MatchSequence( PatternMatchSequence { patterns: [ - Located { + Attributed { range: 1365..1366, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 1365..1366, custom: (), node: Constant( @@ -2343,12 +2343,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 1368..1369, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 1368..1369, custom: (), node: Constant( @@ -2363,7 +2363,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 1371..1373, custom: (), node: MatchStar( @@ -2374,12 +2374,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 1375..1376, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 1375..1376, custom: (), node: Constant( @@ -2400,13 +2400,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 1387..1392, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 1387..1388, custom: (), node: Name( @@ -2417,7 +2417,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 1391..1392, custom: (), node: Constant( @@ -2439,12 +2439,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 1415..1529, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 1421..1422, custom: (), node: Name( @@ -2456,18 +2456,18 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 1433..1436, custom: (), node: MatchSequence( PatternMatchSequence { patterns: [ - Located { + Attributed { range: 1434..1435, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 1434..1435, custom: (), node: Constant( @@ -2488,13 +2488,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 1446..1451, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 1446..1447, custom: (), node: Name( @@ -2505,7 +2505,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 1450..1451, custom: (), node: Constant( @@ -2524,18 +2524,18 @@ expression: parse_ast ], }, MatchCase { - pattern: Located { + pattern: Attributed { range: 1461..1467, custom: (), node: MatchSequence( PatternMatchSequence { patterns: [ - Located { + Attributed { range: 1462..1463, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 1462..1463, custom: (), node: Constant( @@ -2550,12 +2550,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 1465..1466, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 1465..1466, custom: (), node: Constant( @@ -2575,12 +2575,12 @@ expression: parse_ast ), }, guard: Some( - Located { + Attributed { range: 1472..1482, custom: (), node: NamedExpr( ExprNamedExpr { - target: Located { + target: Attributed { range: 1472..1473, custom: (), node: Name( @@ -2590,12 +2590,12 @@ expression: parse_ast }, ), }, - value: Located { + value: Attributed { range: 1477..1482, custom: (), node: Subscript( ExprSubscript { - value: Located { + value: Attributed { range: 1477..1478, custom: (), node: Name( @@ -2605,14 +2605,14 @@ expression: parse_ast }, ), }, - slice: Located { + slice: Attributed { range: 1479..1481, custom: (), node: Slice( ExprSlice { lower: None, upper: Some( - Located { + Attributed { range: 1480..1481, custom: (), node: Constant( @@ -2638,13 +2638,13 @@ expression: parse_ast }, ), body: [ - Located { + Attributed { range: 1493..1498, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 1493..1494, custom: (), node: Name( @@ -2655,7 +2655,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 1497..1498, custom: (), node: Constant( @@ -2674,18 +2674,18 @@ expression: parse_ast ], }, MatchCase { - pattern: Located { + pattern: Attributed { range: 1508..1514, custom: (), node: MatchSequence( PatternMatchSequence { patterns: [ - Located { + Attributed { range: 1509..1510, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 1509..1510, custom: (), node: Constant( @@ -2700,12 +2700,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 1512..1513, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 1512..1513, custom: (), node: Constant( @@ -2726,13 +2726,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 1524..1529, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 1524..1525, custom: (), node: Name( @@ -2743,7 +2743,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 1528..1529, custom: (), node: Constant( @@ -2765,12 +2765,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 1552..1595, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 1558..1559, custom: (), node: Name( @@ -2782,13 +2782,13 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 1570..1580, custom: (), node: MatchSequence( PatternMatchSequence { patterns: [ - Located { + Attributed { range: 1571..1572, custom: (), node: MatchAs( @@ -2800,7 +2800,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 1574..1575, custom: (), node: MatchAs( @@ -2812,7 +2812,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 1577..1579, custom: (), node: MatchStar( @@ -2827,13 +2827,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 1590..1595, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 1590..1591, custom: (), node: Name( @@ -2844,7 +2844,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 1594..1595, custom: (), node: Constant( @@ -2866,12 +2866,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 1618..1664, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 1624..1625, custom: (), node: Name( @@ -2883,23 +2883,23 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 1636..1649, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 1636..1649, custom: (), node: BinOp( ExprBinOp { - left: Located { + left: Attributed { range: 1636..1641, custom: (), node: UnaryOp( ExprUnaryOp { op: USub, - operand: Located { + operand: Attributed { range: 1637..1641, custom: (), node: Constant( @@ -2915,7 +2915,7 @@ expression: parse_ast ), }, op: Sub, - right: Located { + right: Attributed { range: 1644..1649, custom: (), node: Constant( @@ -2936,13 +2936,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 1659..1664, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 1659..1660, custom: (), node: Name( @@ -2953,7 +2953,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 1663..1664, custom: (), node: Constant( @@ -2975,18 +2975,18 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 1687..1726, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 1693..1697, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 1694..1695, custom: (), node: Name( @@ -3003,13 +3003,13 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 1708..1711, custom: (), node: MatchSequence( PatternMatchSequence { patterns: [ - Located { + Attributed { range: 1709..1710, custom: (), node: MatchAs( @@ -3027,13 +3027,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 1721..1726, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 1721..1722, custom: (), node: Name( @@ -3044,7 +3044,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 1725..1726, custom: (), node: Constant( @@ -3066,12 +3066,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 1749..1789, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 1755..1756, custom: (), node: Name( @@ -3083,27 +3083,27 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 1767..1774, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 1767..1774, custom: (), node: Attribute( ExprAttribute { - value: Located { + value: Attributed { range: 1767..1772, custom: (), node: Attribute( ExprAttribute { - value: Located { + value: Attributed { range: 1767..1770, custom: (), node: Attribute( ExprAttribute { - value: Located { + value: Attributed { range: 1767..1768, custom: (), node: Name( @@ -3133,13 +3133,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 1784..1789, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 1784..1785, custom: (), node: Name( @@ -3150,7 +3150,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 1788..1789, custom: (), node: Constant( @@ -3172,12 +3172,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 1812..1849, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 1818..1819, custom: (), node: Name( @@ -3189,7 +3189,7 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 1830..1834, custom: (), node: MatchSingleton( @@ -3200,13 +3200,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 1844..1849, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 1844..1845, custom: (), node: Name( @@ -3217,7 +3217,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 1848..1849, custom: (), node: Constant( @@ -3239,12 +3239,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 1872..1906, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 1878..1879, custom: (), node: Name( @@ -3256,12 +3256,12 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 1890..1891, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 1890..1891, custom: (), node: Constant( @@ -3278,13 +3278,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 1901..1906, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 1901..1902, custom: (), node: Name( @@ -3295,7 +3295,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 1905..1906, custom: (), node: Constant( @@ -3317,12 +3317,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 1929..1967, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 1935..1936, custom: (), node: Name( @@ -3334,7 +3334,7 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 1947..1952, custom: (), node: MatchSingleton( @@ -3347,13 +3347,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 1962..1967, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 1962..1963, custom: (), node: Name( @@ -3364,7 +3364,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 1966..1967, custom: (), node: Constant( @@ -3386,12 +3386,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 1990..2081, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 1996..1997, custom: (), node: Name( @@ -3403,7 +3403,7 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 2008..2010, custom: (), node: MatchSequence( @@ -3414,13 +3414,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 2020..2025, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 2020..2021, custom: (), node: Name( @@ -3431,7 +3431,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 2024..2025, custom: (), node: Constant( @@ -3450,18 +3450,18 @@ expression: parse_ast ], }, MatchCase { - pattern: Located { + pattern: Attributed { range: 2035..2039, custom: (), node: MatchSequence( PatternMatchSequence { patterns: [ - Located { + Attributed { range: 2036..2038, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 2036..2038, custom: (), node: Constant( @@ -3482,13 +3482,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 2049..2054, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 2049..2050, custom: (), node: Name( @@ -3499,7 +3499,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 2053..2054, custom: (), node: Constant( @@ -3518,12 +3518,12 @@ expression: parse_ast ], }, MatchCase { - pattern: Located { + pattern: Attributed { range: 2064..2066, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 2064..2066, custom: (), node: Constant( @@ -3540,13 +3540,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 2076..2081, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 2076..2077, custom: (), node: Name( @@ -3557,7 +3557,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 2080..2081, custom: (), node: Constant( @@ -3579,12 +3579,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2104..2138, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 2110..2111, custom: (), node: Name( @@ -3596,7 +3596,7 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 2122..2123, custom: (), node: MatchAs( @@ -3610,13 +3610,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 2133..2138, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 2133..2134, custom: (), node: Name( @@ -3627,7 +3627,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 2137..2138, custom: (), node: Constant( @@ -3649,12 +3649,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2161..2207, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 2167..2168, custom: (), node: Name( @@ -3666,13 +3666,13 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 2179..2192, custom: (), node: MatchSequence( PatternMatchSequence { patterns: [ - Located { + Attributed { range: 2180..2181, custom: (), node: MatchAs( @@ -3684,7 +3684,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2183..2184, custom: (), node: MatchAs( @@ -3696,7 +3696,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2186..2191, custom: (), node: MatchStar( @@ -3713,13 +3713,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 2202..2207, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 2202..2203, custom: (), node: Name( @@ -3730,7 +3730,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 2206..2207, custom: (), node: Constant( @@ -3752,12 +3752,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2230..2307, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 2236..2237, custom: (), node: Name( @@ -3769,24 +3769,24 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 2248..2278, custom: (), node: MatchOr( PatternMatchOr { patterns: [ - Located { + Attributed { range: 2248..2256, custom: (), node: MatchAs( PatternMatchAs { pattern: Some( - Located { + Attributed { range: 2249..2250, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 2249..2250, custom: (), node: Constant( @@ -3808,18 +3808,18 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2259..2267, custom: (), node: MatchAs( PatternMatchAs { pattern: Some( - Located { + Attributed { range: 2260..2261, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 2260..2261, custom: (), node: Constant( @@ -3841,18 +3841,18 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2270..2278, custom: (), node: MatchAs( PatternMatchAs { pattern: Some( - Located { + Attributed { range: 2271..2272, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 2271..2272, custom: (), node: Constant( @@ -3879,12 +3879,12 @@ expression: parse_ast ), }, guard: Some( - Located { + Attributed { range: 2282..2292, custom: (), node: Compare( ExprCompare { - left: Located { + left: Attributed { range: 2282..2283, custom: (), node: Name( @@ -3898,12 +3898,12 @@ expression: parse_ast Eq, ], comparators: [ - Located { + Attributed { range: 2287..2292, custom: (), node: BinOp( ExprBinOp { - left: Located { + left: Attributed { range: 2287..2288, custom: (), node: Name( @@ -3914,7 +3914,7 @@ expression: parse_ast ), }, op: Mod, - right: Located { + right: Attributed { range: 2291..2292, custom: (), node: Constant( @@ -3935,13 +3935,13 @@ expression: parse_ast }, ), body: [ - Located { + Attributed { range: 2302..2307, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 2302..2303, custom: (), node: Name( @@ -3952,7 +3952,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 2306..2307, custom: (), node: Constant( @@ -3974,12 +3974,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2330..2499, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 2336..2337, custom: (), node: Name( @@ -3991,13 +3991,13 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 2348..2363, custom: (), node: MatchMapping( PatternMatchMapping { keys: [ - Located { + Attributed { range: 2349..2350, custom: (), node: Constant( @@ -4011,18 +4011,18 @@ expression: parse_ast }, ], patterns: [ - Located { + Attributed { range: 2352..2362, custom: (), node: MatchSequence( PatternMatchSequence { patterns: [ - Located { + Attributed { range: 2353..2354, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 2353..2354, custom: (), node: Constant( @@ -4037,12 +4037,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2356..2357, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 2356..2357, custom: (), node: Constant( @@ -4057,7 +4057,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2359..2361, custom: (), node: MatchMapping( @@ -4079,13 +4079,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 2373..2378, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 2373..2374, custom: (), node: Name( @@ -4096,7 +4096,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 2377..2378, custom: (), node: Constant( @@ -4115,19 +4115,19 @@ expression: parse_ast ], }, MatchCase { - pattern: Located { + pattern: Attributed { range: 2388..2457, custom: (), node: MatchOr( PatternMatchOr { patterns: [ - Located { + Attributed { range: 2388..2411, custom: (), node: MatchMapping( PatternMatchMapping { keys: [ - Located { + Attributed { range: 2389..2390, custom: (), node: Constant( @@ -4141,24 +4141,24 @@ expression: parse_ast }, ], patterns: [ - Located { + Attributed { range: 2392..2410, custom: (), node: MatchOr( PatternMatchOr { patterns: [ - Located { + Attributed { range: 2392..2402, custom: (), node: MatchSequence( PatternMatchSequence { patterns: [ - Located { + Attributed { range: 2393..2394, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 2393..2394, custom: (), node: Constant( @@ -4173,12 +4173,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2396..2397, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 2396..2397, custom: (), node: Constant( @@ -4193,7 +4193,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2399..2401, custom: (), node: MatchMapping( @@ -4208,7 +4208,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2405..2410, custom: (), node: MatchSingleton( @@ -4228,13 +4228,13 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2414..2423, custom: (), node: MatchMapping( PatternMatchMapping { keys: [ - Located { + Attributed { range: 2415..2416, custom: (), node: Constant( @@ -4248,13 +4248,13 @@ expression: parse_ast }, ], patterns: [ - Located { + Attributed { range: 2418..2422, custom: (), node: MatchSequence( PatternMatchSequence { patterns: [ - Located { + Attributed { range: 2419..2421, custom: (), node: MatchSequence( @@ -4272,13 +4272,13 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2426..2441, custom: (), node: MatchMapping( PatternMatchMapping { keys: [ - Located { + Attributed { range: 2427..2428, custom: (), node: Constant( @@ -4292,18 +4292,18 @@ expression: parse_ast }, ], patterns: [ - Located { + Attributed { range: 2430..2440, custom: (), node: MatchSequence( PatternMatchSequence { patterns: [ - Located { + Attributed { range: 2431..2432, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 2431..2432, custom: (), node: Constant( @@ -4318,12 +4318,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2434..2435, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 2434..2435, custom: (), node: Constant( @@ -4338,7 +4338,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2437..2439, custom: (), node: MatchMapping( @@ -4358,7 +4358,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2444..2446, custom: (), node: MatchSequence( @@ -4367,12 +4367,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2449..2452, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 2449..2452, custom: (), node: Constant( @@ -4387,7 +4387,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2455..2457, custom: (), node: MatchMapping( @@ -4404,13 +4404,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 2467..2472, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 2467..2468, custom: (), node: Name( @@ -4421,7 +4421,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 2471..2472, custom: (), node: Constant( @@ -4440,7 +4440,7 @@ expression: parse_ast ], }, MatchCase { - pattern: Located { + pattern: Attributed { range: 2482..2484, custom: (), node: MatchSequence( @@ -4451,13 +4451,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 2494..2499, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 2494..2495, custom: (), node: Name( @@ -4468,7 +4468,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 2498..2499, custom: (), node: Constant( @@ -4490,18 +4490,18 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2522..2568, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 2528..2537, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 2529..2530, custom: (), node: Constant( @@ -4513,7 +4513,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2532..2533, custom: (), node: Constant( @@ -4525,7 +4525,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2535..2536, custom: (), node: Constant( @@ -4544,18 +4544,18 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 2548..2553, custom: (), node: MatchSequence( PatternMatchSequence { patterns: [ - Located { + Attributed { range: 2548..2549, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 2548..2549, custom: (), node: Constant( @@ -4570,7 +4570,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2551..2553, custom: (), node: MatchStar( @@ -4587,13 +4587,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 2563..2568, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 2563..2564, custom: (), node: Name( @@ -4604,7 +4604,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 2567..2568, custom: (), node: Constant( @@ -4626,18 +4626,18 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2591..2638, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 2597..2606, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 2598..2599, custom: (), node: Constant( @@ -4649,7 +4649,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2601..2602, custom: (), node: Constant( @@ -4661,7 +4661,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2604..2605, custom: (), node: Constant( @@ -4680,13 +4680,13 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 2617..2623, custom: (), node: MatchSequence( PatternMatchSequence { patterns: [ - Located { + Attributed { range: 2617..2619, custom: (), node: MatchStar( @@ -4697,12 +4697,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2621..2622, custom: (), node: MatchValue( PatternMatchValue { - value: Located { + value: Attributed { range: 2621..2622, custom: (), node: Constant( @@ -4723,13 +4723,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 2633..2638, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 2633..2634, custom: (), node: Name( @@ -4740,7 +4740,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 2637..2638, custom: (), node: Constant( @@ -4762,12 +4762,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2661..2697, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 2667..2668, custom: (), node: Name( @@ -4779,13 +4779,13 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 2680..2682, custom: (), node: MatchSequence( PatternMatchSequence { patterns: [ - Located { + Attributed { range: 2680..2681, custom: (), node: MatchAs( @@ -4803,13 +4803,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 2692..2697, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 2692..2693, custom: (), node: Name( @@ -4820,7 +4820,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 2696..2697, custom: (), node: Constant( @@ -4842,18 +4842,18 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2720..2760, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 2720..2760, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 2726..2727, custom: (), node: Name( @@ -4863,7 +4863,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2729..2730, custom: (), node: Name( @@ -4880,13 +4880,13 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 2741..2745, custom: (), node: MatchSequence( PatternMatchSequence { patterns: [ - Located { + Attributed { range: 2741..2742, custom: (), node: MatchAs( @@ -4898,7 +4898,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2744..2745, custom: (), node: MatchAs( @@ -4916,13 +4916,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 2755..2760, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 2755..2756, custom: (), node: Name( @@ -4933,7 +4933,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 2759..2760, custom: (), node: Constant( @@ -4955,17 +4955,17 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 2783..2829, custom: (), node: Match( StmtMatch { - subject: Located { + subject: Attributed { range: 2789..2795, custom: (), node: NamedExpr( ExprNamedExpr { - target: Located { + target: Attributed { range: 2789..2790, custom: (), node: Name( @@ -4975,7 +4975,7 @@ expression: parse_ast }, ), }, - value: Located { + value: Attributed { range: 2794..2795, custom: (), node: Name( @@ -4990,19 +4990,19 @@ expression: parse_ast }, cases: [ MatchCase { - pattern: Located { + pattern: Attributed { range: 2807..2814, custom: (), node: MatchSequence( PatternMatchSequence { patterns: [ - Located { + Attributed { range: 2807..2813, custom: (), node: MatchAs( PatternMatchAs { pattern: Some( - Located { + Attributed { range: 2807..2808, custom: (), node: MatchAs( @@ -5027,13 +5027,13 @@ expression: parse_ast }, guard: None, body: [ - Located { + Attributed { range: 2824..2829, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 2824..2825, custom: (), node: Name( @@ -5044,7 +5044,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 2828..2829, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__slice.snap b/parser/src/snapshots/rustpython_parser__parser__tests__slice.snap index 4e1f114..ce6f280 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__slice.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__slice.snap @@ -2,12 +2,12 @@ source: parser/src/parser.rs expression: parse_ast --- -Located { +Attributed { range: 0..8, custom: (), node: Subscript( ExprSubscript { - value: Located { + value: Attributed { range: 0..1, custom: (), node: Name( @@ -17,13 +17,13 @@ Located { }, ), }, - slice: Located { + slice: Attributed { range: 2..7, custom: (), node: Slice( ExprSlice { lower: Some( - Located { + Attributed { range: 2..3, custom: (), node: Constant( @@ -37,7 +37,7 @@ Located { }, ), upper: Some( - Located { + Attributed { range: 4..5, custom: (), node: Constant( @@ -51,7 +51,7 @@ Located { }, ), step: Some( - Located { + Attributed { range: 6..7, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__star_index.snap b/parser/src/snapshots/rustpython_parser__parser__tests__star_index.snap index 6579c08..ae21ea3 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__star_index.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__star_index.snap @@ -3,13 +3,13 @@ source: parser/src/parser.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..36, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 0..11, custom: (), node: Name( @@ -20,12 +20,12 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 14..36, custom: (), node: Subscript( ExprSubscript { - value: Located { + value: Attributed { range: 14..19, custom: (), node: Name( @@ -35,13 +35,13 @@ expression: parse_ast }, ), }, - slice: Located { + slice: Attributed { range: 20..35, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 20..21, custom: (), node: Constant( @@ -53,12 +53,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 23..31, custom: (), node: Starred( ExprStarred { - value: Located { + value: Attributed { range: 24..31, custom: (), node: Name( @@ -72,13 +72,13 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 33..35, custom: (), node: UnaryOp( ExprUnaryOp { op: USub, - operand: Located { + operand: Attributed { range: 34..35, custom: (), node: Constant( @@ -106,18 +106,18 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 37..73, custom: (), node: Assign( StmtAssign { targets: [ - Located { + Attributed { range: 37..59, custom: (), node: Subscript( ExprSubscript { - value: Located { + value: Attributed { range: 37..42, custom: (), node: Name( @@ -127,13 +127,13 @@ expression: parse_ast }, ), }, - slice: Located { + slice: Attributed { range: 43..58, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 43..44, custom: (), node: Constant( @@ -145,12 +145,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 46..54, custom: (), node: Starred( ExprStarred { - value: Located { + value: Attributed { range: 47..54, custom: (), node: Name( @@ -164,13 +164,13 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 56..58, custom: (), node: UnaryOp( ExprUnaryOp { op: USub, - operand: Located { + operand: Attributed { range: 57..58, custom: (), node: Constant( @@ -195,7 +195,7 @@ expression: parse_ast ), }, ], - value: Located { + value: Attributed { range: 62..73, custom: (), node: Name( @@ -209,17 +209,17 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 74..119, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 74..119, custom: (), node: Subscript( ExprSubscript { - value: Located { + value: Attributed { range: 74..79, custom: (), node: Name( @@ -229,18 +229,18 @@ expression: parse_ast }, ), }, - slice: Located { + slice: Attributed { range: 80..118, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 80..98, custom: (), node: Starred( ExprStarred { - value: Located { + value: Attributed { range: 81..98, custom: (), node: Name( @@ -254,12 +254,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 100..118, custom: (), node: Starred( ExprStarred { - value: Located { + value: Attributed { range: 101..118, custom: (), node: Name( @@ -285,17 +285,17 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 120..150, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 120..150, custom: (), node: Subscript( ExprSubscript { - value: Located { + value: Attributed { range: 120..125, custom: (), node: Name( @@ -305,19 +305,19 @@ expression: parse_ast }, ), }, - slice: Located { + slice: Attributed { range: 126..149, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 126..129, custom: (), node: Slice( ExprSlice { lower: Some( - Located { + Attributed { range: 126..127, custom: (), node: Constant( @@ -331,7 +331,7 @@ expression: parse_ast }, ), upper: Some( - Located { + Attributed { range: 128..129, custom: (), node: Constant( @@ -348,12 +348,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 131..149, custom: (), node: Starred( ExprStarred { - value: Located { + value: Attributed { range: 132..149, custom: (), node: Name( diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__try.snap b/parser/src/snapshots/rustpython_parser__parser__tests__try.snap index befaf44..ff87c80 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__try.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__try.snap @@ -3,24 +3,24 @@ source: parser/src/parser.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..134, custom: (), node: Try( StmtTry { body: [ - Located { + Attributed { range: 9..28, custom: (), node: Raise( StmtRaise { exc: Some( - Located { + Attributed { range: 15..28, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 15..25, custom: (), node: Name( @@ -31,7 +31,7 @@ expression: parse_ast ), }, args: [ - Located { + Attributed { range: 26..27, custom: (), node: Constant( @@ -55,13 +55,13 @@ expression: parse_ast }, ], handlers: [ - Located { + Attributed { range: 29..82, custom: (), node: ExceptHandler( ExcepthandlerExceptHandler { type_: Some( - Located { + Attributed { range: 36..45, custom: (), node: Name( @@ -76,17 +76,17 @@ expression: parse_ast "e", ), body: [ - Located { + Attributed { range: 56..82, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 56..82, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 56..61, custom: (), node: Name( @@ -97,13 +97,13 @@ expression: parse_ast ), }, args: [ - Located { + Attributed { range: 62..81, custom: (), node: JoinedStr( ExprJoinedStr { values: [ - Located { + Attributed { range: 62..81, custom: (), node: Constant( @@ -115,17 +115,17 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 62..81, custom: (), node: FormattedValue( ExprFormattedValue { - value: Located { + value: Attributed { range: 72..79, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 72..76, custom: (), node: Name( @@ -136,7 +136,7 @@ expression: parse_ast ), }, args: [ - Located { + Attributed { range: 77..78, custom: (), node: Name( @@ -172,13 +172,13 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 83..134, custom: (), node: ExceptHandler( ExcepthandlerExceptHandler { type_: Some( - Located { + Attributed { range: 90..97, custom: (), node: Name( @@ -193,17 +193,17 @@ expression: parse_ast "e", ), body: [ - Located { + Attributed { range: 108..134, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 108..134, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 108..113, custom: (), node: Name( @@ -214,13 +214,13 @@ expression: parse_ast ), }, args: [ - Located { + Attributed { range: 114..133, custom: (), node: JoinedStr( ExprJoinedStr { values: [ - Located { + Attributed { range: 114..133, custom: (), node: Constant( @@ -232,17 +232,17 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 114..133, custom: (), node: FormattedValue( ExprFormattedValue { - value: Located { + value: Attributed { range: 124..131, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 124..128, custom: (), node: Name( @@ -253,7 +253,7 @@ expression: parse_ast ), }, args: [ - Located { + Attributed { range: 129..130, custom: (), node: Name( diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__try_star.snap b/parser/src/snapshots/rustpython_parser__parser__tests__try_star.snap index a98c9af..6ea4f9c 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__try_star.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__try_star.snap @@ -3,24 +3,24 @@ source: parser/src/parser.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..260, custom: (), node: TryStar( StmtTryStar { body: [ - Located { + Attributed { range: 9..98, custom: (), node: Raise( StmtRaise { exc: Some( - Located { + Attributed { range: 15..98, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 15..29, custom: (), node: Name( @@ -31,7 +31,7 @@ expression: parse_ast ), }, args: [ - Located { + Attributed { range: 30..34, custom: (), node: Constant( @@ -43,18 +43,18 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 44..97, custom: (), node: List( ExprList { elts: [ - Located { + Attributed { range: 45..58, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 45..55, custom: (), node: Name( @@ -65,7 +65,7 @@ expression: parse_ast ), }, args: [ - Located { + Attributed { range: 56..57, custom: (), node: Constant( @@ -82,12 +82,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 60..72, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 60..69, custom: (), node: Name( @@ -98,7 +98,7 @@ expression: parse_ast ), }, args: [ - Located { + Attributed { range: 70..71, custom: (), node: Constant( @@ -115,12 +115,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 74..84, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 74..81, custom: (), node: Name( @@ -131,7 +131,7 @@ expression: parse_ast ), }, args: [ - Located { + Attributed { range: 82..83, custom: (), node: Constant( @@ -148,12 +148,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 86..96, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 86..93, custom: (), node: Name( @@ -164,7 +164,7 @@ expression: parse_ast ), }, args: [ - Located { + Attributed { range: 94..95, custom: (), node: Constant( @@ -198,13 +198,13 @@ expression: parse_ast }, ], handlers: [ - Located { + Attributed { range: 99..180, custom: (), node: ExceptHandler( ExcepthandlerExceptHandler { type_: Some( - Located { + Attributed { range: 107..116, custom: (), node: Name( @@ -219,17 +219,17 @@ expression: parse_ast "e", ), body: [ - Located { + Attributed { range: 127..180, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 127..180, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 127..132, custom: (), node: Name( @@ -240,13 +240,13 @@ expression: parse_ast ), }, args: [ - Located { + Attributed { range: 133..179, custom: (), node: JoinedStr( ExprJoinedStr { values: [ - Located { + Attributed { range: 133..179, custom: (), node: Constant( @@ -258,17 +258,17 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 133..179, custom: (), node: FormattedValue( ExprFormattedValue { - value: Located { + value: Attributed { range: 143..150, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 143..147, custom: (), node: Name( @@ -279,7 +279,7 @@ expression: parse_ast ), }, args: [ - Located { + Attributed { range: 148..149, custom: (), node: Name( @@ -299,7 +299,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 133..179, custom: (), node: Constant( @@ -311,17 +311,17 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 133..179, custom: (), node: FormattedValue( ExprFormattedValue { - value: Located { + value: Attributed { range: 165..177, custom: (), node: Attribute( ExprAttribute { - value: Located { + value: Attributed { range: 165..166, custom: (), node: Name( @@ -357,13 +357,13 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 181..260, custom: (), node: ExceptHandler( ExcepthandlerExceptHandler { type_: Some( - Located { + Attributed { range: 189..196, custom: (), node: Name( @@ -378,17 +378,17 @@ expression: parse_ast "e", ), body: [ - Located { + Attributed { range: 207..260, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 207..260, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 207..212, custom: (), node: Name( @@ -399,13 +399,13 @@ expression: parse_ast ), }, args: [ - Located { + Attributed { range: 213..259, custom: (), node: JoinedStr( ExprJoinedStr { values: [ - Located { + Attributed { range: 213..259, custom: (), node: Constant( @@ -417,17 +417,17 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 213..259, custom: (), node: FormattedValue( ExprFormattedValue { - value: Located { + value: Attributed { range: 223..230, custom: (), node: Call( ExprCall { - func: Located { + func: Attributed { range: 223..227, custom: (), node: Name( @@ -438,7 +438,7 @@ expression: parse_ast ), }, args: [ - Located { + Attributed { range: 228..229, custom: (), node: Name( @@ -458,7 +458,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 213..259, custom: (), node: Constant( @@ -470,17 +470,17 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 213..259, custom: (), node: FormattedValue( ExprFormattedValue { - value: Located { + value: Attributed { range: 245..257, custom: (), node: Attribute( ExprAttribute { - value: Located { + value: Attributed { range: 245..246, custom: (), node: Name( diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__variadic_generics.snap b/parser/src/snapshots/rustpython_parser__parser__tests__variadic_generics.snap index 5825248..269aba5 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__variadic_generics.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__variadic_generics.snap @@ -3,7 +3,7 @@ source: parser/src/parser.rs expression: parse_ast --- [ - Located { + Attributed { range: 1..49, custom: (), node: FunctionDef( @@ -13,18 +13,18 @@ expression: parse_ast posonlyargs: [], args: [], vararg: Some( - Located { + Attributed { range: 20..29, custom: (), node: ArgData { arg: "args", annotation: Some( - Located { + Attributed { range: 26..29, custom: (), node: Starred( ExprStarred { - value: Located { + value: Attributed { range: 27..29, custom: (), node: Name( @@ -49,12 +49,12 @@ expression: parse_ast defaults: [], }, body: [ - Located { + Attributed { range: 46..49, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 46..49, custom: (), node: Constant( @@ -70,12 +70,12 @@ expression: parse_ast ], decorator_list: [], returns: Some( - Located { + Attributed { range: 34..44, custom: (), node: Subscript( ExprSubscript { - value: Located { + value: Attributed { range: 34..39, custom: (), node: Name( @@ -85,12 +85,12 @@ expression: parse_ast }, ), }, - slice: Located { + slice: Attributed { range: 40..43, custom: (), node: Starred( ExprStarred { - value: Located { + value: Attributed { range: 41..43, custom: (), node: Name( diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__with_statement.snap b/parser/src/snapshots/rustpython_parser__parser__tests__with_statement.snap index 5065d7b..dfc5f9b 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__with_statement.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__with_statement.snap @@ -3,14 +3,14 @@ source: parser/src/parser.rs expression: "parse_program(source, \"\").unwrap()" --- [ - Located { + Attributed { range: 0..12, custom: (), node: With( StmtWith { items: [ Withitem { - context_expr: Located { + context_expr: Attributed { range: 5..6, custom: (), node: Constant( @@ -26,7 +26,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ], body: [ - Located { + Attributed { range: 8..12, custom: (), node: Pass, @@ -36,14 +36,14 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 13..30, custom: (), node: With( StmtWith { items: [ Withitem { - context_expr: Located { + context_expr: Attributed { range: 18..19, custom: (), node: Constant( @@ -56,7 +56,7 @@ expression: "parse_program(source, \"\").unwrap()" ), }, optional_vars: Some( - Located { + Attributed { range: 23..24, custom: (), node: Name( @@ -70,7 +70,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ], body: [ - Located { + Attributed { range: 26..30, custom: (), node: Pass, @@ -80,14 +80,14 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 31..46, custom: (), node: With( StmtWith { items: [ Withitem { - context_expr: Located { + context_expr: Attributed { range: 36..37, custom: (), node: Constant( @@ -102,7 +102,7 @@ expression: "parse_program(source, \"\").unwrap()" optional_vars: None, }, Withitem { - context_expr: Located { + context_expr: Attributed { range: 39..40, custom: (), node: Constant( @@ -118,7 +118,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ], body: [ - Located { + Attributed { range: 42..46, custom: (), node: Pass, @@ -128,14 +128,14 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 47..72, custom: (), node: With( StmtWith { items: [ Withitem { - context_expr: Located { + context_expr: Attributed { range: 52..53, custom: (), node: Constant( @@ -148,7 +148,7 @@ expression: "parse_program(source, \"\").unwrap()" ), }, optional_vars: Some( - Located { + Attributed { range: 57..58, custom: (), node: Name( @@ -161,7 +161,7 @@ expression: "parse_program(source, \"\").unwrap()" ), }, Withitem { - context_expr: Located { + context_expr: Attributed { range: 60..61, custom: (), node: Constant( @@ -174,7 +174,7 @@ expression: "parse_program(source, \"\").unwrap()" ), }, optional_vars: Some( - Located { + Attributed { range: 65..66, custom: (), node: Name( @@ -188,7 +188,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ], body: [ - Located { + Attributed { range: 68..72, custom: (), node: Pass, @@ -198,19 +198,19 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 73..97, custom: (), node: With( StmtWith { items: [ Withitem { - context_expr: Located { + context_expr: Attributed { range: 78..91, custom: (), node: IfExp( ExprIfExp { - test: Located { + test: Attributed { range: 83..84, custom: (), node: Constant( @@ -222,7 +222,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - body: Located { + body: Attributed { range: 78..79, custom: (), node: Constant( @@ -234,7 +234,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - orelse: Located { + orelse: Attributed { range: 90..91, custom: (), node: Constant( @@ -253,7 +253,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ], body: [ - Located { + Attributed { range: 93..97, custom: (), node: Pass, @@ -263,19 +263,19 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 98..127, custom: (), node: With( StmtWith { items: [ Withitem { - context_expr: Located { + context_expr: Attributed { range: 103..116, custom: (), node: IfExp( ExprIfExp { - test: Located { + test: Attributed { range: 108..109, custom: (), node: Constant( @@ -287,7 +287,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - body: Located { + body: Attributed { range: 103..104, custom: (), node: Constant( @@ -299,7 +299,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - orelse: Located { + orelse: Attributed { range: 115..116, custom: (), node: Constant( @@ -315,7 +315,7 @@ expression: "parse_program(source, \"\").unwrap()" ), }, optional_vars: Some( - Located { + Attributed { range: 120..121, custom: (), node: Name( @@ -329,7 +329,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ], body: [ - Located { + Attributed { range: 123..127, custom: (), node: Pass, @@ -339,14 +339,14 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 128..141, custom: (), node: With( StmtWith { items: [ Withitem { - context_expr: Located { + context_expr: Attributed { range: 133..135, custom: (), node: Tuple( @@ -360,7 +360,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ], body: [ - Located { + Attributed { range: 137..141, custom: (), node: Pass, @@ -370,14 +370,14 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 142..160, custom: (), node: With( StmtWith { items: [ Withitem { - context_expr: Located { + context_expr: Attributed { range: 147..149, custom: (), node: Tuple( @@ -388,7 +388,7 @@ expression: "parse_program(source, \"\").unwrap()" ), }, optional_vars: Some( - Located { + Attributed { range: 153..154, custom: (), node: Name( @@ -402,7 +402,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ], body: [ - Located { + Attributed { range: 156..160, custom: (), node: Pass, @@ -412,14 +412,14 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 161..175, custom: (), node: With( StmtWith { items: [ Withitem { - context_expr: Located { + context_expr: Attributed { range: 167..168, custom: (), node: Constant( @@ -435,7 +435,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ], body: [ - Located { + Attributed { range: 171..175, custom: (), node: Pass, @@ -445,14 +445,14 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 176..195, custom: (), node: With( StmtWith { items: [ Withitem { - context_expr: Located { + context_expr: Attributed { range: 182..183, custom: (), node: Constant( @@ -465,7 +465,7 @@ expression: "parse_program(source, \"\").unwrap()" ), }, optional_vars: Some( - Located { + Attributed { range: 188..189, custom: (), node: Name( @@ -479,7 +479,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ], body: [ - Located { + Attributed { range: 191..195, custom: (), node: Pass, @@ -489,14 +489,14 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 196..211, custom: (), node: With( StmtWith { items: [ Withitem { - context_expr: Located { + context_expr: Attributed { range: 202..203, custom: (), node: Constant( @@ -512,7 +512,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ], body: [ - Located { + Attributed { range: 207..211, custom: (), node: Pass, @@ -522,20 +522,20 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 212..232, custom: (), node: With( StmtWith { items: [ Withitem { - context_expr: Located { + context_expr: Attributed { range: 217..221, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 218..219, custom: (), node: Constant( @@ -553,7 +553,7 @@ expression: "parse_program(source, \"\").unwrap()" ), }, optional_vars: Some( - Located { + Attributed { range: 225..226, custom: (), node: Name( @@ -567,7 +567,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ], body: [ - Located { + Attributed { range: 228..232, custom: (), node: Pass, @@ -577,14 +577,14 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 233..250, custom: (), node: With( StmtWith { items: [ Withitem { - context_expr: Located { + context_expr: Attributed { range: 239..240, custom: (), node: Constant( @@ -599,7 +599,7 @@ expression: "parse_program(source, \"\").unwrap()" optional_vars: None, }, Withitem { - context_expr: Located { + context_expr: Attributed { range: 242..243, custom: (), node: Constant( @@ -615,7 +615,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ], body: [ - Located { + Attributed { range: 246..250, custom: (), node: Pass, @@ -625,20 +625,20 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 251..273, custom: (), node: With( StmtWith { items: [ Withitem { - context_expr: Located { + context_expr: Attributed { range: 256..262, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 257..258, custom: (), node: Constant( @@ -650,7 +650,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 260..261, custom: (), node: Constant( @@ -668,7 +668,7 @@ expression: "parse_program(source, \"\").unwrap()" ), }, optional_vars: Some( - Located { + Attributed { range: 266..267, custom: (), node: Name( @@ -682,7 +682,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ], body: [ - Located { + Attributed { range: 269..273, custom: (), node: Pass, @@ -692,25 +692,25 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 274..290, custom: (), node: With( StmtWith { items: [ Withitem { - context_expr: Located { + context_expr: Attributed { range: 279..284, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 280..282, custom: (), node: Starred( ExprStarred { - value: Located { + value: Attributed { range: 281..282, custom: (), node: Name( @@ -733,7 +733,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ], body: [ - Located { + Attributed { range: 286..290, custom: (), node: Pass, @@ -743,25 +743,25 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 291..312, custom: (), node: With( StmtWith { items: [ Withitem { - context_expr: Located { + context_expr: Attributed { range: 296..301, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 297..299, custom: (), node: Starred( ExprStarred { - value: Located { + value: Attributed { range: 298..299, custom: (), node: Name( @@ -781,7 +781,7 @@ expression: "parse_program(source, \"\").unwrap()" ), }, optional_vars: Some( - Located { + Attributed { range: 305..306, custom: (), node: Name( @@ -795,7 +795,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ], body: [ - Located { + Attributed { range: 308..312, custom: (), node: Pass, @@ -805,20 +805,20 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 313..331, custom: (), node: With( StmtWith { items: [ Withitem { - context_expr: Located { + context_expr: Attributed { range: 318..325, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 319..320, custom: (), node: Constant( @@ -830,12 +830,12 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 322..324, custom: (), node: Starred( ExprStarred { - value: Located { + value: Attributed { range: 323..324, custom: (), node: Name( @@ -858,7 +858,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ], body: [ - Located { + Attributed { range: 327..331, custom: (), node: Pass, @@ -868,20 +868,20 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 332..355, custom: (), node: With( StmtWith { items: [ Withitem { - context_expr: Located { + context_expr: Attributed { range: 337..344, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 338..339, custom: (), node: Constant( @@ -893,12 +893,12 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 341..343, custom: (), node: Starred( ExprStarred { - value: Located { + value: Attributed { range: 342..343, custom: (), node: Name( @@ -918,7 +918,7 @@ expression: "parse_program(source, \"\").unwrap()" ), }, optional_vars: Some( - Located { + Attributed { range: 348..349, custom: (), node: Name( @@ -932,7 +932,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ], body: [ - Located { + Attributed { range: 351..355, custom: (), node: Pass, @@ -942,19 +942,19 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 356..375, custom: (), node: With( StmtWith { items: [ Withitem { - context_expr: Located { + context_expr: Attributed { range: 362..368, custom: (), node: NamedExpr( ExprNamedExpr { - target: Located { + target: Attributed { range: 362..363, custom: (), node: Name( @@ -964,7 +964,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - value: Located { + value: Attributed { range: 367..368, custom: (), node: Constant( @@ -983,7 +983,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ], body: [ - Located { + Attributed { range: 371..375, custom: (), node: Pass, @@ -993,19 +993,19 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 376..400, custom: (), node: With( StmtWith { items: [ Withitem { - context_expr: Located { + context_expr: Attributed { range: 382..388, custom: (), node: NamedExpr( ExprNamedExpr { - target: Located { + target: Attributed { range: 382..383, custom: (), node: Name( @@ -1015,7 +1015,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - value: Located { + value: Attributed { range: 387..388, custom: (), node: Constant( @@ -1031,7 +1031,7 @@ expression: "parse_program(source, \"\").unwrap()" ), }, optional_vars: Some( - Located { + Attributed { range: 393..394, custom: (), node: Name( @@ -1045,7 +1045,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ], body: [ - Located { + Attributed { range: 396..400, custom: (), node: Pass, @@ -1055,25 +1055,25 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 401..428, custom: (), node: With( StmtWith { items: [ Withitem { - context_expr: Located { + context_expr: Attributed { range: 406..422, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 407..413, custom: (), node: NamedExpr( ExprNamedExpr { - target: Located { + target: Attributed { range: 407..408, custom: (), node: Name( @@ -1083,7 +1083,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - value: Located { + value: Attributed { range: 412..413, custom: (), node: Constant( @@ -1098,12 +1098,12 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 415..421, custom: (), node: NamedExpr( ExprNamedExpr { - target: Located { + target: Attributed { range: 415..416, custom: (), node: Name( @@ -1113,7 +1113,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - value: Located { + value: Attributed { range: 420..421, custom: (), node: Constant( @@ -1137,7 +1137,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ], body: [ - Located { + Attributed { range: 424..428, custom: (), node: Pass, @@ -1147,25 +1147,25 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 429..461, custom: (), node: With( StmtWith { items: [ Withitem { - context_expr: Located { + context_expr: Attributed { range: 434..450, custom: (), node: Tuple( ExprTuple { elts: [ - Located { + Attributed { range: 435..441, custom: (), node: NamedExpr( ExprNamedExpr { - target: Located { + target: Attributed { range: 435..436, custom: (), node: Name( @@ -1175,7 +1175,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - value: Located { + value: Attributed { range: 440..441, custom: (), node: Constant( @@ -1190,12 +1190,12 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 443..449, custom: (), node: NamedExpr( ExprNamedExpr { - target: Located { + target: Attributed { range: 443..444, custom: (), node: Name( @@ -1205,7 +1205,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - value: Located { + value: Attributed { range: 448..449, custom: (), node: Constant( @@ -1226,7 +1226,7 @@ expression: "parse_program(source, \"\").unwrap()" ), }, optional_vars: Some( - Located { + Attributed { range: 454..455, custom: (), node: Name( @@ -1240,7 +1240,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ], body: [ - Located { + Attributed { range: 457..461, custom: (), node: Pass, @@ -1250,14 +1250,14 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 462..481, custom: (), node: With( StmtWith { items: [ Withitem { - context_expr: Located { + context_expr: Attributed { range: 468..469, custom: (), node: Constant( @@ -1270,7 +1270,7 @@ expression: "parse_program(source, \"\").unwrap()" ), }, optional_vars: Some( - Located { + Attributed { range: 473..474, custom: (), node: Name( @@ -1284,7 +1284,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ], body: [ - Located { + Attributed { range: 477..481, custom: (), node: Pass, @@ -1294,14 +1294,14 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 482..502, custom: (), node: With( StmtWith { items: [ Withitem { - context_expr: Located { + context_expr: Attributed { range: 488..489, custom: (), node: Constant( @@ -1314,7 +1314,7 @@ expression: "parse_program(source, \"\").unwrap()" ), }, optional_vars: Some( - Located { + Attributed { range: 493..494, custom: (), node: Name( @@ -1328,7 +1328,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ], body: [ - Located { + Attributed { range: 498..502, custom: (), node: Pass, @@ -1338,14 +1338,14 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 503..530, custom: (), node: With( StmtWith { items: [ Withitem { - context_expr: Located { + context_expr: Attributed { range: 509..510, custom: (), node: Constant( @@ -1358,7 +1358,7 @@ expression: "parse_program(source, \"\").unwrap()" ), }, optional_vars: Some( - Located { + Attributed { range: 514..515, custom: (), node: Name( @@ -1371,7 +1371,7 @@ expression: "parse_program(source, \"\").unwrap()" ), }, Withitem { - context_expr: Located { + context_expr: Attributed { range: 517..518, custom: (), node: Constant( @@ -1384,7 +1384,7 @@ expression: "parse_program(source, \"\").unwrap()" ), }, optional_vars: Some( - Located { + Attributed { range: 522..523, custom: (), node: Name( @@ -1398,7 +1398,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ], body: [ - Located { + Attributed { range: 526..530, custom: (), node: Pass, @@ -1408,14 +1408,14 @@ expression: "parse_program(source, \"\").unwrap()" }, ), }, - Located { + Attributed { range: 531..559, custom: (), node: With( StmtWith { items: [ Withitem { - context_expr: Located { + context_expr: Attributed { range: 537..538, custom: (), node: Constant( @@ -1428,7 +1428,7 @@ expression: "parse_program(source, \"\").unwrap()" ), }, optional_vars: Some( - Located { + Attributed { range: 542..543, custom: (), node: Name( @@ -1441,7 +1441,7 @@ expression: "parse_program(source, \"\").unwrap()" ), }, Withitem { - context_expr: Located { + context_expr: Attributed { range: 545..546, custom: (), node: Constant( @@ -1454,7 +1454,7 @@ expression: "parse_program(source, \"\").unwrap()" ), }, optional_vars: Some( - Located { + Attributed { range: 550..551, custom: (), node: Name( @@ -1468,7 +1468,7 @@ expression: "parse_program(source, \"\").unwrap()" }, ], body: [ - Located { + Attributed { range: 555..559, custom: (), node: Pass, diff --git a/parser/src/snapshots/rustpython_parser__string__tests__backspace_alias.snap b/parser/src/snapshots/rustpython_parser__string__tests__backspace_alias.snap index 08aa32d..c84bc9e 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__backspace_alias.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__backspace_alias.snap @@ -3,12 +3,12 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..15, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..15, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__bell_alias.snap b/parser/src/snapshots/rustpython_parser__string__tests__bell_alias.snap index 969367a..4595971 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__bell_alias.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__bell_alias.snap @@ -3,12 +3,12 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..9, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..9, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__carriage_return_alias.snap b/parser/src/snapshots/rustpython_parser__string__tests__carriage_return_alias.snap index f765d00..270ad75 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__carriage_return_alias.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__carriage_return_alias.snap @@ -3,12 +3,12 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..21, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..21, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__character_tabulation_with_justification_alias.snap b/parser/src/snapshots/rustpython_parser__string__tests__character_tabulation_with_justification_alias.snap index bcf4db7..de8d1f2 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__character_tabulation_with_justification_alias.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__character_tabulation_with_justification_alias.snap @@ -3,12 +3,12 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..45, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..45, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__delete_alias.snap b/parser/src/snapshots/rustpython_parser__string__tests__delete_alias.snap index 4980472..2ce4fee 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__delete_alias.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__delete_alias.snap @@ -3,12 +3,12 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..12, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..12, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__double_quoted_byte.snap b/parser/src/snapshots/rustpython_parser__string__tests__double_quoted_byte.snap index da67086..edac5d0 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__double_quoted_byte.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__double_quoted_byte.snap @@ -3,12 +3,12 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..738, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..738, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__escape_alias.snap b/parser/src/snapshots/rustpython_parser__string__tests__escape_alias.snap index 1b3f561..f487e47 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__escape_alias.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__escape_alias.snap @@ -3,12 +3,12 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..12, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..12, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__escape_char_in_byte_literal.snap b/parser/src/snapshots/rustpython_parser__string__tests__escape_char_in_byte_literal.snap index 2af28ee..45ca76e 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__escape_char_in_byte_literal.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__escape_char_in_byte_literal.snap @@ -3,12 +3,12 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..13, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..13, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__escape_octet.snap b/parser/src/snapshots/rustpython_parser__string__tests__escape_octet.snap index 36137fa..c179502 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__escape_octet.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__escape_octet.snap @@ -3,12 +3,12 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..14, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..14, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__form_feed_alias.snap b/parser/src/snapshots/rustpython_parser__string__tests__form_feed_alias.snap index 43cb809..09ea934 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__form_feed_alias.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__form_feed_alias.snap @@ -3,12 +3,12 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..15, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..15, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__fstring_escaped_character.snap b/parser/src/snapshots/rustpython_parser__string__tests__fstring_escaped_character.snap index 622c6ba..dc7dd35 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__fstring_escaped_character.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__fstring_escaped_character.snap @@ -3,18 +3,18 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..8, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..8, custom: (), node: JoinedStr( ExprJoinedStr { values: [ - Located { + Attributed { range: 0..8, custom: (), node: Constant( @@ -26,12 +26,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 0..8, custom: (), node: FormattedValue( ExprFormattedValue { - value: Located { + value: Attributed { range: 5..6, custom: (), node: Name( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__fstring_escaped_newline.snap b/parser/src/snapshots/rustpython_parser__string__tests__fstring_escaped_newline.snap index 553a3e5..f3494f7 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__fstring_escaped_newline.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__fstring_escaped_newline.snap @@ -3,18 +3,18 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..8, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..8, custom: (), node: JoinedStr( ExprJoinedStr { values: [ - Located { + Attributed { range: 0..8, custom: (), node: Constant( @@ -26,12 +26,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 0..8, custom: (), node: FormattedValue( ExprFormattedValue { - value: Located { + value: Attributed { range: 5..6, custom: (), node: Name( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__fstring_line_continuation.snap b/parser/src/snapshots/rustpython_parser__string__tests__fstring_line_continuation.snap index 4d05ada..187e78d 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__fstring_line_continuation.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__fstring_line_continuation.snap @@ -3,18 +3,18 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..9, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..9, custom: (), node: JoinedStr( ExprJoinedStr { values: [ - Located { + Attributed { range: 0..9, custom: (), node: Constant( @@ -26,12 +26,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 0..9, custom: (), node: FormattedValue( ExprFormattedValue { - value: Located { + value: Attributed { range: 6..7, custom: (), node: Name( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__fstring_parse_self_documenting_base.snap b/parser/src/snapshots/rustpython_parser__string__tests__fstring_parse_self_documenting_base.snap index 12772b1..44ee880 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__fstring_parse_self_documenting_base.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__fstring_parse_self_documenting_base.snap @@ -3,7 +3,7 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..10, custom: (), node: Constant( @@ -15,7 +15,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 0..10, custom: (), node: Constant( @@ -27,12 +27,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 0..10, custom: (), node: FormattedValue( ExprFormattedValue { - value: Located { + value: Attributed { range: 3..7, custom: (), node: Name( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__fstring_parse_self_documenting_base_more.snap b/parser/src/snapshots/rustpython_parser__string__tests__fstring_parse_self_documenting_base_more.snap index ec1f2c8..5c60f69 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__fstring_parse_self_documenting_base_more.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__fstring_parse_self_documenting_base_more.snap @@ -3,7 +3,7 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..38, custom: (), node: Constant( @@ -15,7 +15,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 0..38, custom: (), node: Constant( @@ -27,7 +27,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 0..38, custom: (), node: Constant( @@ -39,12 +39,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 0..38, custom: (), node: FormattedValue( ExprFormattedValue { - value: Located { + value: Attributed { range: 7..11, custom: (), node: Name( @@ -59,7 +59,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 0..38, custom: (), node: Constant( @@ -71,7 +71,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 0..38, custom: (), node: Constant( @@ -83,7 +83,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 0..38, custom: (), node: Constant( @@ -95,12 +95,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 0..38, custom: (), node: FormattedValue( ExprFormattedValue { - value: Located { + value: Attributed { range: 29..35, custom: (), node: Name( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__fstring_parse_self_documenting_format.snap b/parser/src/snapshots/rustpython_parser__string__tests__fstring_parse_self_documenting_format.snap index d9525b5..7734907 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__fstring_parse_self_documenting_format.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__fstring_parse_self_documenting_format.snap @@ -3,7 +3,7 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..14, custom: (), node: Constant( @@ -15,7 +15,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 0..14, custom: (), node: Constant( @@ -27,12 +27,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 0..14, custom: (), node: FormattedValue( ExprFormattedValue { - value: Located { + value: Attributed { range: 3..7, custom: (), node: Name( @@ -44,13 +44,13 @@ expression: parse_ast }, conversion: 0, format_spec: Some( - Located { + Attributed { range: 0..14, custom: (), node: JoinedStr( ExprJoinedStr { values: [ - Located { + Attributed { range: 0..14, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__fstring_unescaped_newline.snap b/parser/src/snapshots/rustpython_parser__string__tests__fstring_unescaped_newline.snap index 357da38..04172b0 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__fstring_unescaped_newline.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__fstring_unescaped_newline.snap @@ -3,18 +3,18 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..11, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..11, custom: (), node: JoinedStr( ExprJoinedStr { values: [ - Located { + Attributed { range: 0..11, custom: (), node: Constant( @@ -26,12 +26,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 0..11, custom: (), node: FormattedValue( ExprFormattedValue { - value: Located { + value: Attributed { range: 6..7, custom: (), node: Name( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__hts_alias.snap b/parser/src/snapshots/rustpython_parser__string__tests__hts_alias.snap index 3787693..fc8f2f8 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__hts_alias.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__hts_alias.snap @@ -3,12 +3,12 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..9, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..9, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__parse_f_string_concat_1.snap b/parser/src/snapshots/rustpython_parser__string__tests__parse_f_string_concat_1.snap index 0c1e9c5..fe65976 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__parse_f_string_concat_1.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__parse_f_string_concat_1.snap @@ -3,18 +3,18 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..17, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..17, custom: (), node: JoinedStr( ExprJoinedStr { values: [ - Located { + Attributed { range: 0..17, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__parse_f_string_concat_2.snap b/parser/src/snapshots/rustpython_parser__string__tests__parse_f_string_concat_2.snap index 0c1e9c5..fe65976 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__parse_f_string_concat_2.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__parse_f_string_concat_2.snap @@ -3,18 +3,18 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..17, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..17, custom: (), node: JoinedStr( ExprJoinedStr { values: [ - Located { + Attributed { range: 0..17, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__parse_f_string_concat_3.snap b/parser/src/snapshots/rustpython_parser__string__tests__parse_f_string_concat_3.snap index 2c6c069..d27c8c7 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__parse_f_string_concat_3.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__parse_f_string_concat_3.snap @@ -3,18 +3,18 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..22, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..22, custom: (), node: JoinedStr( ExprJoinedStr { values: [ - Located { + Attributed { range: 0..22, custom: (), node: Constant( @@ -26,12 +26,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 9..22, custom: (), node: FormattedValue( ExprFormattedValue { - value: Located { + value: Attributed { range: 17..20, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring.snap b/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring.snap index a18e34e..c54b30d 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring.snap @@ -3,12 +3,12 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..18, custom: (), node: FormattedValue( ExprFormattedValue { - value: Located { + value: Attributed { range: 3..4, custom: (), node: Name( @@ -23,12 +23,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 0..18, custom: (), node: FormattedValue( ExprFormattedValue { - value: Located { + value: Attributed { range: 7..8, custom: (), node: Name( @@ -43,7 +43,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 0..18, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring_equals.snap b/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring_equals.snap index 9fcc119..6626d28 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring_equals.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring_equals.snap @@ -3,17 +3,17 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..13, custom: (), node: FormattedValue( ExprFormattedValue { - value: Located { + value: Attributed { range: 3..11, custom: (), node: Compare( ExprCompare { - left: Located { + left: Attributed { range: 3..5, custom: (), node: Constant( @@ -29,7 +29,7 @@ expression: parse_ast Eq, ], comparators: [ - Located { + Attributed { range: 9..11, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring_nested_spec.snap b/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring_nested_spec.snap index b34dcde..ad55a00 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring_nested_spec.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring_nested_spec.snap @@ -3,12 +3,12 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..15, custom: (), node: FormattedValue( ExprFormattedValue { - value: Located { + value: Attributed { range: 3..6, custom: (), node: Name( @@ -20,18 +20,18 @@ expression: parse_ast }, conversion: 0, format_spec: Some( - Located { + Attributed { range: 0..15, custom: (), node: JoinedStr( ExprJoinedStr { values: [ - Located { + Attributed { range: 0..15, custom: (), node: FormattedValue( ExprFormattedValue { - value: Located { + value: Attributed { range: 8..12, custom: (), node: Name( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring_not_equals.snap b/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring_not_equals.snap index 6bcd053..b9142ac 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring_not_equals.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring_not_equals.snap @@ -3,17 +3,17 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..11, custom: (), node: FormattedValue( ExprFormattedValue { - value: Located { + value: Attributed { range: 3..9, custom: (), node: Compare( ExprCompare { - left: Located { + left: Attributed { range: 3..4, custom: (), node: Constant( @@ -29,7 +29,7 @@ expression: parse_ast NotEq, ], comparators: [ - Located { + Attributed { range: 8..9, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring_not_nested_spec.snap b/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring_not_nested_spec.snap index b65d285..7867a6d 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring_not_nested_spec.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring_not_nested_spec.snap @@ -3,12 +3,12 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..13, custom: (), node: FormattedValue( ExprFormattedValue { - value: Located { + value: Attributed { range: 3..6, custom: (), node: Name( @@ -20,13 +20,13 @@ expression: parse_ast }, conversion: 0, format_spec: Some( - Located { + Attributed { range: 0..13, custom: (), node: JoinedStr( ExprJoinedStr { values: [ - Located { + Attributed { range: 0..13, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring_self_doc_prec_space.snap b/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring_self_doc_prec_space.snap index 9e96515..7fecede 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring_self_doc_prec_space.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring_self_doc_prec_space.snap @@ -3,7 +3,7 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..10, custom: (), node: Constant( @@ -15,7 +15,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 0..10, custom: (), node: Constant( @@ -27,12 +27,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 0..10, custom: (), node: FormattedValue( ExprFormattedValue { - value: Located { + value: Attributed { range: 3..4, custom: (), node: Name( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring_self_doc_trailing_space.snap b/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring_self_doc_trailing_space.snap index e89cd60..7cf2062 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring_self_doc_trailing_space.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring_self_doc_trailing_space.snap @@ -3,7 +3,7 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..10, custom: (), node: Constant( @@ -15,7 +15,7 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 0..10, custom: (), node: Constant( @@ -27,12 +27,12 @@ expression: parse_ast }, ), }, - Located { + Attributed { range: 0..10, custom: (), node: FormattedValue( ExprFormattedValue { - value: Located { + value: Attributed { range: 3..4, custom: (), node: Name( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring_yield_expr.snap b/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring_yield_expr.snap index bddce35..864dd81 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring_yield_expr.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__parse_fstring_yield_expr.snap @@ -3,12 +3,12 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..10, custom: (), node: FormattedValue( ExprFormattedValue { - value: Located { + value: Attributed { range: 3..8, custom: (), node: Yield( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__parse_string_concat.snap b/parser/src/snapshots/rustpython_parser__string__tests__parse_string_concat.snap index bd42260..3826a28 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__parse_string_concat.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__parse_string_concat.snap @@ -3,12 +3,12 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..16, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..16, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__parse_string_triple_quotes_with_kind.snap b/parser/src/snapshots/rustpython_parser__string__tests__parse_string_triple_quotes_with_kind.snap index d576628..5fb8e0c 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__parse_string_triple_quotes_with_kind.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__parse_string_triple_quotes_with_kind.snap @@ -3,12 +3,12 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..20, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..20, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__parse_u_f_string_concat_1.snap b/parser/src/snapshots/rustpython_parser__string__tests__parse_u_f_string_concat_1.snap index ab4f1c8..69f7c86 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__parse_u_f_string_concat_1.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__parse_u_f_string_concat_1.snap @@ -3,18 +3,18 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..18, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..18, custom: (), node: JoinedStr( ExprJoinedStr { values: [ - Located { + Attributed { range: 0..18, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__parse_u_f_string_concat_2.snap b/parser/src/snapshots/rustpython_parser__string__tests__parse_u_f_string_concat_2.snap index 1d83de3..434bc75 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__parse_u_f_string_concat_2.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__parse_u_f_string_concat_2.snap @@ -3,18 +3,18 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..22, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..22, custom: (), node: JoinedStr( ExprJoinedStr { values: [ - Located { + Attributed { range: 0..22, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__parse_u_string_concat_1.snap b/parser/src/snapshots/rustpython_parser__string__tests__parse_u_string_concat_1.snap index 534eab5..c9a9a25 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__parse_u_string_concat_1.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__parse_u_string_concat_1.snap @@ -3,12 +3,12 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..17, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..17, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__parse_u_string_concat_2.snap b/parser/src/snapshots/rustpython_parser__string__tests__parse_u_string_concat_2.snap index 01bb713..2355467 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__parse_u_string_concat_2.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__parse_u_string_concat_2.snap @@ -3,12 +3,12 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..17, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..17, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__raw_byte_literal_1.snap b/parser/src/snapshots/rustpython_parser__string__tests__raw_byte_literal_1.snap index 0125cb3..7e7234a 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__raw_byte_literal_1.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__raw_byte_literal_1.snap @@ -3,12 +3,12 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..8, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..8, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__raw_byte_literal_2.snap b/parser/src/snapshots/rustpython_parser__string__tests__raw_byte_literal_2.snap index bfb3892..09c7f7c 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__raw_byte_literal_2.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__raw_byte_literal_2.snap @@ -3,12 +3,12 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..6, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..6, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__raw_fstring.snap b/parser/src/snapshots/rustpython_parser__string__tests__raw_fstring.snap index f8a9555..7dfffbf 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__raw_fstring.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__raw_fstring.snap @@ -3,23 +3,23 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..7, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..7, custom: (), node: JoinedStr( ExprJoinedStr { values: [ - Located { + Attributed { range: 0..7, custom: (), node: FormattedValue( ExprFormattedValue { - value: Located { + value: Attributed { range: 4..5, custom: (), node: Name( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__single_quoted_byte.snap b/parser/src/snapshots/rustpython_parser__string__tests__single_quoted_byte.snap index da67086..edac5d0 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__single_quoted_byte.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__single_quoted_byte.snap @@ -3,12 +3,12 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..738, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..738, custom: (), node: Constant( diff --git a/parser/src/snapshots/rustpython_parser__string__tests__triple_quoted_raw_fstring.snap b/parser/src/snapshots/rustpython_parser__string__tests__triple_quoted_raw_fstring.snap index d3de827..19147e0 100644 --- a/parser/src/snapshots/rustpython_parser__string__tests__triple_quoted_raw_fstring.snap +++ b/parser/src/snapshots/rustpython_parser__string__tests__triple_quoted_raw_fstring.snap @@ -3,23 +3,23 @@ source: parser/src/string.rs expression: parse_ast --- [ - Located { + Attributed { range: 0..11, custom: (), node: Expr( StmtExpr { - value: Located { + value: Attributed { range: 0..11, custom: (), node: JoinedStr( ExprJoinedStr { values: [ - Located { + Attributed { range: 0..11, custom: (), node: FormattedValue( ExprFormattedValue { - value: Located { + value: Attributed { range: 6..7, custom: (), node: Name( diff --git a/scripts/update_asdl.sh b/scripts/update_asdl.sh index 841735e..d912a72 100755 --- a/scripts/update_asdl.sh +++ b/scripts/update_asdl.sh @@ -3,5 +3,5 @@ set -e cd "$(dirname "$(dirname "$0")")" -python ast/asdl_rs.py --generic-file ast/src/generic.rs --located-file ast/src/located.rs --module-file ../RustPython/vm/src/stdlib/ast/gen.rs ast/Python.asdl -rustfmt ast/src/generic.rs ast/src/located.rs ../RustPython/vm/src/stdlib/ast/gen.rs +python ast/asdl_rs.py --generic-file ast/src/gen/generic.rs --located-file ast/src/gen/located.rs --module-file ../RustPython/vm/src/stdlib/ast/gen.rs ast/Python.asdl +rustfmt ast/src/gen/generic.rs ast/src/gen/located.rs ../RustPython/vm/src/stdlib/ast/gen.rs