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

Commit

Permalink
Revert into_node and node() changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser committed Apr 26, 2023
1 parent 5ffa8a1 commit 8f01c4f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions compiler/parser/python.lalrpop
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ ClosedPattern: ast::Pattern = {

SequencePattern: ast::PatternKind = {
// A single-item tuple is a special case: it's a group pattern, _not_ a sequence pattern.
<location:@L> "(" <pattern:Pattern> ")" <end_location:@R> => pattern.into_node(),
<location:@L> "(" <pattern:Pattern> ")" <end_location:@R> => pattern.node,
<location:@L> "(" ")" <end_location:@R> => ast::PatternKind::MatchSequence {
patterns: vec![],
},
Expand Down Expand Up @@ -1554,7 +1554,7 @@ Atom<Goal>: ast::Expr = {
},
<location:@L> "(" <left:(<OneOrMore<Test<"all">>> ",")?> <mid:NamedOrStarExpr> <right:("," <TestOrStarNamedExpr>)*> <trailing_comma:","?> ")" <end_location:@R> =>? {
if left.is_none() && right.is_empty() && trailing_comma.is_none() {
if matches!(mid.node(), ast::ExprKind::Starred { .. }) {
if matches!(mid.node, ast::ExprKind::Starred { .. }) {
Err(LexicalError{
error: LexicalErrorType::OtherError("cannot use starred expression here".to_string()),
location: mid.start(),
Expand Down
2 changes: 1 addition & 1 deletion compiler/parser/src/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ pub(crate) fn parse_args(func_args: Vec<FunctionArgument>) -> Result<ArgumentLis

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

#[cfg(test)]
Expand Down

0 comments on commit 8f01c4f

Please sign in to comment.