Skip to content

Commit f5c167e

Browse files
committed
[SwiftParse] Update for accessor block disambiguation marker
If the block after an pattern binding initializer starts with `{ @_accessorBlock` it's an accessor block, not a trailing closure. rdar://140943107
1 parent cc7888f commit f5c167e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Sources/SwiftParser/Lookahead.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,13 @@ extension Parser.Lookahead {
274274
var lookahead = self.lookahead()
275275
lookahead.eat(.leftBrace)
276276

277+
// '@_accessorBlock' is a builtin disambiguation marker.
278+
if lookahead.peek(isAt: .identifier),
279+
lookahead.peek().tokenText == "_accessorBlock"
280+
{
281+
return true;
282+
}
283+
277284
// Eat attributes, if present.
278285
while lookahead.consume(if: .atSign) != nil {
279286
guard lookahead.consume(if: .identifier) != nil else {

0 commit comments

Comments
 (0)