Skip to content

Commit 6bb19ef

Browse files
authored
Merge pull request #1567 from ahoppen/ahoppen/update-codegen-2023-04-21
Update CodeGeneration
2 parents c7087ad + 967fb26 commit 6bb19ef

28 files changed

+8672
-8670
lines changed

CodeGeneration/Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ let package = Package(
1111
.executable(name: "generate-swiftsyntax", targets: ["generate-swiftsyntax"])
1212
],
1313
dependencies: [
14-
.package(url: "https://github.com/apple/swift-syntax.git", revision: "94120e0cf9bf541e54fbc8512934daea23a9ad0c"),
15-
.package(url: "https://github.com/apple/swift-argument-parser.git", .upToNextMinor(from: "1.2.2")),
14+
.package(url: "https://github.com/apple/swift-syntax.git", revision: "c7087adb193b26f02b59d21cd06d17ec202d1bf5"),
15+
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.2.2"),
1616
],
1717
targets: [
1818
.executableTarget(

CodeGeneration/Sources/generate-swiftsyntax/GenerateSwiftSyntax.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import Utils
2020
private let generatedDirName = "generated"
2121

2222
private let swiftBasicFormatGeneratedDir = ["SwiftBasicFormat", generatedDirName]
23-
private let ideUtilsGeneratedDir = ["IDEUtils", generatedDirName]
23+
private let swiftideUtilsGeneratedDir = ["SwiftIDEUtils", generatedDirName]
2424
private let swiftParserGeneratedDir = ["SwiftParser", generatedDirName]
2525
private let swiftParserDiagnosticsGeneratedDir = ["SwiftParserDiagnostics", generatedDirName]
2626
private let swiftSyntaxGeneratedDir = ["SwiftSyntax", generatedDirName]
@@ -83,7 +83,7 @@ struct GenerateSwiftSyntax: ParsableCommand {
8383
GeneratedFileSpec(swiftBasicFormatGeneratedDir + ["BasicFormat+Extensions.swift"], basicFormatExtensionsFile),
8484

8585
// IDEUtils
86-
GeneratedFileSpec(ideUtilsGeneratedDir + ["SyntaxClassification.swift"], syntaxClassificationFile),
86+
GeneratedFileSpec(swiftideUtilsGeneratedDir + ["SyntaxClassification.swift"], syntaxClassificationFile),
8787

8888
// SwiftParser
8989
GeneratedFileSpec(swiftParserGeneratedDir + ["DeclarationModifier.swift"], declarationModifierFile),

CodeGeneration/Sources/generate-swiftsyntax/templates/swiftsyntaxbuilder/BuildableCollectionNodesFile.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ let buildableCollectionNodesFile = SourceFileSyntax(leadingTrivia: copyrightHead
3030
DeclSyntax(
3131
"""
3232
public init(_ elements: \(ArrayTypeSyntax(elementType: elementType.parameterType))) {
33-
self = \(raw: node.type.syntaxBaseName)(elements.map { \(elementType.syntax)(fromProtocol: $0) })
33+
self = \(raw: node.type.syntaxBaseName)(elements.map {
34+
\(elementType.syntax)(fromProtocol: $0)
35+
})
3436
}
3537
"""
3638
)

Sources/SwiftParser/generated/IsLexerClassified.swift

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -19,113 +19,113 @@ extension Keyword {
1919
/// This is true for keywords that used to be considered non-contextual.
2020
var isLexerClassified: Bool {
2121
switch self {
22-
case .`Any`:
22+
case .`Any`:
2323
return true
24-
case .`as`:
24+
case .`as`:
2525
return true
26-
case .`associatedtype`:
26+
case .`associatedtype`:
2727
return true
28-
case .`break`:
28+
case .`break`:
2929
return true
30-
case .`case`:
30+
case .`case`:
3131
return true
32-
case .`catch`:
32+
case .`catch`:
3333
return true
34-
case .`class`:
34+
case .`class`:
3535
return true
36-
case .`continue`:
36+
case .`continue`:
3737
return true
38-
case .`default`:
38+
case .`default`:
3939
return true
40-
case .`defer`:
40+
case .`defer`:
4141
return true
42-
case .`deinit`:
42+
case .`deinit`:
4343
return true
44-
case .`do`:
44+
case .`do`:
4545
return true
46-
case .`else`:
46+
case .`else`:
4747
return true
48-
case .`enum`:
48+
case .`enum`:
4949
return true
50-
case .`extension`:
50+
case .`extension`:
5151
return true
52-
case .`fallthrough`:
52+
case .`fallthrough`:
5353
return true
54-
case .`false`:
54+
case .`false`:
5555
return true
56-
case .`fileprivate`:
56+
case .`fileprivate`:
5757
return true
58-
case .`for`:
58+
case .`for`:
5959
return true
60-
case .`func`:
60+
case .`func`:
6161
return true
62-
case .`guard`:
62+
case .`guard`:
6363
return true
64-
case .`if`:
64+
case .`if`:
6565
return true
66-
case .`import`:
66+
case .`import`:
6767
return true
68-
case .`in`:
68+
case .`in`:
6969
return true
70-
case .`init`:
70+
case .`init`:
7171
return true
72-
case .`inout`:
72+
case .`inout`:
7373
return true
74-
case .`internal`:
74+
case .`internal`:
7575
return true
76-
case .`is`:
76+
case .`is`:
7777
return true
78-
case .`let`:
78+
case .`let`:
7979
return true
80-
case .`nil`:
80+
case .`nil`:
8181
return true
82-
case .`operator`:
82+
case .`operator`:
8383
return true
84-
case .`precedencegroup`:
84+
case .`precedencegroup`:
8585
return true
86-
case .`private`:
86+
case .`private`:
8787
return true
88-
case .`protocol`:
88+
case .`protocol`:
8989
return true
90-
case .`public`:
90+
case .`public`:
9191
return true
92-
case .`repeat`:
92+
case .`repeat`:
9393
return true
94-
case .`rethrows`:
94+
case .`rethrows`:
9595
return true
96-
case .`return`:
96+
case .`return`:
9797
return true
98-
case .`self`:
98+
case .`self`:
9999
return true
100-
case .`Self`:
100+
case .`Self`:
101101
return true
102-
case .`static`:
102+
case .`static`:
103103
return true
104-
case .`struct`:
104+
case .`struct`:
105105
return true
106-
case .`subscript`:
106+
case .`subscript`:
107107
return true
108-
case .`super`:
108+
case .`super`:
109109
return true
110-
case .`switch`:
110+
case .`switch`:
111111
return true
112-
case .`throw`:
112+
case .`throw`:
113113
return true
114-
case .`throws`:
114+
case .`throws`:
115115
return true
116-
case .`true`:
116+
case .`true`:
117117
return true
118-
case .`try`:
118+
case .`try`:
119119
return true
120-
case .`typealias`:
120+
case .`typealias`:
121121
return true
122-
case .`var`:
122+
case .`var`:
123123
return true
124-
case .`where`:
124+
case .`where`:
125125
return true
126-
case .`while`:
126+
case .`while`:
127127
return true
128-
default:
128+
default:
129129
return false
130130
}
131131
}
@@ -157,7 +157,7 @@ extension TokenKind {
157157
return true
158158
case .keyword(let keyword):
159159
return keyword.isLexerClassified
160-
default:
160+
default:
161161
return false
162162
}
163163
}

Sources/SwiftParser/generated/Parser+Entry.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ extension Parser {
1818
/// Parse the source code in the given string as Swift source file. See
1919
/// `Parser.init` for more details.
2020
public static func parse(
21-
source: String,
21+
source: String,
2222
parseTransition: IncrementalParseTransition? = nil
2323
) -> SourceFileSyntax {
2424
var parser = Parser(source)
@@ -28,8 +28,8 @@ extension Parser {
2828
/// Parse the source code in the given string as Swift source file. See
2929
/// `Parser.init` for more details.
3030
public static func parse(
31-
source: UnsafeBufferPointer<UInt8>,
32-
maximumNestingLevel: Int? = nil,
31+
source: UnsafeBufferPointer<UInt8>,
32+
maximumNestingLevel: Int? = nil,
3333
parseTransition: IncrementalParseTransition? = nil
3434
) -> SourceFileSyntax {
3535
var parser = Parser(source, maximumNestingLevel: maximumNestingLevel)

0 commit comments

Comments
 (0)