@@ -25,6 +25,7 @@ let IncrementalParseUtilsFile = SourceFileSyntax(leadingTrivia: copyrightHeader)
25
25
) {
26
26
try VariableDeclSyntax (
27
27
"""
28
+ /// This property presents the first potential ``TokenSpec``s of all ``SyntaxKind``s
28
29
@_spi(IncrementalParse)
29
30
public var firstPotentialTokenKind: [TokenSpec]
30
31
"""
@@ -33,7 +34,7 @@ let IncrementalParseUtilsFile = SourceFileSyntax(leadingTrivia: copyrightHeader)
33
34
34
35
for node in NON_BASE_SYNTAX_NODES {
35
36
SwitchCaseSyntax ( " case . \( node. varOrCaseName) : " ) {
36
- StmtSyntax ( " return [ \( raw: Set ( node. firstPotentialToken. map { $0. descriptionAsTokenSpec} ) . joined ( separator: " , " ) ) ] " )
37
+ StmtSyntax ( " return [ \( raw: Set ( node. firstPotentialToken. map { $0. descriptionAsTokenSpec} ) . sorted ( ) . joined ( separator: " , " ) ) ] " )
37
38
}
38
39
}
39
40
SwitchCaseSyntax ( " default: " ) {
@@ -44,6 +45,8 @@ let IncrementalParseUtilsFile = SourceFileSyntax(leadingTrivia: copyrightHeader)
44
45
45
46
try VariableDeclSyntax (
46
47
"""
48
+ /// This property presents children of nodes in the form of ``SyntaxKind``.
49
+ /// All potential children kinds are listed in the internal array.
47
50
@_spi(RawSyntax)
48
51
public var syntaxLayout: [[SyntaxKind]]
49
52
"""
@@ -71,6 +74,9 @@ let IncrementalParseUtilsFile = SourceFileSyntax(leadingTrivia: copyrightHeader)
71
74
) {
72
75
DeclSyntax (
73
76
"""
77
+ /// This property is used to calculate the next potential token
78
+ /// of a ``Syntax``, which is essentially the next expected optional child of a node, and will be located by the last
79
+ /// non-nil child of the node.
74
80
public var nextPotentialTokenChoices: [TokenSpec] {
75
81
if let children = self.layoutView?.children,
76
82
let lastNonNilChildIdx = children.lastIndex(where: { $0 != nil }),
0 commit comments