About this project
SwiftSyntax is a collection of Swift libraries that operate on a source-accurate tree representation of Swift source code, known as the SwiftSyntax tree. This tree is fundamental to Swift's macro system, where macro expansion nodes are represented as SwiftSyntax nodes and macros generate SwiftSyntax trees to insert into source files.
Key features include:
- Parsing Swift source into a syntax tree that preserves source accuracy.
- Inspecting and traversing the syntax tree.
- Generating and transforming Swift code programmatically.
- Integration with Swift Package Manager and Xcode projects.
- Experimental Bazel build configuration for Bazel users.
Documentation is available on Swift Package Index, and an interactive explorer (swift-ast-explorer.com) helps visualize the tree. Example usages are provided in the Examples directory.
Releases align with Swift language and tooling versions (e.g., version 509 aligns with Swift 5.9). To depend on it, add the package URL to your Package.swift or Xcode project's package dependencies.
Issues and contributions are welcome via GitHub. The project is licensed under the Apache License 2.0.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.