A set of Swift libraries for parsing, inspecting, generating, and transforming Swift source code.
Browse cluster: Protocol Buffers & gRPC Ecosystem →Swift-syntax is a set of Swift libraries for parsing, inspecting, generating, and transforming Swift source code. The project is built in Swift and includes several key components: SwiftParser, which parses Swift source text into a syntax tree; SwiftSyntaxBuilder, a library for generating Swift code using Swift itself; and SwiftRefactor, which provides refactoring capabilities integrated into Xcode as a source editor extension. The SwiftSyntax tree forms the foundation of Swift's macro system, with macro expansion nodes represented as SwiftSyntax nodes. The project is maintained by swiftlang and is distributed as a Swift Package Manager package with releases aligned to corresponding Swift language versions.