Skip to content

Commit 29898f1

Browse files
committed
[NFC] Allow wildcards in contextual-keyword PBDs
1 parent 16e1e5d commit 29898f1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Sources/SwiftParser/Patterns.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,10 @@ extension Parser.Lookahead {
272272
// than likely need to be made contextual as well before finalizing their
273273
// grammar.
274274
case ._borrowing, .borrowing:
275-
return peek(isAt: TokenSpec(.identifier, allowAtStartOfLine: false))
275+
return peek(
276+
isAt: TokenSpec(.identifier, allowAtStartOfLine: false),
277+
TokenSpec(.wildcard, allowAtStartOfLine: false)
278+
)
276279
default:
277280
// Other keywords can be parsed unconditionally.
278281
return true

0 commit comments

Comments
 (0)