This patch provides an API and Serialization for clang-style diagnostics
from within Swift. Libraries can use this API to pop their own custom
diagnostics that can be serialized to JSON.
* [SwiftSyntax] Fix SyntaxChildren iteration
SyntaxChildren.Iterator stops the first time it sees a nil child;
since it traverses all indexes without considering presence, this
causes it to terminate iteration early if there is a missing child
in the list.
* [SwiftSyntax] Add tests for SyntaxChildren
* [CMake] Only build SwiftSyntax if building SDK overlays
SwiftSyntax depends on Foundation, which depends on the SDK overlays
being built. However, the existing build configuration tried to build
SwiftSyntax even if the SDK overlays were not built. Ensure we're
building overlays before building SwiftSyntax, and guard tests with an
sdk_overlay test.
* Remove TODO comment
This is, unfortunately, the quickest workaround to get SwiftSyntax
building properly and generating a proper module. I'm going to take some
time to figure out what global mutable state exactly is touched inside
stdlib/ that suddenly makes this work, but for now, get the tests re-enabled.
* Create Swift libSyntax API
This patch is an initial implementation of the Swift libSyntax API. It
aims to provide all features of the C++ API but exposed to Swift.
It currently resides in SwiftExperimental and will likely exist in a
molten state for a while.
* Only build SwiftSyntax on macOS