Skip to content

Commit 3d3f879

Browse files
committed
Update README.md
README.md hasn’t really been re-visited in a while and contained a lot of outdated information. Shorten it a little bit.
1 parent 636a911 commit 3d3f879

File tree

2 files changed

+8
-86
lines changed

2 files changed

+8
-86
lines changed

Examples/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Each example can be executed by navigating into this folder and running `swift r
55
- [AddOneToIntegerLiterals](Sources/AddOneToIntegerLiterals/AddOneToIntegerLiterals.swift): Command line tool to add 1 to every integer literal in a source file
66
- [CodeGenerationUsingSwiftSyntaxBuilder](Sources/CodeGenerationUsingSwiftSyntaxBuilder/CodeGenerationUsingSwiftSyntaxBuilder.swift): Code-generate a simple source file using SwiftSyntaxBuilder
77
- [ExamplePlugin](Sources/ExamplePlugin): Compiler plugin executable using [`SwiftCompilerPlugin`](../Sources/SwiftCompilerPlugin)
8+
- [MacroExamples](Sources/MacroExampls): A collection of Swift macros
89

910
Furthermore, SwiftSyntax uses [`SwiftSyntaxBuilder`](../Sources/SwiftSyntaxBuilder) extensively to generate its own code. That code can be found in the [CodeGeneration](../CodeGeneration) package.
1011

README.md

Lines changed: 7 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,27 @@
1-
# SwiftSyntax
1+
# Swift Syntax
22

3-
SwiftSyntax is a set of Swift libraries for parsing, inspecting, generating, and transforming Swift source code.
3+
The swift-syntax package is a set of libraries that work on a source-accurate tree representation of Swift source code, called the SwiftSyntax tree. The SwiftSyntax tree forms the backbone of Swift’s macro system – the macro expansion nodes are represented as SwiftSyntax nodes and a macro generates a SwiftSyntax tree to be inserted into the source file.
44

55
## Documentation
66

77
You can read SwiftSyntax’s documentation on [swiftpackageindex.com](https://swiftpackageindex.com/apple/swift-syntax/documentation).
88

99
A great way to interactively explore the SwiftSyntax tree of a source file is https://swift-ast-explorer.com, developed by [@kishikawakatsumi](https://github.com/kishikawakatsumi).
1010

11-
## Adding SwiftSyntax as a Dependency
11+
A set of example usages of swift-syntax can be found in [Examples](Examples).
1212

13-
### Trunk Development (main)
13+
## Releases
1414

15-
The mainline branch of SwiftSyntax tracks the latest developments. It is not
16-
an official release, and is subject to rapid changes in APIs and behaviors. To
17-
use it, add this repository to the `Package.swift` manifest of your project:
15+
Releases of SwiftSyntax are aligned with corresponding language and tooling releases, for example the major version 509 of swift-syntax is aligned with Swift 5.9.
1816

19-
```swift
20-
// swift-tools-version:5.7
21-
import PackageDescription
22-
23-
let package = Package(
24-
name: "MyTool",
25-
dependencies: [
26-
.package(url: "https://github.com/apple/swift-syntax.git", branch: "main"),
27-
],
28-
targets: [
29-
.target(name: "MyTool", dependencies: [
30-
.product(name: "SwiftSyntax", package: "swift-syntax"),
31-
]),
32-
]
33-
)
34-
```
35-
36-
Mainline SwiftSyntax also includes
37-
38-
- `SwiftParser` for natively parsing source code
39-
- `SwiftOperators` for folding SwiftSyntax trees containing operators
40-
- `SwiftSyntaxBuilder` for generating Swift code with a result builder-style interface
41-
- `SwiftSyntaxMacros` for providing syntactic macro support
42-
43-
### Releases
44-
45-
Releases of SwiftSyntax are aligned with corresponding language
46-
and tooling releases and are stable. To use them,
47-
add this repository to the `Package.swift` manifest of your project:
48-
49-
```swift
50-
// swift-tools-version:5.7
51-
import PackageDescription
52-
53-
let package = Package(
54-
name: "MyTool",
55-
dependencies: [
56-
.package(url: "https://github.com/apple/swift-syntax.git", exact: "<#Specify Release tag#>"),
57-
],
58-
targets: [
59-
.target(name: "MyTool", dependencies: [
60-
.product(name: "SwiftSyntax", package: "swift-syntax"),
61-
]),
62-
]
63-
)
64-
```
65-
66-
Replace `<#Specify Release tag#>` by the version of SwiftSyntax that you want to use (see the following table for mapping details).
67-
68-
| Xcode Release | Swift Release Tag | SwiftSyntax Release Tag |
69-
|:-------------------:|:-------------------:|:-------------------------:|
70-
| Xcode 14.3 | swift-5.8-RELEASE | 508.0.0 |
71-
| Xcode 14.0 | swift-5.7-RELEASE | 0.50700.1 |
72-
| Xcode 13.3 | swift-5.6-RELEASE | 0.50600.1 |
73-
| Xcode 13.0 | swift-5.5-RELEASE | 0.50500.0 |
74-
| Xcode 12.5 | swift-5.4-RELEASE | 0.50400.0 |
75-
| Xcode 12.0 | swift-5.3-RELEASE | 0.50300.0 |
76-
| Xcode 11.4 | swift-5.2-RELEASE | 0.50200.0 |
77-
78-
## Documentation
79-
80-
SwiftSyntax uses [DocC](https://developer.apple.com/documentation/docc) bundles
81-
for its documentation. To view rendered documentation in Xcode, open the
82-
SwiftSyntax package and select
83-
84-
```
85-
Product > Build Documentation
86-
```
87-
88-
Associated articles are written in markdown, and can be viewed in a browser,
89-
text editor, or IDE.
17+
## Reporting Issues
9018

91-
- [SwiftSyntax](Sources/SwiftSyntax/Documentation.docc)
92-
- [SwiftParser](Sources/SwiftParser/SwiftParser.docc)
93-
- [SwiftOperators](Sources/SwiftOperators/SwiftOperators.docc)
94-
- [SwiftSyntaxMacros](Sources/SwiftSyntaxMacros/SwiftSyntaxMacros.docc)
19+
If you should hit any issues while using SwiftSyntax, we appreciate bug reports on [GitHub Issue](https://github.com/apple/swift-syntax/issues).
9520

9621
## Contributing
9722

9823
Start contributing to SwiftSyntax see [this guide](CONTRIBUTING.md) for more information.
9924

100-
## Reporting Issues
101-
102-
If you should hit any issues while using SwiftSyntax, we appreciate bug reports on [GitHub Issue](https://github.com/apple/swift-syntax/issues).
103-
10425
## Bazel
10526

10627
SwiftSyntax provides an experimental [Bazel](https://bazel.build) build configuration, maintained by Keith Smiley.

0 commit comments

Comments
 (0)