Skip to content

Commit

Permalink
Add parse
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Aug 22, 2023
1 parent cc278c2 commit a2a2070
Show file tree
Hide file tree
Showing 3 changed files with 5,769 additions and 5,767 deletions.
20 changes: 20 additions & 0 deletions crates/ruff_python_ast/src/nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,26 @@ impl From<StmtContinue> for Stmt {
}
}

pub struct ParenthesizedExpr {
pub range: TextRange,
pub expr: Expr,
}

impl From<Expr> for ParenthesizedExpr {
fn from(expr: Expr) -> Self {
ParenthesizedExpr {
range: expr.range(),
expr,
}
}
}

impl From<ParenthesizedExpr> for Expr {
fn from(parenthesized_expr: ParenthesizedExpr) -> Self {
parenthesized_expr.expr
}
}

/// See also [expr](https://docs.python.org/3/library/ast.html#ast.expr)
#[derive(Clone, Debug, PartialEq, is_macro::Is)]
pub enum Expr {
Expand Down
Loading

0 comments on commit a2a2070

Please sign in to comment.