SwiftSyntax

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

  • 所有者: swiftlang/swift-syntax
  • 平台:
  • 许可证: Apache License 2.0
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

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.

主要指标

概览
名称与所有者swiftlang/swift-syntax
主编程语言Swift
编程语言Swift (语言数: 5)
平台
许可证Apache License 2.0
所有者活动
创建于2018-07-31 23:19:58
推送于2025-06-06 17:38:43
最后一次提交
发布数1483
最新版本名称swift-DEVELOPMENT-SNAPSHOT-2025-06-03-a (发布于 2025-06-04 03:46:26)
第一版名称swift-4.2-DEVELOPMENT-SNAPSHOT-2018-08-25-a (发布于 2018-08-30 16:19:55)
用户参与
星数3.4k
关注者数178
派生数440
提交数5.8k
已启用问题?
问题数446
打开的问题数67
拉请求数2324
打开的拉请求数51
关闭的拉请求数230
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?