Skip to content

Commit e231987

Browse files
committed
Sort nodes, tokens, token kinds and trivia
1 parent 02da1a1 commit e231987

33 files changed

+3722
-3722
lines changed

CodeGeneration/Sources/SyntaxSupport/AttributeNodes.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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/Classification.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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/PatternNodes.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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/TokenSpec.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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]

0 commit comments

Comments
 (0)