mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-09 22:25:23 +00:00
Restore comment specific to match/case
This commit is contained in:
parent
2e95af73c4
commit
bbedb61607
1 changed files with 2 additions and 2 deletions
|
@ -54,8 +54,8 @@ where
|
||||||
// 1. The token is at the start of a logical line.
|
// 1. The token is at the start of a logical line.
|
||||||
// 2. The logical line contains a top-level colon (that is, a colon that is not nested
|
// 2. The logical line contains a top-level colon (that is, a colon that is not nested
|
||||||
// inside a parenthesized expression, list, or dictionary).
|
// inside a parenthesized expression, list, or dictionary).
|
||||||
// 3. The top-level colon is not the immediate sibling of a soft keyword token.
|
// 3. The top-level colon is not the immediate sibling of a `match` or `case` token.
|
||||||
// (This is to avoid treating soft keywords as identifiers when annotated with
|
// (This is to avoid treating `match` or `case` as identifiers when annotated with
|
||||||
// type hints.)
|
// type hints.)
|
||||||
if matches!(tok, Tok::Match | Tok::Case) {
|
if matches!(tok, Tok::Match | Tok::Case) {
|
||||||
if !self.start_of_line {
|
if !self.start_of_line {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue