|
1 | 1 | # Swift Macro Toolkit |
2 | 2 |
|
| 3 | +[](https://swiftpackageindex.com/stackotter/swift-macro-toolkit) [](https://swiftpackageindex.com/stackotter/swift-macro-toolkit) |
| 4 | + |
3 | 5 | **Did you know that `-0xF_ep-0_2` is a valid floating point literal in Swift?** Well you probably didn't |
4 | 6 | (it's equal to -63.5), and as a macro author you shouldn't even have to care! Among many things, Macro |
5 | 7 | Toolkit shields you from edge cases so that users can use your macros in whatever weird (but correct) |
@@ -340,3 +342,45 @@ let diagnostic = Diagnostic( |
340 | 342 | ] |
341 | 343 | ) |
342 | 344 | ``` |
| 345 | + |
| 346 | +## Installation |
| 347 | + |
| 348 | +Add `swift-macro-toolkit` dependency to your package file. |
| 349 | + |
| 350 | +```swift |
| 351 | +.package( |
| 352 | + url: "https://github.com/stackotter/swift-macro-toolkit.git", |
| 353 | + .upToNextMinor(from: "0.8.0") // swift-syntax 602.0.0 |
| 354 | +) |
| 355 | +``` |
| 356 | + |
| 357 | +Do not forget about target dependencies: |
| 358 | + |
| 359 | +```swift |
| 360 | +.product( |
| 361 | + name: "MacroToolkit", |
| 362 | + package: "swift-macro-toolkit" |
| 363 | +) |
| 364 | +``` |
| 365 | + |
| 366 | +> [!TIP] |
| 367 | +> |
| 368 | +> _You can extend compatibility by supporting multiple [`swift-syntax`](https://github.com/swiftlang/swift-syntax) versions_ |
| 369 | +> |
| 370 | +> ```swift |
| 371 | +> .package( |
| 372 | +> url: "https://github.com/stackotter/swift-macro-toolkit.git", |
| 373 | +> "0.3.1"..."0.8.0" // swift-syntax 509.0.0...602.0.0 |
| 374 | +> ) |
| 375 | +> ``` |
| 376 | +> |
| 377 | +> **Version map** |
| 378 | +> |
| 379 | +> | swift-macro-toolkit | swift-syntax | |
| 380 | +> | ------------------- | ------------------------------ | |
| 381 | +> | `0.3.1` | `apple/swift-syntax` `509.0.0` | |
| 382 | +> | `0.4.0` | `apple/swift-syntax` `510.0.0` | |
| 383 | +> | `0.5.0` | `510.0.0` | |
| 384 | +> | `0.6.0` | `600.0.0` | |
| 385 | +> | `0.7.0` | `601.0.0` | |
| 386 | +> | `0.8.0` | `602.0.0` | |
0 commit comments