diff --git a/README.md b/README.md new file mode 100644 index 0000000..4d933f6 --- /dev/null +++ b/README.md @@ -0,0 +1,77 @@ +# SwiftSyntaxSugar + +[](https://github.com/fetch-rewards/SwiftSyntaxSugar/actions/workflows/ci.yml?query=branch%3Amain) +[](https://codecov.io/gh/fetch-rewards/SwiftSyntaxSugar) +[](https://github.com/fetch-rewards/SwiftSyntaxSugar/blob/feature/readme/LICENSE) + +`SwiftSyntaxSugar` is a library that provides syntactic sugar and helpful extensions for [`SwiftSyntax`](https://github.com/swiftlang/swift-syntax). +The purpose of this library is to improve the readability and maintainability of code written using `SwiftSyntax`. + +- [Example](#example) +- [Installation](#installation) +- [Usage](#usage) +- [Contributing](#contributing) +- [License](#license) + +## Example + +
With SwiftSyntaxSugar |
+ Without SwiftSyntaxSugar |
+
| + +```swift +protocolDeclaration.isActorConstrained +``` + + | ++ +```swift +let isProtocolActorConstrained = protocolDeclaration.inheritanceClause?.inheritedTypes.contains { inheritedType in + let identifierType = inheritedType.type.as(IdentifierTypeSyntax.self) + return identifierType.name.tokenKind == .identifier("Actor") +} ?? false +``` + + | +