Skip to content

Commit c808498

Browse files
authored
Merge pull request #1841 from joey-gm/documentation
Documentation - Typos & Consistency Fixes
2 parents 8119337 + f8ed0c4 commit c808498

File tree

88 files changed

+482
-482
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+482
-482
lines changed

Changelog.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ For increased performance, the modelling of the syntax node hierarchy has been s
138138
```swift
139139
let identifierExprSyntax: IdentifierExprSyntax = /* ... */
140140
let node = Syntax(identifierExprSyntax)
141-
node.asProtocol(SyntaxProtocol.self) // returns a IdentifierExprSyntax with static type SyntaxProtocol
142-
node.asProtocol(ExprSyntaxProtocol.self) // returns a IdentifierExprSyntax with static type ExprSyntaxProtocol?
141+
node.asProtocol(SyntaxProtocol.self) // returns an IdentifierExprSyntax with static type SyntaxProtocol
142+
node.asProtocol(ExprSyntaxProtocol.self) // returns an IdentifierExprSyntax with static type ExprSyntaxProtocol?
143143
```
144144

145145

CodeGeneration/Sources/SyntaxSupport/AvailabilityNodes.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public let AVAILABILITY_NODES: [Node] = [
6060
kind: .availabilityLabeledArgument,
6161
base: .syntax,
6262
nameForDiagnostics: "availability argument",
63-
documentation: "A argument to an `@available` attribute that consists of a label and a value, e.g. `message: \"This has been deprecated\"`.",
63+
documentation: "An argument to an `@available` attribute that consists of a label and a value, e.g. `message: \"This has been deprecated\"`.",
6464
children: [
6565
Child(
6666
name: "Label",

CodeGeneration/Sources/SyntaxSupport/CommonNodes.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public let COMMON_NODES: [Node] = [
191191
kind: .missingExpr,
192192
base: .expr,
193193
nameForDiagnostics: "expression",
194-
documentation: "In case the source code is missing a expression, this node stands in place of the missing expression.",
194+
documentation: "In case the source code is missing an expression, this node stands in place of the missing expression.",
195195
children: [
196196
Child(
197197
name: "Placeholder",

CodeGeneration/Sources/SyntaxSupport/DeclNodes.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,7 @@ public let DECL_NODES: [Node] = [
13411341
name: "Signature",
13421342
kind: .node(kind: .functionSignature),
13431343
nameForDiagnostics: "function signature",
1344-
documentation: "The arguments of the initializer. While the function signature allows specifying an return clause, doing so is not semantically valid."
1344+
documentation: "The arguments of the initializer. While the function signature allows specifying a return clause, doing so is not semantically valid."
13451345
),
13461346
Child(
13471347
name: "GenericWhereClause",
@@ -1353,7 +1353,7 @@ public let DECL_NODES: [Node] = [
13531353
Child(
13541354
name: "Body",
13551355
kind: .node(kind: .codeBlock),
1356-
documentation: "The initializer’s body. Missing if the initialier is a requirement of a protocol declaration.",
1356+
documentation: "The initializer’s body. Missing if the initializer is a requirement of a protocol declaration.",
13571357
isOptional: true
13581358
),
13591359
]

CodeGeneration/Sources/SyntaxSupport/ExprNodes.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ public let EXPR_NODES: [Node] = [
864864
// else-clause ';'?
865865
//
866866
// This node represents both an 'if' expression, as well as an 'if' statement
867-
// when wrapped in a ExpressionStmt node.
867+
// when wrapped in an ExpressionStmt node.
868868
Node(
869869
kind: .ifExpr,
870870
base: .expr,
@@ -1652,7 +1652,7 @@ public let EXPR_NODES: [Node] = [
16521652
// switch-case-list '}' ';'?
16531653
//
16541654
// This node represents both a 'switch' expression, as well as a 'switch'
1655-
// statement when wrapped in a ExpressionStmt node.
1655+
// statement when wrapped in an ExpressionStmt node.
16561656
Node(
16571657
kind: .switchExpr,
16581658
base: .expr,

CodeGeneration/Sources/SyntaxSupport/Node.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import SwiftSyntax
1616
/// The definition of a syntax node that, when generated, conforms to
1717
/// `SyntaxProtocol`.
1818
///
19-
/// There are two fundemantally different kinds of nodes:
19+
/// There are two fundamentally different kinds of nodes:
2020
/// - Layout nodes contain a fixed number of children of possibly different,
2121
/// but fixed types.
2222
/// - Collection nodes contains an arbitrary number of children but all those
@@ -253,14 +253,14 @@ public struct CollectionNode {
253253
self.node = node
254254
}
255255

256-
/// Allow transparent accesss to the properties of the underlying `Node`.
256+
/// Allow transparent access to the properties of the underlying `Node`.
257257
public subscript<T>(dynamicMember keyPath: KeyPath<Node, T>) -> T {
258258
return node[keyPath: keyPath]
259259
}
260260

261261
/// The kinds the elements can have.
262262
///
263-
/// This can be more than one in which case each element an have either of
263+
/// This can be more than one in which case each element can have either of
264264
/// these kinds.
265265
public var elementChoices: [SyntaxNodeKind] {
266266
switch node.data {

CodeGeneration/Sources/SyntaxSupport/SyntaxNodeKind.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ public enum SyntaxNodeKind: String, CaseIterable {
304304
case yieldList
305305
case yieldStmt
306306

307-
// Nodes that have special handling throught the codebase
307+
// Nodes that have special handling throughout the codebase
308308

309309
case syntax
310310
case syntaxCollection

CodeGeneration/Sources/Utils/CodeGenerationFormat.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public class CodeGenerationFormat: BasicFormat {
9292
// MARK: - Private
9393

9494
private func shouldBeSeparatedByTwoNewlines(node: CodeBlockItemSyntax) -> Bool {
95-
// First item in the ``CodeBlockItemListSyntax`` don't need a newline or identation if the parent is a ``SourceFileSyntax``.
95+
// First item in the ``CodeBlockItemListSyntax`` don't need a newline or indentation if the parent is a ``SourceFileSyntax``.
9696
// We want to group imports so newline between them should be omitted
9797
return node.parent?.as(CodeBlockItemListSyntax.self)?.first == node || node.item.is(ImportDeclSyntax.self)
9898
}

CodeGeneration/Sources/Utils/SyntaxBuildableChild.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public extension Child {
111111

112112
let choicesTexts: [String]
113113
if tokenCanContainArbitraryText {
114-
// Don't generate an precondition statement if token can contain arbitrary text.
114+
// Don't generate a precondition statement if token can contain arbitrary text.
115115
return nil
116116
} else if !choices.isEmpty {
117117
choicesTexts = choices.compactMap {

CodeGeneration/Sources/Utils/SyntaxBuildableType.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public struct SyntaxBuildableType: Hashable {
140140
return optionalWrapped(type: SimpleTypeIdentifierSyntax(name: .identifier(syntaxBaseName)))
141141
}
142142

143-
/// The type that is used for paramters in SwiftSyntaxBuilder that take this
143+
/// The type that is used for parameters in SwiftSyntaxBuilder that take this
144144
/// type of syntax node.
145145
public var parameterBaseType: String {
146146
if isBaseType {

0 commit comments

Comments
 (0)