Adapt SourceLocation

This commit is contained in:
Jeong YunWon 2023-05-09 18:30:35 +09:00
parent a14e43e03a
commit 09a6afdd04
117 changed files with 1606 additions and 1676 deletions

View file

@ -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

View file

@ -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<T> = super::generic::Attributed<T, LocationRange>;
pub type Located<T> = super::generic::Attributed<T, SourceRange>;
"""
)
)
for info in typeinfo.values():
if info.has_userdata:
generics = "::<LocationRange>"
generics = "::<SourceRange>"
else:
generics = ""
f.write(

View file

@ -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<T, U = ()> {
@ -53,16 +51,16 @@ impl<T> Attributed<T, ()> {
}
}
impl<T> Attributed<T, LocationRange> {
impl<T> Attributed<T, SourceRange> {
/// 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<SourceLocation> {
self.custom.end
}
}

View file

@ -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;

95
ast/src/gen/located.rs Normal file
View file

@ -0,0 +1,95 @@
// File automatically generated by ast/asdl_rs.py.
use crate::location::SourceRange;
pub type Located<T> = super::generic::Attributed<T, SourceRange>;
pub type Mod = super::generic::Mod<SourceRange>;
pub type ModModule = super::generic::ModModule<SourceRange>;
pub type ModInteractive = super::generic::ModInteractive<SourceRange>;
pub type ModExpression = super::generic::ModExpression<SourceRange>;
pub type ModFunctionType = super::generic::ModFunctionType<SourceRange>;
pub type Stmt = super::generic::Stmt<SourceRange>;
pub type StmtKind = super::generic::StmtKind<SourceRange>;
pub type StmtFunctionDef = super::generic::StmtFunctionDef<SourceRange>;
pub type StmtAsyncFunctionDef = super::generic::StmtAsyncFunctionDef<SourceRange>;
pub type StmtClassDef = super::generic::StmtClassDef<SourceRange>;
pub type StmtReturn = super::generic::StmtReturn<SourceRange>;
pub type StmtDelete = super::generic::StmtDelete<SourceRange>;
pub type StmtAssign = super::generic::StmtAssign<SourceRange>;
pub type StmtAugAssign = super::generic::StmtAugAssign<SourceRange>;
pub type StmtAnnAssign = super::generic::StmtAnnAssign<SourceRange>;
pub type StmtFor = super::generic::StmtFor<SourceRange>;
pub type StmtAsyncFor = super::generic::StmtAsyncFor<SourceRange>;
pub type StmtWhile = super::generic::StmtWhile<SourceRange>;
pub type StmtIf = super::generic::StmtIf<SourceRange>;
pub type StmtWith = super::generic::StmtWith<SourceRange>;
pub type StmtAsyncWith = super::generic::StmtAsyncWith<SourceRange>;
pub type StmtMatch = super::generic::StmtMatch<SourceRange>;
pub type StmtRaise = super::generic::StmtRaise<SourceRange>;
pub type StmtTry = super::generic::StmtTry<SourceRange>;
pub type StmtTryStar = super::generic::StmtTryStar<SourceRange>;
pub type StmtAssert = super::generic::StmtAssert<SourceRange>;
pub type StmtImport = super::generic::StmtImport<SourceRange>;
pub type StmtImportFrom = super::generic::StmtImportFrom<SourceRange>;
pub type StmtGlobal = super::generic::StmtGlobal;
pub type StmtNonlocal = super::generic::StmtNonlocal;
pub type StmtExpr = super::generic::StmtExpr<SourceRange>;
pub type Expr = super::generic::Expr<SourceRange>;
pub type ExprKind = super::generic::ExprKind<SourceRange>;
pub type ExprBoolOp = super::generic::ExprBoolOp<SourceRange>;
pub type ExprNamedExpr = super::generic::ExprNamedExpr<SourceRange>;
pub type ExprBinOp = super::generic::ExprBinOp<SourceRange>;
pub type ExprUnaryOp = super::generic::ExprUnaryOp<SourceRange>;
pub type ExprLambda = super::generic::ExprLambda<SourceRange>;
pub type ExprIfExp = super::generic::ExprIfExp<SourceRange>;
pub type ExprDict = super::generic::ExprDict<SourceRange>;
pub type ExprSet = super::generic::ExprSet<SourceRange>;
pub type ExprListComp = super::generic::ExprListComp<SourceRange>;
pub type ExprSetComp = super::generic::ExprSetComp<SourceRange>;
pub type ExprDictComp = super::generic::ExprDictComp<SourceRange>;
pub type ExprGeneratorExp = super::generic::ExprGeneratorExp<SourceRange>;
pub type ExprAwait = super::generic::ExprAwait<SourceRange>;
pub type ExprYield = super::generic::ExprYield<SourceRange>;
pub type ExprYieldFrom = super::generic::ExprYieldFrom<SourceRange>;
pub type ExprCompare = super::generic::ExprCompare<SourceRange>;
pub type ExprCall = super::generic::ExprCall<SourceRange>;
pub type ExprFormattedValue = super::generic::ExprFormattedValue<SourceRange>;
pub type ExprJoinedStr = super::generic::ExprJoinedStr<SourceRange>;
pub type ExprConstant = super::generic::ExprConstant;
pub type ExprAttribute = super::generic::ExprAttribute<SourceRange>;
pub type ExprSubscript = super::generic::ExprSubscript<SourceRange>;
pub type ExprStarred = super::generic::ExprStarred<SourceRange>;
pub type ExprName = super::generic::ExprName;
pub type ExprList = super::generic::ExprList<SourceRange>;
pub type ExprTuple = super::generic::ExprTuple<SourceRange>;
pub type ExprSlice = super::generic::ExprSlice<SourceRange>;
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<SourceRange>;
pub type Excepthandler = super::generic::Excepthandler<SourceRange>;
pub type ExcepthandlerKind = super::generic::ExcepthandlerKind<SourceRange>;
pub type ExcepthandlerExceptHandler = super::generic::ExcepthandlerExceptHandler<SourceRange>;
pub type Arguments = super::generic::Arguments<SourceRange>;
pub type Arg = super::generic::Arg<SourceRange>;
pub type ArgData = super::generic::ArgData<SourceRange>;
pub type Keyword = super::generic::Keyword<SourceRange>;
pub type KeywordData = super::generic::KeywordData<SourceRange>;
pub type Alias = super::generic::Alias<SourceRange>;
pub type AliasData = super::generic::AliasData;
pub type Withitem = super::generic::Withitem<SourceRange>;
pub type MatchCase = super::generic::MatchCase<SourceRange>;
pub type Pattern = super::generic::Pattern<SourceRange>;
pub type PatternKind = super::generic::PatternKind<SourceRange>;
pub type PatternMatchValue = super::generic::PatternMatchValue<SourceRange>;
pub type PatternMatchSingleton = super::generic::PatternMatchSingleton;
pub type PatternMatchSequence = super::generic::PatternMatchSequence<SourceRange>;
pub type PatternMatchMapping = super::generic::PatternMatchMapping<SourceRange>;
pub type PatternMatchClass = super::generic::PatternMatchClass<SourceRange>;
pub type PatternMatchStar = super::generic::PatternMatchStar;
pub type PatternMatchAs = super::generic::PatternMatchAs<SourceRange>;
pub type PatternMatchOr = super::generic::PatternMatchOr<SourceRange>;
pub type TypeIgnore = super::generic::TypeIgnore;
pub type TypeIgnoreTypeIgnore = super::generic::TypeIgnoreTypeIgnore;

View file

@ -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<U = ()> = Vec<Stmt<U>>;
pub mod location {
pub use rustpython_compiler_core::source_code::{OneIndexed, SourceLocation};
#[derive(Debug)]
pub struct SourceRange {
pub start: SourceLocation,
pub end: Option<SourceLocation>,
}
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<std::ops::Range<SourceLocation>> for SourceRange {
fn from(value: std::ops::Range<SourceLocation>) -> Self {
Self {
start: value.start,
end: Some(value.end),
}
}
}
}

View file

@ -1,95 +0,0 @@
// File automatically generated by ast/asdl_rs.py.
use rustpython_compiler_core::LocationRange;
pub type Located<T> = super::generic::Attributed<T, LocationRange>;
pub type Mod = super::generic::Mod<LocationRange>;
pub type ModModule = super::generic::ModModule<LocationRange>;
pub type ModInteractive = super::generic::ModInteractive<LocationRange>;
pub type ModExpression = super::generic::ModExpression<LocationRange>;
pub type ModFunctionType = super::generic::ModFunctionType<LocationRange>;
pub type Stmt = super::generic::Stmt<LocationRange>;
pub type StmtKind = super::generic::StmtKind<LocationRange>;
pub type StmtFunctionDef = super::generic::StmtFunctionDef<LocationRange>;
pub type StmtAsyncFunctionDef = super::generic::StmtAsyncFunctionDef<LocationRange>;
pub type StmtClassDef = super::generic::StmtClassDef<LocationRange>;
pub type StmtReturn = super::generic::StmtReturn<LocationRange>;
pub type StmtDelete = super::generic::StmtDelete<LocationRange>;
pub type StmtAssign = super::generic::StmtAssign<LocationRange>;
pub type StmtAugAssign = super::generic::StmtAugAssign<LocationRange>;
pub type StmtAnnAssign = super::generic::StmtAnnAssign<LocationRange>;
pub type StmtFor = super::generic::StmtFor<LocationRange>;
pub type StmtAsyncFor = super::generic::StmtAsyncFor<LocationRange>;
pub type StmtWhile = super::generic::StmtWhile<LocationRange>;
pub type StmtIf = super::generic::StmtIf<LocationRange>;
pub type StmtWith = super::generic::StmtWith<LocationRange>;
pub type StmtAsyncWith = super::generic::StmtAsyncWith<LocationRange>;
pub type StmtMatch = super::generic::StmtMatch<LocationRange>;
pub type StmtRaise = super::generic::StmtRaise<LocationRange>;
pub type StmtTry = super::generic::StmtTry<LocationRange>;
pub type StmtTryStar = super::generic::StmtTryStar<LocationRange>;
pub type StmtAssert = super::generic::StmtAssert<LocationRange>;
pub type StmtImport = super::generic::StmtImport<LocationRange>;
pub type StmtImportFrom = super::generic::StmtImportFrom<LocationRange>;
pub type StmtGlobal = super::generic::StmtGlobal;
pub type StmtNonlocal = super::generic::StmtNonlocal;
pub type StmtExpr = super::generic::StmtExpr<LocationRange>;
pub type Expr = super::generic::Expr<LocationRange>;
pub type ExprKind = super::generic::ExprKind<LocationRange>;
pub type ExprBoolOp = super::generic::ExprBoolOp<LocationRange>;
pub type ExprNamedExpr = super::generic::ExprNamedExpr<LocationRange>;
pub type ExprBinOp = super::generic::ExprBinOp<LocationRange>;
pub type ExprUnaryOp = super::generic::ExprUnaryOp<LocationRange>;
pub type ExprLambda = super::generic::ExprLambda<LocationRange>;
pub type ExprIfExp = super::generic::ExprIfExp<LocationRange>;
pub type ExprDict = super::generic::ExprDict<LocationRange>;
pub type ExprSet = super::generic::ExprSet<LocationRange>;
pub type ExprListComp = super::generic::ExprListComp<LocationRange>;
pub type ExprSetComp = super::generic::ExprSetComp<LocationRange>;
pub type ExprDictComp = super::generic::ExprDictComp<LocationRange>;
pub type ExprGeneratorExp = super::generic::ExprGeneratorExp<LocationRange>;
pub type ExprAwait = super::generic::ExprAwait<LocationRange>;
pub type ExprYield = super::generic::ExprYield<LocationRange>;
pub type ExprYieldFrom = super::generic::ExprYieldFrom<LocationRange>;
pub type ExprCompare = super::generic::ExprCompare<LocationRange>;
pub type ExprCall = super::generic::ExprCall<LocationRange>;
pub type ExprFormattedValue = super::generic::ExprFormattedValue<LocationRange>;
pub type ExprJoinedStr = super::generic::ExprJoinedStr<LocationRange>;
pub type ExprConstant = super::generic::ExprConstant;
pub type ExprAttribute = super::generic::ExprAttribute<LocationRange>;
pub type ExprSubscript = super::generic::ExprSubscript<LocationRange>;
pub type ExprStarred = super::generic::ExprStarred<LocationRange>;
pub type ExprName = super::generic::ExprName;
pub type ExprList = super::generic::ExprList<LocationRange>;
pub type ExprTuple = super::generic::ExprTuple<LocationRange>;
pub type ExprSlice = super::generic::ExprSlice<LocationRange>;
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<LocationRange>;
pub type Excepthandler = super::generic::Excepthandler<LocationRange>;
pub type ExcepthandlerKind = super::generic::ExcepthandlerKind<LocationRange>;
pub type ExcepthandlerExceptHandler = super::generic::ExcepthandlerExceptHandler<LocationRange>;
pub type Arguments = super::generic::Arguments<LocationRange>;
pub type Arg = super::generic::Arg<LocationRange>;
pub type ArgData = super::generic::ArgData<LocationRange>;
pub type Keyword = super::generic::Keyword<LocationRange>;
pub type KeywordData = super::generic::KeywordData<LocationRange>;
pub type Alias = super::generic::Alias<LocationRange>;
pub type AliasData = super::generic::AliasData;
pub type Withitem = super::generic::Withitem<LocationRange>;
pub type MatchCase = super::generic::MatchCase<LocationRange>;
pub type Pattern = super::generic::Pattern<LocationRange>;
pub type PatternKind = super::generic::PatternKind<LocationRange>;
pub type PatternMatchValue = super::generic::PatternMatchValue<LocationRange>;
pub type PatternMatchSingleton = super::generic::PatternMatchSingleton;
pub type PatternMatchSequence = super::generic::PatternMatchSequence<LocationRange>;
pub type PatternMatchMapping = super::generic::PatternMatchMapping<LocationRange>;
pub type PatternMatchClass = super::generic::PatternMatchClass<LocationRange>;
pub type PatternMatchStar = super::generic::PatternMatchStar;
pub type PatternMatchAs = super::generic::PatternMatchAs<LocationRange>;
pub type PatternMatchOr = super::generic::PatternMatchOr<LocationRange>;
pub type TypeIgnore = super::generic::TypeIgnore;
pub type TypeIgnoreTypeIgnore = super::generic::TypeIgnoreTypeIgnore;

View file

@ -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<X: Foldable<(), SourceRange>>(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<X: Foldable<(), LocationRange>>(&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<T, ()>,
) -> Result<Attributed<T, Self::TargetU>, 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,
})
}

View file

@ -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"

View file

@ -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<C: Constant = ConstantData> {
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<C: Constant> CodeObject<C> {
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;

View file

@ -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<T> BaseError<T> {
BaseError::from(self)
}
pub fn into_located<U>(self, locator: &str) -> LocatedError<U>
pub fn into_located<U>(self, locator: &mut super::SourceLocator) -> LocatedError<U>
where
T: Into<U>,
{
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<T> {
pub error: T,
pub location: Location,
pub location: Option<SourceLocation>,
pub source_path: String,
}
@ -99,6 +104,17 @@ impl<T> LocatedError<T> {
{
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<T> Display for LocatedError<T>
@ -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,)
}
}

View file

@ -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)
}
}

View file

@ -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<T: TryInto<isize>>(&self, offset: T) -> Self
where
<T as TryInto<isize>>::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<T: TryInto<isize>>(&self, offset: T) -> Self
where
<T as TryInto<isize>>::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<Location>;
#[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));
}
}

View file

@ -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<R: Read, Bag: ConstantBag>(
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::<Result<Box<[Location]>>>()?;
.collect::<Result<Box<[SourceLocation]>>>()?;
let flags = CodeFlags::from_bits_truncate(rdr.read_u16()?);
@ -199,7 +205,8 @@ pub fn deserialize_code<R: Read, Bag: ConstantBag>(
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<W: Write, C: Constant>(buf: &mut W, code: &CodeObject<C>)
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<W: Write, C: Constant>(buf: &mut W, code: &CodeObject<C>)
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());

View file

@ -19,7 +19,7 @@ type ParameterDef = (ast::Arg, Option<ast::Expr>);
pub(crate) fn validate_arguments(
arguments: ast::Arguments,
) -> Result<ast::Arguments, LexicalError> {
let mut all_args: Vec<&ast::Located<ast::ArgData>> = vec![];
let mut all_args: Vec<&ast::Attributed<ast::ArgData>> = vec![];
all_args.extend(arguments.posonlyargs.iter());
all_args.extend(arguments.args.iter());

View file

@ -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(

View file

@ -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(

View file

@ -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,

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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,

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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,

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -3,14 +3,14 @@ source: parser/src/parser.rs
expression: "parse_program(source, \"<test>\").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, \"<test>\").unwrap()"
},
),
},
Located {
Attributed {
range: 13..14,
custom: (),
node: Name(
@ -33,7 +33,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
],
keywords: [],
body: [
Located {
Attributed {
range: 18..44,
custom: (),
node: FunctionDef(
@ -42,7 +42,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
args: Arguments {
posonlyargs: [],
args: [
Located {
Attributed {
range: 31..35,
custom: (),
node: ArgData {
@ -59,7 +59,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
defaults: [],
},
body: [
Located {
Attributed {
range: 40..44,
custom: (),
node: Pass,
@ -71,7 +71,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
},
Located {
Attributed {
range: 46..98,
custom: (),
node: FunctionDef(
@ -80,7 +80,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
args: Arguments {
posonlyargs: [],
args: [
Located {
Attributed {
range: 70..74,
custom: (),
node: ArgData {
@ -89,7 +89,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
type_comment: None,
},
},
Located {
Attributed {
range: 76..79,
custom: (),
node: ArgData {
@ -104,7 +104,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
kw_defaults: [],
kwarg: None,
defaults: [
Located {
Attributed {
range: 80..89,
custom: (),
node: Constant(
@ -119,7 +119,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
],
},
body: [
Located {
Attributed {
range: 94..98,
custom: (),
node: Pass,

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -3,19 +3,19 @@ source: parser/src/parser.rs
expression: "parse_program(source, \"<test>\").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, \"<test>\").unwrap()"
},
),
},
Located {
Attributed {
range: 3..4,
custom: (),
node: Name(
@ -41,13 +41,13 @@ expression: "parse_program(source, \"<test>\").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, \"<test>\").unwrap()"
},
),
},
Located {
Attributed {
range: 10..11,
custom: (),
node: Constant(

File diff suppressed because it is too large Load diff

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

File diff suppressed because it is too large Load diff

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

Some files were not shown because too many files have changed in this diff Show more