Skip to content

Commit bd92605

Browse files
[CHORE] Updating to swift-syntax 601.0.1 for Swift 6.1+
1 parent ec5dd1b commit bd92605

File tree

5 files changed

+98
-12
lines changed

5 files changed

+98
-12
lines changed

.github/workflows/unit-tests.yml

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,25 @@ on:
2323

2424
jobs:
2525
swift_tests_latest:
26-
name: Latest Swift
26+
name: Latest Swift (6.1)
27+
runs-on: macos-15
28+
steps:
29+
- uses: maxim-lobanov/setup-xcode@v1
30+
with:
31+
xcode-version: latest
32+
- uses: actions/checkout@v3
33+
- uses: actions/cache@v3
34+
with:
35+
path: .build
36+
key: macos-latest-spm-${{ hashFiles('**/Package.resolved') }}
37+
restore-keys: |
38+
macos-latest-tests-spm-
39+
- name: Build
40+
run: swift build
41+
- name: Run tests
42+
run: swift test
43+
swift_tests_600:
44+
name: Swift 6.0
2745
runs-on: macos-15
2846
steps:
2947
- uses: maxim-lobanov/setup-xcode@v1
@@ -35,12 +53,12 @@ jobs:
3553
path: .build
3654
key: macos-latest-spm-${{ hashFiles('**/Package.resolved') }}
3755
restore-keys: |
38-
macos-latest-spm-
56+
macos-600-tests-spm-
3957
- name: Build
4058
run: swift build
4159
- name: Run tests
4260
run: swift test
43-
swift_tests_previous:
61+
swift_tests_510:
4462
name: Swift 5.10
4563
runs-on: macos-14
4664
steps:
@@ -53,7 +71,9 @@ jobs:
5371
path: .build
5472
key: macos-14-swift-510-spm-${{ hashFiles('**/Package.resolved') }}
5573
restore-keys: |
56-
macos-14-swift-510-spm-
74+
macos-14-swift-510-tests-spm-
75+
- name: Remove Resolved
76+
run: rm -rf Package.resolved
5777
- name: Build
5878
run: swift build
5979
- name: Run tests
@@ -78,7 +98,9 @@ jobs:
7898
path: .build
7999
key: ${{ matrix.os }}-${{ matrix.swift }}-spm-${{ hashFiles('**/Package.resolved') }}
80100
restore-keys: |
81-
${{ matrix.os }}-spm-
101+
${{ matrix.os }}-tests-spm-
102+
- name: Remove Resolved
103+
run: rm -rf Package.resolved
82104
- name: Build
83105
run: swift build
84106
- name: Run tests

Package.resolved

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"originHash" : "32be71fe074b39617009f0851e8d4608c0271562fc8eb32489db8d0cfa2d9582",
23
"pins" : [
34
{
45
"identity" : "spimanifest",
@@ -14,19 +15,19 @@
1415
"kind" : "remoteSourceControl",
1516
"location" : "https://github.com/swiftlang/swift-syntax.git",
1617
"state" : {
17-
"revision" : "0687f71944021d616d34d922343dcef086855920",
18-
"version" : "600.0.1"
18+
"revision" : "f99ae8aa18f0cf0d53481901f88a0991dc3bd4a2",
19+
"version" : "601.0.1"
1920
}
2021
},
2122
{
2223
"identity" : "yams",
2324
"kind" : "remoteSourceControl",
2425
"location" : "https://github.com/jpsim/Yams.git",
2526
"state" : {
26-
"revision" : "3036ba9d69cf1fd04d433527bc339dc0dc75433d",
27-
"version" : "5.1.3"
27+
"revision" : "b4b8042411dc7bbb696300a34a4bf3ba1b7ad19b",
28+
"version" : "5.3.1"
2829
}
2930
}
3031
],
31-
"version" : 2
32+
"version" : 3
3233
}

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 6.0
1+
// swift-tools-version: 6.1
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
@@ -20,7 +20,7 @@ let package = Package(
2020
),
2121
],
2222
dependencies: [
23-
.package(url: "https://github.com/swiftlang/swift-syntax.git", from: "600.0.1"),
23+
.package(url: "https://github.com/swiftlang/swift-syntax.git", from: "601.0.1"),
2424
],
2525
targets: [
2626
.target(

[email protected]

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// swift-tools-version: 6.0
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: "SyntaxSparrow",
8+
platforms: [
9+
.macOS(.v10_15),
10+
.iOS(.v13),
11+
.tvOS(.v13),
12+
.watchOS(.v6),
13+
.macCatalyst(.v13)
14+
],
15+
products: [
16+
// Products define the executables and libraries a package produces, and make them visible to other packages.
17+
.library(
18+
name: "SyntaxSparrow",
19+
targets: ["SyntaxSparrow"]
20+
),
21+
],
22+
dependencies: [
23+
.package(url: "https://github.com/swiftlang/swift-syntax.git", from: "600.0.1"),
24+
],
25+
targets: [
26+
.target(
27+
name: "SyntaxSparrow",
28+
dependencies: [
29+
.product(name: "SwiftSyntax", package: "swift-syntax"),
30+
.product(name: "SwiftParser", package: "swift-syntax"),
31+
],
32+
resources: [
33+
.copy("Resources/PrivacyInfo.xcprivacy")
34+
],
35+
swiftSettings: [
36+
.swiftLanguageMode(.v6)
37+
]
38+
),
39+
.testTarget(
40+
name: "SyntaxSparrowTests",
41+
dependencies: [
42+
"SyntaxSparrow",
43+
]
44+
),
45+
]
46+
)
47+
48+
// Supplementary
49+
package.dependencies.append(contentsOf: [
50+
.package(url: "https://github.com/SwiftPackageIndex/SPIManifest.git", from: "0.12.0"),
51+
])

Sources/SyntaxSparrow/Public/Semantics/Components/EntityType.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,16 @@ public enum EntityType: Equatable, Hashable, CustomStringConvertible {
139139
public init(_ typeSyntax: TypeSyntax) {
140140
self = EntityType.parseType(typeSyntax)
141141
}
142+
143+
#if swift(>=6.1)
144+
/// Creates a new ``SyntaxSparrow/EntityType`` instance from a `GenericArgumentSyntax.Argument` node.
145+
public init(_ argument: GenericArgumentSyntax.Argument) {
146+
switch argument {
147+
case .type(let typeSyntax):
148+
self = EntityType.parseType(typeSyntax)
149+
default:
150+
self = .empty
151+
}
152+
}
153+
#endif
142154
}

0 commit comments

Comments
 (0)