This repository was archived by the owner on Oct 17, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +77
-0
lines changed
Sources/SwiftSemantics/Declarations Expand file tree Collapse file tree 4 files changed +77
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
88## [ Unreleased]
99
10+ ### Added
11+
12+ - Added support for Swift 5.4 and 5.5.
13+ #12 by @compnerd and @mattt .
14+
1015## [ 0.2.0] - 2020-11-11
1116
1217### Added
Original file line number Diff line number Diff line change 1+ // swift-tools-version:5.3
2+ // The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+ import PackageDescription
5+
6+ let package = Package (
7+ name: " SwiftSemantics " ,
8+ products: [
9+ // Products define the executables and libraries produced by a package, and make them visible to other packages.
10+ . library(
11+ name: " SwiftSemantics " ,
12+ targets: [ " SwiftSemantics " ]
13+ ) ,
14+ ] ,
15+ dependencies: [
16+ // Dependencies declare other packages that this package depends on.
17+ . package ( name: " SwiftSyntax " ,
18+ url: " https://github.com/apple/swift-syntax.git " ,
19+ . revision( " release/5.4 " ) ) ,
20+ ] ,
21+ targets: [
22+ // Targets are the basic building blocks of a package. A target can define a module or a test suite.
23+ // Targets can depend on other targets in this package, and on products in packages which this package depends on.
24+ . target(
25+ name: " SwiftSemantics " ,
26+ dependencies: [ " SwiftSyntax " ]
27+ ) ,
28+ . testTarget(
29+ name: " SwiftSemanticsTests " ,
30+ dependencies: [ " SwiftSemantics " ]
31+ ) ,
32+ ]
33+ )
Original file line number Diff line number Diff line change 1+ // swift-tools-version:5.3
2+ // The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+ import PackageDescription
5+
6+ let package = Package (
7+ name: " SwiftSemantics " ,
8+ products: [
9+ // Products define the executables and libraries produced by a package, and make them visible to other packages.
10+ . library(
11+ name: " SwiftSemantics " ,
12+ targets: [ " SwiftSemantics " ]
13+ ) ,
14+ ] ,
15+ dependencies: [
16+ // Dependencies declare other packages that this package depends on.
17+ . package ( name: " SwiftSyntax " ,
18+ url: " https://github.com/apple/swift-syntax.git " ,
19+ . revision( " release/5.5 " ) ) ,
20+ ] ,
21+ targets: [
22+ // Targets are the basic building blocks of a package. A target can define a module or a test suite.
23+ // Targets can depend on other targets in this package, and on products in packages which this package depends on.
24+ . target(
25+ name: " SwiftSemantics " ,
26+ dependencies: [ " SwiftSyntax " ]
27+ ) ,
28+ . testTarget(
29+ name: " SwiftSemanticsTests " ,
30+ dependencies: [ " SwiftSemantics " ]
31+ ) ,
32+ ]
33+ )
Original file line number Diff line number Diff line change @@ -71,7 +71,13 @@ extension Class: ExpressibleBySyntax {
7171 public init ( _ node: ClassDeclSyntax ) {
7272 attributes = node. attributes? . compactMap { $0. as ( AttributeSyntax . self) } . map { Attribute ( $0) } ?? [ ]
7373 modifiers = node. modifiers? . map { Modifier ( $0) } ?? [ ]
74+
75+ #if swift(>=5.5)
76+ keyword = node. classOrActorKeyword. text. trimmed
77+ #else
7478 keyword = node. classKeyword. text. trimmed
79+ #endif
80+
7581 name = node. identifier. text. trimmed
7682 inheritance = node. inheritanceClause? . inheritedTypeCollection. map { $0. typeName. description. trimmed } ?? [ ]
7783 genericParameters = node. genericParameterClause? . genericParameterList. map { GenericParameter ( $0) } ?? [ ]
You can’t perform that action at this time.
0 commit comments