Skip to content
This repository was archived by the owner on May 11, 2023. It is now read-only.

Commit 8f01c4f

Browse files
committed
Revert into_node and node() changes
1 parent 5ffa8a1 commit 8f01c4f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/parser/python.lalrpop

+2-2
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ ClosedPattern: ast::Pattern = {
519519

520520
SequencePattern: ast::PatternKind = {
521521
// A single-item tuple is a special case: it's a group pattern, _not_ a sequence pattern.
522-
<location:@L> "(" <pattern:Pattern> ")" <end_location:@R> => pattern.into_node(),
522+
<location:@L> "(" <pattern:Pattern> ")" <end_location:@R> => pattern.node,
523523
<location:@L> "(" ")" <end_location:@R> => ast::PatternKind::MatchSequence {
524524
patterns: vec![],
525525
},
@@ -1554,7 +1554,7 @@ Atom<Goal>: ast::Expr = {
15541554
},
15551555
<location:@L> "(" <left:(<OneOrMore<Test<"all">>> ",")?> <mid:NamedOrStarExpr> <right:("," <TestOrStarNamedExpr>)*> <trailing_comma:","?> ")" <end_location:@R> =>? {
15561556
if left.is_none() && right.is_empty() && trailing_comma.is_none() {
1557-
if matches!(mid.node(), ast::ExprKind::Starred { .. }) {
1557+
if matches!(mid.node, ast::ExprKind::Starred { .. }) {
15581558
Err(LexicalError{
15591559
error: LexicalErrorType::OtherError("cannot use starred expression here".to_string()),
15601560
location: mid.start(),

compiler/parser/src/function.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ pub(crate) fn parse_args(func_args: Vec<FunctionArgument>) -> Result<ArgumentLis
144144

145145
// Check if an expression is a starred expression.
146146
fn is_starred(exp: &ast::Expr) -> bool {
147-
matches!(exp.node(), ast::ExprKind::Starred { .. })
147+
matches!(exp.node, ast::ExprKind::Starred { .. })
148148
}
149149

150150
#[cfg(test)]

0 commit comments

Comments
 (0)