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-10-18 01:40:52
最后一次提交
發布數1578
最新版本名稱swift-6.2-DEVELOPMENT-SNAPSHOT-2025-10-09-a (發布於 2025-10-10 01:25:49)
第一版名稱swift-4.2-DEVELOPMENT-SNAPSHOT-2018-08-25-a (發布於 2018-08-30 16:19:55)
用户参与
星數3.5k
關注者數174
派生數459
提交數5.9k
已啟用問題?
問題數461
打開的問題數75
拉請求數2370
打開的拉請求數53
關閉的拉請求數242
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?