Files
swift-mirror/test/SourceKit/CursorInfo/rdar129195380.swift
Hamish Knight eeced060fa [Parse] Handle #if in brace skipping logic
Previously we would strictly match `{` + `}`, but
that ignored the fact that when parsing we consider
`#if` + `#endif` to be a stronger delimiter than
`{` + `}`, so can ignore a stray `}` in a `#if`.
Update the logic to also track opening and closing
`#if` decls, ignoring any braces that happen within
them.

rdar://129195380
2024-06-19 21:39:40 +01:00

14 lines
307 B
Swift

// rdar://129195380 - Make sure we correctly handle '#if' when skipping function
// bodies.
class C {
func test1() {
#if FOOBAR
// RUN: %sourcekitd-test -req=cursor -pos=%(line + 2):5 %s -- %s -DFOOBAR
// RUN: %sourcekitd-test -req=cursor -pos=%(line + 1):5 %s -- %s
abc
}
func test2() {
}
}