Skip to content

Commit

Permalink
Update type alias soft keyword heuristic to be more strict about `Equ…
Browse files Browse the repository at this point in the history
…als` placement
  • Loading branch information
zanieb committed Jul 17, 2023
1 parent b2d67c7 commit af508c2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion parser/src/soft_keywords.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ where
}
Tok::Lsqb => nesting += 1,
Tok::Rsqb => nesting -= 1,
_ => {}
// Allow arbitrary content within brackets for now
_ if nesting > 0 => {}

This comment has been minimized.

Copy link
@zanieb

zanieb Jul 17, 2023

Author Contributor

rustfmt removes the trailing comma here. Am I misunderstanding how this works?

This comment has been minimized.

Copy link
@MichaReiser

MichaReiser Jul 17, 2023

Contributor

I believe trailing commas are only necessary for match arms with an expression body, so that the parser knows when the arm ends. A match arm with a block body shouldn't need it as it is clear that the body ends after the }

// Exit if unexpected tokens are seen
_ => break,
}
}
}
Expand Down

0 comments on commit af508c2

Please sign in to comment.