Add end locations to all nodes (#4192)

This commit is contained in:
Charlie Marsh 2022-10-17 00:18:30 -04:00 committed by GitHub
parent ca62bd1593
commit 8a32bab00a
61 changed files with 3157 additions and 144 deletions

View file

@ -35,10 +35,12 @@ pub fn parse_program(source: &str, source_path: &str) -> Result<ast::Suite, Pars
/// expr,
/// ast::Expr {
/// location: ast::Location::new(1, 3),
/// end_location: Some(ast::Location::new(1, 6)),
/// custom: (),
/// node: ast::ExprKind::BinOp {
/// left: Box::new(ast::Expr {
/// location: ast::Location::new(1, 1),
/// end_location: Some(ast::Location::new(1, 2)),
/// custom: (),
/// node: ast::ExprKind::Constant {
/// value: ast::Constant::Int(1.into()),
@ -48,6 +50,7 @@ pub fn parse_program(source: &str, source_path: &str) -> Result<ast::Suite, Pars
/// op: ast::Operator::Add,
/// right: Box::new(ast::Expr {
/// location: ast::Location::new(1, 5),
/// end_location: Some(ast::Location::new(1, 6)),
/// custom: (),
/// node: ast::ExprKind::Constant {
/// value: ast::Constant::Int(2.into()),