Skip to content

Commit f372c85

Browse files
committed
Minor changes on documentation
Rerun CodeGeneration
1 parent 4c23aaf commit f372c85

File tree

7 files changed

+12
-10
lines changed

7 files changed

+12
-10
lines changed

CodeGeneration/Sources/SyntaxSupport/AvailabilityNodes.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public let AVAILABILITY_NODES: [Node] = [
151151
Node(
152152
name: "VersionTuple",
153153
nameForDiagnostics: "version tuple",
154-
description: "A version number of the form major.minor.patch in which the minor and patch part may be omitted.",
154+
description: "A version number like `1.2.0`. Only the first version component is required. There might be an arbitrary number of following components.",
155155
kind: "Syntax",
156156
children: [
157157
Child(
@@ -162,6 +162,7 @@ public let AVAILABILITY_NODES: [Node] = [
162162
Child(
163163
name: "Components",
164164
kind: .collection(kind: "VersionComponentList", collectionElementName: "VersionComponent"),
165+
description: "Any version components that are not the major version . For example, for `1.2.0`, this will contain `.2.0`",
165166
isOptional: true
166167
),
167168
]

CodeGeneration/Sources/SyntaxSupport/ExprNodes.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,12 @@ public let EXPR_NODES: [Node] = [
188188
// the canImport expr in if config expression
189189
Node(
190190
name: "CanImportExpr",
191-
nameForDiagnostics: "'canImport' expression in if config expression",
191+
nameForDiagnostics: "'canImport' expression",
192192
kind: "Expr",
193193
children: [
194194
Child(
195195
name: "CanImportKeyword",
196-
kind: .token(choices: [.token(tokenKind: "IdentifierToken")])
196+
kind: .token(choices: [.keyword(text: "canImport")])
197197
),
198198
Child(
199199
name: "LeftParen",
@@ -215,7 +215,7 @@ public let EXPR_NODES: [Node] = [
215215
),
216216
Child(
217217
name: "Colon",
218-
kind: .token(choices: [.keyword(text: "ColonToken")]),
218+
kind: .token(choices: [.token(tokenKind: "ColonToken")]),
219219
isOptional: true
220220
),
221221
Child(

Sources/SwiftParserDiagnostics/generated/SyntaxKindNameForDiagnostics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ extension SyntaxKind {
7070
case .breakStmt:
7171
return "'break' statement"
7272
case .canImportExpr:
73-
return "'canImport' expression in if config expression"
73+
return "'canImport' expression"
7474
case .catchClauseList:
7575
return "'catch' clause"
7676
case .catchClause:

Sources/SwiftSyntax/generated/raw/RawSyntaxValidation.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ func validateLayout(layout: RawSyntaxBuffer, as kind: SyntaxKind) {
514514
case .canImportExpr:
515515
assert(layout.count == 17)
516516
assertNoError(kind, 0, verify(layout[0], as: RawUnexpectedNodesSyntax?.self))
517-
assertNoError(kind, 1, verify(layout[1], as: RawTokenSyntax.self, tokenChoices: [.tokenKind(.identifier)]))
517+
assertNoError(kind, 1, verify(layout[1], as: RawTokenSyntax.self, tokenChoices: [.keyword("canImport")]))
518518
assertNoError(kind, 2, verify(layout[2], as: RawUnexpectedNodesSyntax?.self))
519519
assertNoError(kind, 3, verify(layout[3], as: RawTokenSyntax.self, tokenChoices: [.tokenKind(.leftParen)]))
520520
assertNoError(kind, 4, verify(layout[4], as: RawUnexpectedNodesSyntax?.self))
@@ -524,7 +524,7 @@ func validateLayout(layout: RawSyntaxBuffer, as kind: SyntaxKind) {
524524
assertNoError(kind, 8, verify(layout[8], as: RawUnexpectedNodesSyntax?.self))
525525
assertNoError(kind, 9, verify(layout[9], as: RawTokenSyntax?.self, tokenChoices: [.keyword("_version"), .keyword("_underlyingVersion")]))
526526
assertNoError(kind, 10, verify(layout[10], as: RawUnexpectedNodesSyntax?.self))
527-
assertNoError(kind, 11, verify(layout[11], as: RawTokenSyntax?.self, tokenChoices: [.keyword("ColonToken")]))
527+
assertNoError(kind, 11, verify(layout[11], as: RawTokenSyntax?.self, tokenChoices: [.tokenKind(.colon)]))
528528
assertNoError(kind, 12, verify(layout[12], as: RawUnexpectedNodesSyntax?.self))
529529
assertNoError(kind, 13, verify(layout[13], as: RawVersionTupleSyntax?.self))
530530
assertNoError(kind, 14, verify(layout[14], as: RawUnexpectedNodesSyntax?.self))

Sources/SwiftSyntax/generated/syntaxNodes/SyntaxExprNodes.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ public struct CanImportExprSyntax: ExprSyntaxProtocol, SyntaxHashable {
947947
public init(
948948
leadingTrivia: Trivia? = nil,
949949
_ unexpectedBeforeCanImportKeyword: UnexpectedNodesSyntax? = nil,
950-
canImportKeyword: TokenSyntax,
950+
canImportKeyword: TokenSyntax = .keyword(.canImport),
951951
_ unexpectedBetweenCanImportKeywordAndLeftParen: UnexpectedNodesSyntax? = nil,
952952
leftParen: TokenSyntax = .leftParenToken(),
953953
_ unexpectedBetweenLeftParenAndImportPath: UnexpectedNodesSyntax? = nil,

Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodes.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17552,7 +17552,7 @@ public struct VersionComponentSyntax: SyntaxProtocol, SyntaxHashable {
1755217552

1755317553
// MARK: - VersionTupleSyntax
1755417554

17555-
/// A version number of the form major.minor.patch in which the minor and patch part may be omitted.
17555+
/// A version number like `1.2.0`. Only the first version component is required. There might be an arbitrary number of following components.
1755617556
public struct VersionTupleSyntax: SyntaxProtocol, SyntaxHashable {
1755717557
public let _syntaxNode: Syntax
1755817558

@@ -17638,6 +17638,7 @@ public struct VersionTupleSyntax: SyntaxProtocol, SyntaxHashable {
1763817638
}
1763917639
}
1764017640

17641+
/// Any version components that are not the major version . For example, for `1.2.0`, this will contain `.2.0`
1764117642
public var components: VersionComponentListSyntax? {
1764217643
get {
1764317644
return data.child(at: 3, parent: Syntax(self)).map(VersionComponentListSyntax.init)

Tests/SwiftParserTest/translated/IfconfigExprTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ final class IfconfigExprTests: XCTestCase {
370370
#endif
371371
""",
372372
diagnostics: [
373-
DiagnosticSpec(message: "expected version tuple in 'canImport' expression in if config expression", fixIts: ["insert version tuple"])
373+
DiagnosticSpec(message: "expected version tuple in 'canImport' expression", fixIts: ["insert version tuple"])
374374
],
375375
fixedSource: """
376376
#if canImport(A, _version: <#integer literal#>)

0 commit comments

Comments
 (0)