20
20
//===----------------------------------------------------------------------===//
21
21
22
22
extension Syntax {
23
- /// Syntax nodes always conform to SyntaxProtocol. This API is just added
24
- /// for consistency.
25
- /// Note that this will incur an existential conversion.
26
- @available ( * , deprecated, message: " Expression always evaluates to true " )
27
- public func isProtocol( _: SyntaxProtocol . Protocol ) -> Bool {
28
- return true
29
- }
30
-
31
- /// Return the non-type erased version of this syntax node.
32
- /// Note that this will incur an existential conversion.
33
- public func asProtocol( _: SyntaxProtocol . Protocol ) -> SyntaxProtocol {
34
- switch self . as ( SyntaxEnum . self) {
35
- case . token( let node) :
36
- return node
37
- case . unknown( let node) :
38
- return node
39
- % for node in NON_BASE_SYNTAX_NODES:
40
- case . ${ node. swift_syntax_kind} ( let node) :
41
- return node
42
- % end
43
- }
44
- }
45
-
46
23
public static var structure : SyntaxNodeStructure {
47
24
return . choices( [
48
25
. node( UnknownSyntax . self) ,
@@ -56,19 +33,6 @@ extension Syntax {
56
33
% end
57
34
] )
58
35
}
59
-
60
- public func childNameForDiagnostics( _ index: SyntaxChildrenIndex ) -> String ? {
61
- switch self . as ( SyntaxEnum . self) {
62
- case . token( let node) :
63
- return node. childNameForDiagnostics ( index)
64
- case . unknown( let node) :
65
- return node. childNameForDiagnostics ( index)
66
- % for node in NON_BASE_SYNTAX_NODES:
67
- case . ${ node. swift_syntax_kind} ( let node) :
68
- return node. childNameForDiagnostics ( index)
69
- % end
70
- }
71
- }
72
36
}
73
37
74
38
extension SyntaxKind {
0 commit comments