mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-15 17:15:24 +00:00
Add end locations to all nodes (#4192)
This commit is contained in:
parent
ca62bd1593
commit
8a32bab00a
61 changed files with 3157 additions and 144 deletions
|
@ -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()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue