SwiftSyntax

用于 SwiftSyntax 库的 SwiftPM 包。它允许 Swift 工具解析、检查、生成和转换 Swift 源代码。「SwiftPM package for SwiftSyntax library. It allows Swift tools to parse, inspect, generate, and transform Swift source code.」

  • Owner: swiftlang/swift-syntax
  • Platform:
  • License:: Apache License 2.0
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

SwiftSyntax

SwiftSyntax is a set of Swift bindings for the
libSyntax library. It
allows Swift tools to parse, inspect, generate, and transform Swift source
code.

Its API is designed for performance-critical applications. It uses value types almost exclusively and aims to avoid existential conversions where possible.

Note: SwiftSyntax is still in development, and the API is not guaranteed to
be stable. It's subject to change without warning.

Declare SwiftPM dependency with release tag

Add this repository to the Package.swift manifest of your project:

// swift-tools-version:5.6
import PackageDescription

let package = Package(
  name: "MyTool",
  dependencies: [
    .package(url: "https://github.com/apple/swift-syntax.git", exact: "<#Specify Release tag#>"),
  ],
  targets: [
    .target(name: "MyTool", dependencies: [
      .product(name: "SwiftSyntax", package: "swift-syntax"),
    ]),
  ]
)

Replace <#Specify Release tag#> by the version of SwiftSyntax that you want to use (see the following table for mapping details).

Xcode Release Swift Release Tag SwiftSyntax Release Tag
Xcode 13.3 swift-5.6-RELEASE 0.50600.1
Xcode 13.0 swift-5.5-RELEASE 0.50500.0
Xcode 12.5 swift-5.4-RELEASE 0.50400.0
Xcode 12.0 swift-5.3-RELEASE 0.50300.0
Xcode 11.4 swift-5.2-RELEASE 0.50200.0

Then, import SwiftSyntax in your Swift code.

Documentation

Documentation can be found here and some examples of using SwiftSyntax can be found here.

Contributing

Start contributing to SwiftSyntax see this guide for more information.

Reporting Issues

If you should hit any issues while using SwiftSyntax, we appreciate bug reports on GitHub Issue.

License

Please see LICENSE for more information.

Main metrics

Overview
Name With Ownerswiftlang/swift-syntax
Primary LanguageSwift
Program languageSwift (Language Count: 5)
Platform
License:Apache License 2.0
所有者活动
Created At2018-07-31 23:19:58
Pushed At2025-06-06 17:38:43
Last Commit At
Release Count1483
Last Release Nameswift-DEVELOPMENT-SNAPSHOT-2025-06-03-a (Posted on 2025-06-04 03:46:26)
First Release Nameswift-4.2-DEVELOPMENT-SNAPSHOT-2018-08-25-a (Posted on 2018-08-30 16:19:55)
用户参与
Stargazers Count3.4k
Watchers Count178
Fork Count440
Commits Count5.8k
Has Issues Enabled
Issues Count446
Issue Open Count67
Pull Requests Count2324
Pull Requests Open Count51
Pull Requests Close Count230
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private