Skip to content

Commit d394d84

Browse files
committed
Add ExpressibleAsConformances to syntax builder generation
1 parent 2222351 commit d394d84

File tree

5 files changed

+93
-0
lines changed

5 files changed

+93
-0
lines changed

Package.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ let package = Package(
107107
"Classification.swift.gyb",
108108
"CommonNodes.swift.gyb",
109109
"DeclNodes.swift.gyb",
110+
"ExpressibleAsConformances.swift.gyb",
110111
"ExprNodes.swift.gyb",
111112
"GenericNodes.swift.gyb",
112113
"Kinds.swift.gyb",
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
%{
2+
from gyb_syntax_support import *
3+
from gyb_helpers import SYNTAX_BUILDABLE_EXPRESSIBLE_AS_CONFORMANCES
4+
# -*- mode: Swift -*-
5+
# Ignore the following admonition; it applies to the resulting .swift file only
6+
}%
7+
//// Automatically Generated From ExpressibleAsConformances.swift.gyb.
8+
//// Do Not Edit Directly!
9+
//===----------------------------------------------------------------------===//
10+
//
11+
// This source file is part of the Swift.org open source project
12+
//
13+
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
14+
// Licensed under Apache License v2.0 with Runtime Library Exception
15+
//
16+
// See https://swift.org/LICENSE.txt for license information
17+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
18+
//
19+
//===----------------------------------------------------------------------===//
20+
21+
let SYNTAX_BUILDABLE_EXPRESSIBLE_AS_CONFORMANCES: [String: [String]] = [
22+
% for buildable, conformances in SYNTAX_BUILDABLE_EXPRESSIBLE_AS_CONFORMANCES.items():
23+
"${buildable}": [
24+
% for conformance in conformances:
25+
"${conformance}",
26+
% end
27+
],
28+
% end
29+
]
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
//// Automatically Generated From ExpressibleAsConformances.swift.gyb.
2+
//// Do Not Edit Directly!
3+
//===----------------------------------------------------------------------===//
4+
//
5+
// This source file is part of the Swift.org open source project
6+
//
7+
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
8+
// Licensed under Apache License v2.0 with Runtime Library Exception
9+
//
10+
// See https://swift.org/LICENSE.txt for license information
11+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
12+
//
13+
//===----------------------------------------------------------------------===//
14+
15+
let SYNTAX_BUILDABLE_EXPRESSIBLE_AS_CONFORMANCES: [String: [String]] = [
16+
"AccessorList": [
17+
"AccessorBlock",
18+
],
19+
"ArrayType": [
20+
"TypeAnnotation",
21+
],
22+
"CodeBlockItemList": [
23+
"CodeBlock",
24+
],
25+
"DeclBuildable": [
26+
"CodeBlockItem",
27+
"MemberDeclListItem",
28+
],
29+
"DictionaryType": [
30+
"TypeAnnotation",
31+
],
32+
"ExprList": [
33+
"ConditionElement",
34+
],
35+
"FunctionCallExpr": [
36+
"CodeBlockItem",
37+
],
38+
"MemberDeclList": [
39+
"MemberDeclBlock",
40+
],
41+
"SequenceExpr": [
42+
"CodeBlockItem",
43+
"TupleExprElement",
44+
],
45+
"SimpleTypeIdentifier": [
46+
"TypeAnnotation",
47+
"TypeExpr",
48+
],
49+
"StmtBuildable": [
50+
"CodeBlockItem",
51+
],
52+
"TokenSyntax": [
53+
"BinaryOperatorExpr",
54+
"DeclModifier",
55+
"IdentifierExpr",
56+
],
57+
"TypeBuildable": [
58+
"ReturnClause",
59+
"TypeInitializerClause",
60+
],
61+
]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../SwiftSyntaxBuilder/gyb_helpers/ExpressibleAsConformances.py
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
from .utils import make_swift_child, make_swift_node
2+
from .ExpressibleAsConformances import SYNTAX_BUILDABLE_EXPRESSIBLE_AS_CONFORMANCES

0 commit comments

Comments
 (0)