Skip to content

Commit c1d6b43

Browse files
authored
Merge pull request #1343 from kimdv/kimdv/sort-gyb-files
Clean code gen
2 parents 02da1a1 + 31368c4 commit c1d6b43

File tree

398 files changed

+4205
-4229
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

398 files changed

+4205
-4229
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This source file is part of the Swift.org open source project
22
#
3-
# Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
3+
# Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
44
# Licensed under Apache License v2.0 with Runtime Library Exception
55
#
66
# See http://swift.org/LICENSE.txt for license information

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
The code of conduct for this project can be found at https://swift.org/code-of-conduct.
44

5-
<!-- Copyright (c) 2022 Apple Inc and the Swift Project authors. All Rights Reserved. -->
5+
<!-- Copyright (c) 2023 Apple Inc and the Swift Project authors. All Rights Reserved. -->

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: "d73b60bb61a394c85d7a3c739b034e65a11032e6"),
15-
.package(url: "https://github.com/apple/swift-argument-parser.git", .upToNextMinor(from: "1.1.4")),
14+
.package(url: "https://github.com/apple/swift-syntax.git", revision: "cf413a6fe9a82e3f8e1c022cac6f6d23dfb1a035"),
15+
.package(url: "https://github.com/apple/swift-argument-parser.git", .upToNextMinor(from: "1.2.2")),
1616
],
1717
targets: [
1818
.executableTarget(

CodeGeneration/Sources/SyntaxSupport/AttributeKinds.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
// This source file is part of the Swift.org open source project
1212
//
13-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
13+
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
1414
// Licensed under Apache License v2.0 with Runtime Library Exception
1515
//
1616
// See https://swift.org/LICENSE.txt for license information

CodeGeneration/Sources/SyntaxSupport/AttributeNodes.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
// This source file is part of the Swift.org open source project
1212
//
13-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
13+
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
1414
// Licensed under Apache License v2.0 with Runtime Library Exception
1515
//
1616
// See https://swift.org/LICENSE.txt for license information
@@ -19,7 +19,7 @@
1919
//===----------------------------------------------------------------------===//
2020

2121
public let ATTRIBUTE_NODES: [Node] = [
22-
% for node in ATTRIBUTE_NODES:
22+
% for node in sorted(ATTRIBUTE_NODES, key=lambda x: x.name):
2323
${make_swift_node(node)},
2424

2525
% end

CodeGeneration/Sources/SyntaxSupport/AvailabilityNodes.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
// This source file is part of the Swift.org open source project
1212
//
13-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
13+
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
1414
// Licensed under Apache License v2.0 with Runtime Library Exception
1515
//
1616
// See https://swift.org/LICENSE.txt for license information
@@ -19,7 +19,7 @@
1919
//===----------------------------------------------------------------------===//
2020

2121
public let AVAILABILITY_NODES: [Node] = [
22-
% for node in AVAILABILITY_NODES:
22+
% for node in sorted(AVAILABILITY_NODES, key=lambda x: x.name):
2323
${make_swift_node(node)},
2424

2525
% end

CodeGeneration/Sources/SyntaxSupport/BuilderInitializableTypes.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
// This source file is part of the Swift.org open source project
1212
//
13-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
13+
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
1414
// Licensed under Apache License v2.0 with Runtime Library Exception
1515
//
1616
// See https://swift.org/LICENSE.txt for license information

CodeGeneration/Sources/SyntaxSupport/Child.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information

CodeGeneration/Sources/SyntaxSupport/Classification.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//
1212
// This source file is part of the Swift.org open source project
1313
//
14-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
14+
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
1515
// Licensed under Apache License v2.0 with Runtime Library Exception
1616
//
1717
// See https://swift.org/LICENSE.txt for license information
@@ -52,7 +52,7 @@ public class ChildClassification {
5252

5353

5454
public let SYNTAX_CLASSIFICATIONS: [SyntaxClassification] = [
55-
% for syntaxClassification in SYNTAX_CLASSIFICATIONS:
55+
% for syntaxClassification in sorted(SYNTAX_CLASSIFICATIONS, key=lambda x: x.name):
5656
SyntaxClassification(name: "${syntaxClassification.name}", description: "${syntaxClassification.description.strip()}"),
5757
% end
5858
]

CodeGeneration/Sources/SyntaxSupport/CommonNodes.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
// This source file is part of the Swift.org open source project
1212
//
13-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
13+
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
1414
// Licensed under Apache License v2.0 with Runtime Library Exception
1515
//
1616
// See https://swift.org/LICENSE.txt for license information
@@ -19,7 +19,7 @@
1919
//===----------------------------------------------------------------------===//
2020

2121
public let COMMON_NODES: [Node] = [
22-
% for node in COMMON_NODES:
22+
% for node in sorted(COMMON_NODES, key=lambda x: x.name):
2323
${make_swift_node(node)},
2424

2525
% end

CodeGeneration/Sources/SyntaxSupport/DeclNodes.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
// This source file is part of the Swift.org open source project
1212
//
13-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
13+
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
1414
// Licensed under Apache License v2.0 with Runtime Library Exception
1515
//
1616
// See https://swift.org/LICENSE.txt for license information
@@ -19,7 +19,7 @@
1919
//===----------------------------------------------------------------------===//
2020

2121
public let DECL_NODES: [Node] = [
22-
% for node in DECL_NODES:
22+
% for node in sorted(DECL_NODES, key=lambda x: x.name):
2323
${make_swift_node(node)},
2424

2525
% end

CodeGeneration/Sources/SyntaxSupport/ExprNodes.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
// This source file is part of the Swift.org open source project
1212
//
13-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
13+
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
1414
// Licensed under Apache License v2.0 with Runtime Library Exception
1515
//
1616
// See https://swift.org/LICENSE.txt for license information
@@ -19,7 +19,7 @@
1919
//===----------------------------------------------------------------------===//
2020

2121
public let EXPR_NODES: [Node] = [
22-
% for node in EXPR_NODES:
22+
% for node in sorted(EXPR_NODES, key=lambda x: x.name):
2323
${make_swift_node(node)},
2424

2525
% end

CodeGeneration/Sources/SyntaxSupport/GenericNodes.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
// This source file is part of the Swift.org open source project
1212
//
13-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
13+
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
1414
// Licensed under Apache License v2.0 with Runtime Library Exception
1515
//
1616
// See https://swift.org/LICENSE.txt for license information
@@ -19,7 +19,7 @@
1919
//===----------------------------------------------------------------------===//
2020

2121
public let GENERIC_NODES: [Node] = [
22-
% for node in GENERIC_NODES:
22+
% for node in sorted(GENERIC_NODES, key=lambda x: x.name):
2323
${make_swift_node(node)},
2424

2525
% end

CodeGeneration/Sources/SyntaxSupport/KeywordSpec.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information

CodeGeneration/Sources/SyntaxSupport/Node.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information

CodeGeneration/Sources/SyntaxSupport/PatternNodes.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
// This source file is part of the Swift.org open source project
1212
//
13-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
13+
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
1414
// Licensed under Apache License v2.0 with Runtime Library Exception
1515
//
1616
// See https://swift.org/LICENSE.txt for license information
@@ -19,7 +19,7 @@
1919
//===----------------------------------------------------------------------===//
2020

2121
public let PATTERN_NODES: [Node] = [
22-
% for node in PATTERN_NODES:
22+
% for node in sorted(PATTERN_NODES, key=lambda x: x.name):
2323
${make_swift_node(node)},
2424

2525
% end

CodeGeneration/Sources/SyntaxSupport/StmtNodes.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
// This source file is part of the Swift.org open source project
1212
//
13-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
13+
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
1414
// Licensed under Apache License v2.0 with Runtime Library Exception
1515
//
1616
// See https://swift.org/LICENSE.txt for license information
@@ -19,7 +19,7 @@
1919
//===----------------------------------------------------------------------===//
2020

2121
public let STMT_NODES: [Node] = [
22-
% for node in STMT_NODES:
22+
% for node in sorted(STMT_NODES, key=lambda x: x.name):
2323
${make_swift_node(node)},
2424

2525
% end

CodeGeneration/Sources/SyntaxSupport/SyntaxBaseKinds.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
// This source file is part of the Swift.org open source project
1212
//
13-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
13+
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
1414
// Licensed under Apache License v2.0 with Runtime Library Exception
1515
//
1616
// See https://swift.org/LICENSE.txt for license information

CodeGeneration/Sources/SyntaxSupport/SyntaxNodes.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information

CodeGeneration/Sources/SyntaxSupport/TokenSpec.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
// This source file is part of the Swift.org open source project
1212
//
13-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
13+
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
1414
// Licensed under Apache License v2.0 with Runtime Library Exception
1515
//
1616
// See https://swift.org/LICENSE.txt for license information
@@ -175,7 +175,7 @@ public class LiteralSpec: TokenSpec { }
175175
public class MiscSpec: TokenSpec { }
176176

177177
public let SYNTAX_TOKENS: [TokenSpec] = [
178-
% for token in SYNTAX_TOKENS:
178+
% for token in sorted(SYNTAX_TOKENS, key=lambda x: x.name):
179179
% class_name = type(token).__name__
180180
% classification = "classification: \"%s\"" % token.classification.name if token.classification.name not in ['None', 'Keyword', 'ObjectLiteral', 'PoundDirectiveKeyword'] or class_name == 'Misc' and token.classification.name != 'None' else None
181181
% parameters = ["name: \"%s\"" % token.name]

CodeGeneration/Sources/SyntaxSupport/Traits.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
// This source file is part of the Swift.org open source project
1212
//
13-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
13+
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
1414
// Licensed under Apache License v2.0 with Runtime Library Exception
1515
//
1616
// See https://swift.org/LICENSE.txt for license information
@@ -31,7 +31,7 @@ public class Trait {
3131
}
3232

3333
public let TRAITS: [Trait] = [
34-
% for trait in TRAITS:
34+
% for trait in sorted(TRAITS, key=lambda x: x.trait_name):
3535
Trait(traitName: "${trait.trait_name}",
3636
children: [
3737
% for child in trait.children:

CodeGeneration/Sources/SyntaxSupport/Trivia.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//
1010
// This source file is part of the Swift.org open source project
1111
//
12-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
12+
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
1313
// Licensed under Apache License v2.0 with Runtime Library Exception
1414
//
1515
// See https://swift.org/LICENSE.txt for license information
@@ -66,7 +66,7 @@ public class Trivia {
6666
}
6767

6868
public let TRIVIAS: [Trivia] = [
69-
% for trivia in TRIVIAS:
69+
% for trivia in sorted(TRIVIAS, key=lambda x: x.name):
7070
% parameters = [
7171
% 'name: "%s"' % trivia.name,
7272
% 'comment: #"%s"#' % trivia.comment,

CodeGeneration/Sources/SyntaxSupport/TypeNodes.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
// This source file is part of the Swift.org open source project
1212
//
13-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
13+
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
1414
// Licensed under Apache License v2.0 with Runtime Library Exception
1515
//
1616
// See https://swift.org/LICENSE.txt for license information
@@ -19,7 +19,7 @@
1919
//===----------------------------------------------------------------------===//
2020

2121
public let TYPE_NODES: [Node] = [
22-
% for node in TYPE_NODES:
22+
% for node in sorted(TYPE_NODES, key=lambda x: x.name):
2323
${make_swift_node(node)},
2424

2525
% end

CodeGeneration/Sources/SyntaxSupport/Utils.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information

CodeGeneration/Sources/SyntaxSupport/gyb_generated/AttributeKinds.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// This source file is part of the Swift.org open source project
66
//
7-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
7+
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
88
// Licensed under Apache License v2.0 with Runtime Library Exception
99
//
1010
// See https://swift.org/LICENSE.txt for license information

0 commit comments

Comments
 (0)