From a654949afa46f612da4703bf4ee832f14d55cdef Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Thu, 1 Aug 2024 14:33:58 -0700 Subject: [PATCH 1/9] Create a dedicated type for the `rootId` of a tree MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Passing a `UInt` around has always felt a little unsafe and didn’t give any semantic meaning that describes what the `UInt` represents. --- Sources/SwiftSyntax/AbsoluteRawSyntax.swift | 2 +- Sources/SwiftSyntax/SyntaxChildren.swift | 4 ++-- Sources/SwiftSyntax/SyntaxIdentifier.swift | 18 +++++++++++++++--- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Sources/SwiftSyntax/AbsoluteRawSyntax.swift b/Sources/SwiftSyntax/AbsoluteRawSyntax.swift index a3f5aec25e7..453d799c673 100644 --- a/Sources/SwiftSyntax/AbsoluteRawSyntax.swift +++ b/Sources/SwiftSyntax/AbsoluteRawSyntax.swift @@ -39,7 +39,7 @@ struct AbsoluteRawSyntax: Sendable { return nil } - func replacingSelf(_ newRaw: RawSyntax, newRootId: UInt) -> AbsoluteRawSyntax { + func replacingSelf(_ newRaw: RawSyntax, newRootId: RootID) -> AbsoluteRawSyntax { let nodeId = SyntaxIdentifier(rootId: newRootId, indexInTree: info.nodeId.indexInTree) let newInfo = AbsoluteSyntaxInfo(position: info.position, nodeId: nodeId) return .init(raw: newRaw, info: newInfo) diff --git a/Sources/SwiftSyntax/SyntaxChildren.swift b/Sources/SwiftSyntax/SyntaxChildren.swift index 5457797679a..42a51129419 100644 --- a/Sources/SwiftSyntax/SyntaxChildren.swift +++ b/Sources/SwiftSyntax/SyntaxChildren.swift @@ -102,7 +102,7 @@ public struct SyntaxChildrenIndex: Hashable, Comparable, ExpressibleByNilLiteral fileprivate extension AbsoluteSyntaxInfo { /// Construct `AbsoluteSyntaxInfo` from the given index data and a `rootId`. - init(index: SyntaxChildrenIndexData, rootId: UInt) { + init(index: SyntaxChildrenIndexData, rootId: RootID) { let position = AbsoluteSyntaxPosition( offset: index.offset, indexInParent: index.indexInParent @@ -152,7 +152,7 @@ struct RawSyntaxChildren: BidirectionalCollection, Sendable { } /// The rootId of the tree the child nodes belong to - private let rootId: UInt + private let rootId: RootID /// The number of children in `parent`. Cached to avoid reaching into `parent` for every index /// advancement diff --git a/Sources/SwiftSyntax/SyntaxIdentifier.swift b/Sources/SwiftSyntax/SyntaxIdentifier.swift index 55d7f52d105..e3417e32cfc 100644 --- a/Sources/SwiftSyntax/SyntaxIdentifier.swift +++ b/Sources/SwiftSyntax/SyntaxIdentifier.swift @@ -10,6 +10,18 @@ // //===----------------------------------------------------------------------===// +/// Uniquely identifies a syntax tree. +struct RootID: Hashable, Sendable { + /// The pointer value of the root. + /// + /// Since the root ID might outlive the tree, it is not unsafe to access this. + private var id: UInt + + fileprivate init(_ pointer: UnsafeRawPointer) { + self.id = UInt(bitPattern: pointer) + } +} + /// Provides a stable and unique identity for ``Syntax`` nodes. /// /// Note that two nodes might have the same contents even if their IDs are @@ -74,14 +86,14 @@ public struct SyntaxIdentifier: Comparable, Hashable, Sendable { /// same instance. This guarantees that the trees with the same 'rootId' have /// exact the same structure. But, two trees with exactly the same structure /// might still have different 'rootId's. - let rootId: UInt + let rootId: RootID /// Unique value for a node within its own tree. public let indexInTree: SyntaxIndexInTree /// Returns the `UInt` that is used as the root ID for the given raw syntax node. - private static func rootId(of raw: RawSyntax) -> UInt { - return UInt(bitPattern: raw.pointer.unsafeRawPointer) + private static func rootId(of raw: RawSyntax) -> RootID { + return RootID(raw.pointer.unsafeRawPointer) } func advancedBySibling(_ raw: RawSyntax?) -> SyntaxIdentifier { From c856699b93c67035f682e38fd6f329d6d292d56b Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Thu, 1 Aug 2024 14:34:09 -0700 Subject: [PATCH 2/9] Make underlying data structures of `SyntaxData.Info` classes insted of structs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will allow us to add more data to `SyntaxData.Info.Root` without increasing the size of `SyntaxData`. It shouldn’t have a big performance impact at the moment since `Root.arena` is never accessed and only exists to keep `arena` a live. --- Sources/SwiftSyntax/Syntax.swift | 54 +++++++++++++++++--- Sources/SwiftSyntax/SyntaxNodeFactory.swift | 2 +- Tests/SwiftSyntaxTest/MemoryLayoutTest.swift | 2 +- 3 files changed, 49 insertions(+), 9 deletions(-) diff --git a/Sources/SwiftSyntax/Syntax.swift b/Sources/SwiftSyntax/Syntax.swift index f6051f85ec5..503701d51d8 100644 --- a/Sources/SwiftSyntax/Syntax.swift +++ b/Sources/SwiftSyntax/Syntax.swift @@ -23,21 +23,58 @@ public struct Syntax: SyntaxProtocol, SyntaxHashable { final class Info: @unchecked Sendable { // For root node. struct Root: Sendable { - private var arena: RetainedSyntaxArena + private let arena: RetainedSyntaxArena init(arena: RetainedSyntaxArena) { self.arena = arena } } + /// Class that owns a `Root`, is responsible for keeping it alive and also offers an unsafe pointer way to + /// access it. + /// + /// This way, the root node of a tree can own the root info and all other nodes in the tree can have an unsafe + /// pointer reference to the root info, which doesn't involve ref counting. + final class RefCountedRoot: Sendable { + /// `nonisolated(unsafe)` if fine because there are only two ways this gets accessed: + /// - `pointer`: Here we reference `value` via inout to get a pointer to `Root` but the pointer is not mutable + /// so no mutation happens here + #if swift(>=6) + private nonisolated(unsafe) var value: Root + #else + private var value: Root + #endif + + fileprivate init(_ value: Root) { + self.value = value + } + + fileprivate var pointer: UnsafePointer { + return withUnsafePointer(to: &value) { $0 } + } + } + // For non-root nodes. struct NonRoot: Sendable { var parent: Syntax var absoluteInfo: AbsoluteSyntaxInfo + // `nonisolated(unsafe)` is fine because `Root` is owned by `RefCountedRoot` and `RefCountedRoot` guarantees that + // `Root` is not changing after the tree has been created. + #if swift(>=6) + nonisolated(unsafe) var rootInfo: UnsafePointer + #else + var rootInfo: UnsafePointer + #endif + + init(parent: Syntax, absoluteInfo: AbsoluteSyntaxInfo, rootInfo: UnsafePointer) { + self.parent = parent + self.absoluteInfo = absoluteInfo + self.rootInfo = rootInfo + } } enum InfoImpl: Sendable { - case root(Root) + case root(RefCountedRoot) case nonRoot(NonRoot) } @@ -67,9 +104,9 @@ public struct Syntax: SyntaxProtocol, SyntaxHashable { var info: Info! let raw: RawSyntax - private var rootInfo: Info.Root { + var rootInfo: UnsafePointer { switch info.info! { - case .root(let info): return info + case .root(let info): return info.pointer case .nonRoot(let info): return info.parent.rootInfo } } @@ -135,7 +172,7 @@ public struct Syntax: SyntaxProtocol, SyntaxHashable { } init(_ raw: RawSyntax, parent: Syntax, absoluteInfo: AbsoluteSyntaxInfo) { - self.init(raw, info: Info(.nonRoot(.init(parent: parent, absoluteInfo: absoluteInfo)))) + self.init(raw, info: Info(.nonRoot(.init(parent: parent, absoluteInfo: absoluteInfo, rootInfo: parent.rootInfo)))) } /// Creates a `Syntax` with the provided raw syntax and parent. @@ -155,12 +192,15 @@ public struct Syntax: SyntaxProtocol, SyntaxHashable { /// has a chance to retain it. static func forRoot(_ raw: RawSyntax, rawNodeArena: RetainedSyntaxArena) -> Syntax { precondition(rawNodeArena == raw.arenaReference) - return Syntax(raw, info: Info(.root(.init(arena: rawNodeArena)))) + return Syntax(raw, info: Info(.root(Syntax.Info.RefCountedRoot(Syntax.Info.Root(arena: rawNodeArena))))) } static func forRoot(_ raw: RawSyntax, rawNodeArena: SyntaxArena) -> Syntax { precondition(rawNodeArena == raw.arenaReference) - return Syntax(raw, info: Info(.root(.init(arena: RetainedSyntaxArena(rawNodeArena))))) + return Syntax( + raw, + info: Info(.root(Syntax.Info.RefCountedRoot(Syntax.Info.Root(arena: RetainedSyntaxArena(rawNodeArena))))) + ) } /// Returns the child data at the provided index in this data's layout. diff --git a/Sources/SwiftSyntax/SyntaxNodeFactory.swift b/Sources/SwiftSyntax/SyntaxNodeFactory.swift index 9246603e892..f51927e5f33 100644 --- a/Sources/SwiftSyntax/SyntaxNodeFactory.swift +++ b/Sources/SwiftSyntax/SyntaxNodeFactory.swift @@ -65,7 +65,7 @@ struct SyntaxNodeFactory { @inline(__always) func create(parent: Syntax, raw: RawSyntax, absoluteInfo: AbsoluteSyntaxInfo) -> Syntax { if let info = syntaxInfoRepo.pop() { - info.info = .nonRoot(.init(parent: parent, absoluteInfo: absoluteInfo)) + info.info = .nonRoot(.init(parent: parent, absoluteInfo: absoluteInfo, rootInfo: parent.rootInfo)) return Syntax(raw, info: info) } else { return Syntax(raw, parent: parent, absoluteInfo: absoluteInfo) diff --git a/Tests/SwiftSyntaxTest/MemoryLayoutTest.swift b/Tests/SwiftSyntaxTest/MemoryLayoutTest.swift index af45e08f7fb..ad4a6bbc4ba 100644 --- a/Tests/SwiftSyntaxTest/MemoryLayoutTest.swift +++ b/Tests/SwiftSyntaxTest/MemoryLayoutTest.swift @@ -35,7 +35,7 @@ final class MemoryLayoutTest: XCTestCase { "Syntax": .init(size: 16, stride: 16, alignment: 8), "Syntax.Info": .init(size: 8, stride: 8, alignment: 8), "Syntax.Info.Root": .init(size: 8, stride: 8, alignment: 8), - "Syntax.Info.NonRoot": .init(size: 36, stride: 40, alignment: 8), + "Syntax.Info.NonRoot": .init(size: 48, stride: 48, alignment: 8), ] let values = SyntaxMemoryLayout.values From 73549e0e5e3ee5482947dcd1c442c2840ee604c5 Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Thu, 1 Aug 2024 14:34:22 -0700 Subject: [PATCH 3/9] Drop label from `SyntaxInTree` initializer --- Sources/SwiftSyntax/SyntaxChildren.swift | 2 +- Sources/SwiftSyntax/SyntaxIdentifier.swift | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Sources/SwiftSyntax/SyntaxChildren.swift b/Sources/SwiftSyntax/SyntaxChildren.swift index 42a51129419..504df530e1a 100644 --- a/Sources/SwiftSyntax/SyntaxChildren.swift +++ b/Sources/SwiftSyntax/SyntaxChildren.swift @@ -222,7 +222,7 @@ struct RawSyntaxChildren: BidirectionalCollection, Sendable { let offset = startIndex.offset + UInt32(parent.totalLength.utf8Length) let indexInParent = startIndex.indexInParent + UInt32(parentLayoutView.children.count) let indexInTree = startIndex.indexInTree.indexInTree + UInt32(parent.totalNodes) - 1 - let syntaxIndexInTree = SyntaxIdentifier.SyntaxIndexInTree(indexInTree: indexInTree) + let syntaxIndexInTree = SyntaxIdentifier.SyntaxIndexInTree(indexInTree) let materialized = SyntaxChildrenIndex( offset: offset, indexInParent: indexInParent, diff --git a/Sources/SwiftSyntax/SyntaxIdentifier.swift b/Sources/SwiftSyntax/SyntaxIdentifier.swift index e3417e32cfc..7cb74102816 100644 --- a/Sources/SwiftSyntax/SyntaxIdentifier.swift +++ b/Sources/SwiftSyntax/SyntaxIdentifier.swift @@ -47,22 +47,22 @@ public struct SyntaxIdentifier: Comparable, Hashable, Sendable { /// `raw`. func advancedBy(_ raw: RawSyntax?) -> SyntaxIndexInTree { let newIndexInTree = self.indexInTree + UInt32(truncatingIfNeeded: raw?.totalNodes ?? 0) - return .init(indexInTree: newIndexInTree) + return .init(newIndexInTree) } /// Assuming that this index points to the next sibling of `raw`, reverse it so that it points to the start of /// `raw`. func reversedBy(_ raw: RawSyntax?) -> SyntaxIndexInTree { let newIndexInTree = self.indexInTree - UInt32(truncatingIfNeeded: raw?.totalNodes ?? 0) - return .init(indexInTree: newIndexInTree) + return .init(newIndexInTree) } func advancedToFirstChild() -> SyntaxIndexInTree { let newIndexInTree = self.indexInTree + 1 - return .init(indexInTree: newIndexInTree) + return .init(newIndexInTree) } - init(indexInTree: UInt32) { + init(_ indexInTree: UInt32) { self.indexInTree = indexInTree } @@ -109,7 +109,7 @@ public struct SyntaxIdentifier: Comparable, Hashable, Sendable { static func forRoot(_ raw: RawSyntax) -> SyntaxIdentifier { return SyntaxIdentifier( rootId: Self.rootId(of: raw), - indexInTree: SyntaxIndexInTree(indexInTree: 0) + indexInTree: SyntaxIndexInTree(0) ) } @@ -133,7 +133,7 @@ public struct SyntaxIdentifier: Comparable, Hashable, Sendable { guard !root.hasParent else { return nil } - guard indexInTree.indexInTree < SyntaxIndexInTree(indexInTree: 0).advancedBy(root.raw).indexInTree else { + guard indexInTree.indexInTree < SyntaxIndexInTree(0).advancedBy(root.raw).indexInTree else { return nil } From bcaf91a6929ddab40235242c9f1c55f50217ad18 Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Thu, 1 Aug 2024 14:36:16 -0700 Subject: [PATCH 4/9] Implement tracking of syntax nodes if the syntax tree is edited --- .../swiftsyntax/SyntaxNodesFile.swift | 14 + Sources/SwiftSyntax/CMakeLists.txt | 1 + Sources/SwiftSyntax/Syntax.swift | 67 +++- Sources/SwiftSyntax/SyntaxCollection.swift | 25 +- Sources/SwiftSyntax/SyntaxIdentifier.swift | 7 +- Sources/SwiftSyntax/SyntaxProtocol.swift | 4 +- Sources/SwiftSyntax/SyntaxTracking.swift | 369 ++++++++++++++++++ .../generated/syntaxNodes/SyntaxNodesAB.swift | 224 +++++++++++ .../generated/syntaxNodes/SyntaxNodesC.swift | 264 +++++++++++++ .../generated/syntaxNodes/SyntaxNodesD.swift | 226 +++++++++++ .../generated/syntaxNodes/SyntaxNodesEF.swift | 266 +++++++++++++ .../syntaxNodes/SyntaxNodesGHI.swift | 246 ++++++++++++ .../syntaxNodes/SyntaxNodesJKLMN.swift | 280 +++++++++++++ .../generated/syntaxNodes/SyntaxNodesOP.swift | 294 ++++++++++++++ .../syntaxNodes/SyntaxNodesQRS.swift | 242 ++++++++++++ .../syntaxNodes/SyntaxNodesTUVWXYZ.swift | 278 +++++++++++++ Tests/SwiftSyntaxTest/MemoryLayoutTest.swift | 2 +- .../SwiftSyntaxTest/SyntaxTrackingTests.swift | 120 ++++++ 18 files changed, 2921 insertions(+), 8 deletions(-) create mode 100644 Sources/SwiftSyntax/SyntaxTracking.swift create mode 100644 Tests/SwiftSyntaxTest/SyntaxTrackingTests.swift diff --git a/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxNodesFile.swift b/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxNodesFile.swift index 3753ae54a6e..b2ce091aec1 100644 --- a/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxNodesFile.swift +++ b/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxNodesFile.swift @@ -128,6 +128,20 @@ func syntaxNode(nodesStartingWith: [Character]) -> SourceFileSyntax { operator: ExprSyntax(AssignmentExprSyntax()), rightOperand: initializer ) + + VariableDeclSyntax( + .let, + name: "nodes", + type: TypeAnnotationSyntax(type: TypeSyntax("[Syntax?]")), + initializer: InitializerClauseSyntax( + value: ArrayExprSyntax { + for child in node.children { + ArrayElementSyntax(expression: ExprSyntax("Syntax(\(child.varOrCaseName.backtickedIfNeeded))")) + } + } + ) + ) + ExprSyntax("Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes))") } for (index, child) in node.children.enumerated() { diff --git a/Sources/SwiftSyntax/CMakeLists.txt b/Sources/SwiftSyntax/CMakeLists.txt index 617183bab6f..c555a9558b0 100644 --- a/Sources/SwiftSyntax/CMakeLists.txt +++ b/Sources/SwiftSyntax/CMakeLists.txt @@ -34,6 +34,7 @@ add_swift_syntax_library(SwiftSyntax SyntaxNodeStructure.swift SyntaxProtocol.swift SyntaxText.swift + SyntaxTracking.swift SyntaxTreeViewMode.swift TokenDiagnostic.swift TokenSequence.swift diff --git a/Sources/SwiftSyntax/Syntax.swift b/Sources/SwiftSyntax/Syntax.swift index 503701d51d8..23d1eae2768 100644 --- a/Sources/SwiftSyntax/Syntax.swift +++ b/Sources/SwiftSyntax/Syntax.swift @@ -24,9 +24,11 @@ public struct Syntax: SyntaxProtocol, SyntaxHashable { // For root node. struct Root: Sendable { private let arena: RetainedSyntaxArena + var syntaxTracking: SyntaxTracking? - init(arena: RetainedSyntaxArena) { + init(arena: RetainedSyntaxArena, syntaxTracking: SyntaxTracking?) { self.arena = arena + self.syntaxTracking = syntaxTracking } } @@ -52,6 +54,17 @@ public struct Syntax: SyntaxProtocol, SyntaxHashable { fileprivate var pointer: UnsafePointer { return withUnsafePointer(to: &value) { $0 } } + + /// Get a reference to the root info which can be mutated. + /// + /// - Warning: This must only be used if the caller is guaranteed to have exclusive access to the tree and no + /// concurrent accesses can happen. Effectively, this can only be guaranteed if the tree has just been created, + /// and it hasn't been returned to any function which might concurrently access it. + /// In practice, this should only be used to set the `SyntaxTracking` on the root after a new tree has been + /// created (eg. by replacing a child in an existing tree) but before that new tree is returned to the client. + fileprivate var mutablePointer: UnsafeMutablePointer { + return withUnsafeMutablePointer(to: &value) { $0 } + } } // For non-root nodes. @@ -111,6 +124,20 @@ public struct Syntax: SyntaxProtocol, SyntaxHashable { } } + /// Get a reference to the root info which can be mutated. + /// + /// - Warning: This must only be used if the caller is guaranteed to have exclusive access to the tree and no + /// concurrent accesses can happen. Effectively, this can only be guaranteed if the tree has just been created, + /// and it hasn't been returned to any function which might concurrently access it. + /// In practice, this should only be used to set the `SyntaxTracking` on the root after a new tree has been + /// created (eg. by replacing a child in an existing tree) but before that new tree is returned to the client. + var mutableRootInfo: UnsafeMutablePointer { + switch info.info! { + case .root(let info): return info.mutablePointer + case .nonRoot(let info): return info.parent.mutableRootInfo + } + } + private var nonRootInfo: Info.NonRoot? { switch info.info! { case .root(_): return nil @@ -145,6 +172,20 @@ public struct Syntax: SyntaxProtocol, SyntaxHashable { absoluteInfo.nodeId } + var syntaxTracking: SyntaxTracking? { + rootInfo.pointee.syntaxTracking + } + + /// Set the translation ranges of the entire tree. + /// + /// - Warning: This must only be used if the caller is guaranteed to have exclusive access to the tree and no + /// concurrent accesses can happen. Effectively, this can only be guaranteed if the tree has just been created, + /// and it hasn't been returned to any function which might concurrently access it. + func setSyntaxTrackingOfTree(_ syntaxTracking: SyntaxTracking?) { + precondition(rootInfo.pointee.syntaxTracking == nil) + mutableRootInfo.pointee.syntaxTracking = syntaxTracking + } + /// The position of the start of this node's leading trivia public var position: AbsolutePosition { AbsolutePosition(utf8Offset: Int(absoluteInfo.offset)) @@ -192,14 +233,21 @@ public struct Syntax: SyntaxProtocol, SyntaxHashable { /// has a chance to retain it. static func forRoot(_ raw: RawSyntax, rawNodeArena: RetainedSyntaxArena) -> Syntax { precondition(rawNodeArena == raw.arenaReference) - return Syntax(raw, info: Info(.root(Syntax.Info.RefCountedRoot(Syntax.Info.Root(arena: rawNodeArena))))) + return Syntax( + raw, + info: Info(.root(Syntax.Info.RefCountedRoot(Syntax.Info.Root(arena: rawNodeArena, syntaxTracking: nil)))) + ) } static func forRoot(_ raw: RawSyntax, rawNodeArena: SyntaxArena) -> Syntax { precondition(rawNodeArena == raw.arenaReference) return Syntax( raw, - info: Info(.root(Syntax.Info.RefCountedRoot(Syntax.Info.Root(arena: RetainedSyntaxArena(rawNodeArena))))) + info: Info( + .root( + Syntax.Info.RefCountedRoot(Syntax.Info.Root(arena: RetainedSyntaxArena(rawNodeArena), syntaxTracking: nil)) + ) + ) ) } @@ -296,12 +344,23 @@ public struct Syntax: SyntaxProtocol, SyntaxHashable { /// `newChild` has been addded to the result. func replacingChild(at index: Int, with newChild: Syntax?, arena: SyntaxArena) -> Syntax { return withExtendedLifetime(newChild) { - return replacingChild( + let result = replacingChild( at: index, with: newChild?.raw, rawNodeArena: newChild?.raw.arenaReference.retained, allocationArena: arena ) + if trackedTree != nil { + var iter = RawSyntaxChildren(absoluteRaw).makeIterator() + for _ in 0.. Bool { + return lhs.indexInTree < rhs.indexInTree + } } /// Unique value for the root node. diff --git a/Sources/SwiftSyntax/SyntaxProtocol.swift b/Sources/SwiftSyntax/SyntaxProtocol.swift index 07c5f7b3077..c3960edc1a9 100644 --- a/Sources/SwiftSyntax/SyntaxProtocol.swift +++ b/Sources/SwiftSyntax/SyntaxProtocol.swift @@ -159,7 +159,9 @@ extension SyntaxProtocol { // Make sure `self` (and thus the arena of `self.raw`) can’t get deallocated // before the detached node can be created. return withExtendedLifetime(self) { - return Syntax(raw: self.raw, rawNodeArena: self.raw.arenaReference.retained).cast(Self.self) + let result = Syntax(raw: self.raw, rawNodeArena: self.raw.arenaReference.retained) + result.setSyntaxTrackingOfTree(SyntaxTracking(trackingRoot: Syntax(self))) + return result.cast(Self.self) } } } diff --git a/Sources/SwiftSyntax/SyntaxTracking.swift b/Sources/SwiftSyntax/SyntaxTracking.swift new file mode 100644 index 00000000000..38d794d1575 --- /dev/null +++ b/Sources/SwiftSyntax/SyntaxTracking.swift @@ -0,0 +1,369 @@ +//===----------------------------------------------------------------------===// +// +// This source file is part of the Swift.org open source project +// +// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors +// Licensed under Apache License v2.0 with Runtime Library Exception +// +// See https://swift.org/LICENSE.txt for license information +// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors +// +//===----------------------------------------------------------------------===// + +// MARK: Utilities + +fileprivate typealias SyntaxIndexInTree = SyntaxIdentifier.SyntaxIndexInTree + +fileprivate extension Comparable { + /// Adjusts this value so that it guaranteed to be in `range`. + func clamped(to range: Range) -> Self { + return min(max(self, range.lowerBound), range.upperBound) + } +} + +fileprivate extension Range { + func split(by split: Range) -> (before: Range, after: Range) { + let before = self.lowerBound.. { + func translated(by offset: Int) -> Range { + return SyntaxIndexInTree( + UInt32(Int(self.lowerBound.indexInTree) + offset) + ).. { + return id.indexInTree.. + + /// The number that needs to be added to `indexInTree` to get the node in + /// the tracked tree. + var offset: Int + + /// Shift the tracked range so that it tracks nodes that are now `shift` + /// nodes further in the tree. + /// + /// This shifts the tracked range upwards by `offset` and the offset down by + /// `shift` so that the tracked nodes still point to the original nodes. + func translated(by shift: Int) -> Self { + return TrackedRange( + range: self.range.translated(by: shift), + offset: self.offset - shift + ) + } + } + + /// The ID of the tree to which tracked ranges can translate the syntax nodes. + fileprivate var trackedTree: RootID + + /// Stores the actual tracked ranges + private var trackedRanges: [TrackedRange] = [] { + didSet { + assertNoOverlappingTrackedRanges() + } + } + + fileprivate init(trackedTree: RootID, trackedRanges: [TrackedRange]) { + self.trackedTree = trackedTree + self.trackedRanges = trackedRanges + } + + /// Update the `SyntaxTracking` to account for `oldNode` being replaced by `newNode`. + /// + /// It does the following + /// - Shift all tracked ranges after `oldNode` to account for the fact that + /// `newNode` might have more or fewer nodes than `oldNode` + /// - Incorporate the tracked ranges of `newNode` into this `SyntaxTracking`. + /// + /// - Complexity: O(trackedRanges.count + newNode.trackedRanges.count) + func replacing( + oldIndexInTree: SyntaxIdentifier.SyntaxIndexInTree, + oldTotalNodes: Int, + by newNode: Syntax? + ) -> SyntaxTracking { + let replacedRange = oldIndexInTree.. [TrackedRange] in + let (before, after) = tracked.range.split(by: replacedRange) + // - The ranges before the replaced nodes don't need to be adjusted + // - The ranges after the replaced range need to be adjusted: + // - The range needs to be shifted upwards if the new node has more + // total subtree nodes + // - Because we shift the range upwards we need to shift the offset down + // correspondingly. + let offset = (newNode?.raw.totalNodes ?? 0) - oldTotalNodes + return [ + TrackedRange(range: before, offset: tracked.offset), + TrackedRange(range: after, offset: tracked.offset).translated(by: offset), + ].filter { !$0.range.isEmpty } + } + + // If the new node has nodes that are being tracked in `trackedTree` + // transfer these translations to the new tracked ranges. + if let newNode, + let newNodeSyntaxTracking = newNode.syntaxTracking, newNodeSyntaxTracking.trackedTree == trackedTree + { + newTrackedRanges += newNodeSyntaxTracking.trackedRanges.map { tracked in + let offset = Int(oldIndexInTree.indexInTree) - Int(newNode.id.indexInTree.indexInTree) + return tracked.translated(by: offset) + } + } + return SyntaxTracking(trackedTree: self.trackedTree, trackedRanges: newTrackedRanges) + } + + /// If `originalNode` has an original node within this `SyntaxTracking`'s + /// `trackedTree` add an association of the node within a new tree to the + /// tracked tree. + /// + /// - Parameters: + /// - originalNode: The node in the original tree. Note that this doesn't + /// have to be a node within the tracked tree. It can be a node in a + /// derived tree that itself tracks `trackedTree`. + /// - nodeIndexInNewTree: The `SyntaxIndexInTree` of the node within the new + /// tree. + /// - Complexity: O(newNode.trackedRanges.count) + fileprivate mutating func track(originalNode: Syntax, nodeIndexInNewTree: SyntaxIndexInTree) { + guard originalNode.trackedTree == trackedTree else { + // The node doesn't track the same tracked tree (or doesn't track any tree). + // So there's nothing to do. + return + } + + // Find the tracked ranges in the original node that allow the translation + // of nodes within the subtree of `originalNode` to be translated to nodes + // in the tracked tree. + guard let originalNodeTranslationRanges = originalNode.syntaxTracking?.trackedRanges(of: originalNode) else { + return + } + + // Adjust the tracked ranges and their offsets to refer to nodes in the new tree. + let offset = Int(nodeIndexInNewTree.indexInTree) - Int(originalNode.id.indexInTree.indexInTree) + self.trackedRanges += originalNodeTranslationRanges.map { tracked in + return tracked.translated(by: offset) + } + } + + /// Return all tracked ranges of `node`. + /// + /// I.e. this returns all tracked ranges in this `SyntaxTracking` clamped to + /// the ranges that affect `node`. + /// + /// - Complexity: O(trackedRanges.count) + fileprivate func trackedRanges(of node: Syntax) -> [TrackedRange] { + let nodeIndexInTreeRange = node.indexInTreeRange + return trackedRanges.compactMap { tracked -> TrackedRange? in + let clamped = tracked.range.clamped(to: nodeIndexInTreeRange) + if clamped.isEmpty { + return nil + } + return TrackedRange(range: clamped, offset: tracked.offset) + } + } + + /// Translate the `SyntaxIndexInTree` of a syntax node to the `SyntaxIndexInTree` + /// in `trackedTree`. + /// + /// This is the main entry point to find the original node in a tracked tree. + /// + /// - Complexity: O(trackedRanges.count) + func originalIndexInTree( + of derivedIndexInTree: SyntaxIdentifier.SyntaxIndexInTree + ) -> SyntaxIdentifier.SyntaxIndexInTree? { + for tracked in trackedRanges { + if tracked.range.contains(derivedIndexInTree) { + return SyntaxIndexInTree(UInt32(Int(derivedIndexInTree.indexInTree) + tracked.offset)) + } + } + return nil + } + + /// Assert that the tracked ranges don't overlap. + /// + /// - Complexity: O(trackedRanges.count ^ 2) + private func assertNoOverlappingTrackedRanges() { + #if DEBUG || SWIFTSYNTAX_ENABLE_ASSERTIONS + for xIndex in trackedRanges.indices { + for yIndex in trackedRanges.index(after: xIndex).. SyntaxVisitorContinueKind { + if node.id.indexInTree == indexInTree { + assert(found == nil) + found = node + } + if node.indexInTreeRange.contains(indexInTree) { + return .visitChildren + } else { + return .skipChildren + } + } +} + +extension SyntaxProtocol { + /// The same ``Syntax`` but with tracking enabled in the entire tree. + /// + /// All syntax nodes derived from this will be able to find their + /// corresponding location in this original tree. + /// + /// - Complexity: O(number of ancestors) + public var tracked: Self { + return Syntax(self).tracked.cast(Self.self) + } + + /// If this syntax node is tracking `originalTree` and this node originated + /// in that tree, return the corresponding corresponding node in `originalTree`. + /// + /// The original node will have the same structure as this node but the parent + /// might be different since it's anchored in `originalTree`. + /// + /// The original node's source location will be the location that the node had + /// in `originalTree`. + /// + /// - SeeAlso: ``SyntaxProtocol/tracked`` + /// - Complexity: O(tracked ranges in this tree) + O(width * depth of original tree) + public func originalNode(in originalTree: some SyntaxProtocol) -> Self? { + guard let originalIndexInTree = Syntax(self).syntaxTracking?.originalIndexInTree(of: self.id.indexInTree) else { + return nil + } + + let finder = IndexInTreeFinder(indexInTree: originalIndexInTree) + finder.walk(originalTree.root) + return finder.found?.cast(Self.self) + } +} + +// MARK: To be generated + +extension SyntaxTracking { + /// Find the tree that should be tracked by a node that has the given nodes as + /// children. + /// + /// If all syntax nodes that have tracking enabled track the same tree, return + /// that tree's root ID. + /// + /// If no nodes track any tree or there are two nodes that track conflicting + /// trees, return `nil`. + /// + /// - Complexity: O(nodes.count) + @inline(__always) + private static func treeToTrack(_ nodes: [Syntax?]) -> RootID? { + var treeToTrack: RootID? = nil + for case .some(let node) in nodes { + if treeToTrack == nil { + treeToTrack = node.trackedTree + } else if node.trackedTree != nil && treeToTrack != node.trackedTree { + return nil + } + } + return treeToTrack + } + + /// Construct a new `SyntaxTracking` that tracks all `nodes` in a new node. + /// that has `nodes` as children. + /// + /// - Complexity: O(Σ_(n in nodes) 1 + n.trackedRanges.count) i.e. O(nodes.count) if no node tracks a tree. + @inline(__always) + // FIXME: Rename to trackingChildren + init?(tracking nodes: [Syntax?]) { + guard let treeToTrack = SyntaxTracking.treeToTrack(nodes) else { + return nil + } + self.init(trackedTree: treeToTrack, trackedRanges: []) + var indexInTree = SyntaxIndexInTree(0).advancedToFirstChild() + for case .some(let node) in nodes { + self.track(originalNode: node, nodeIndexInNewTree: indexInTree) + indexInTree = indexInTree.advancedBy(node.raw) + } + } + + /// Construct a new `SyntaxTracking` that tracks all `nodes` in a new node. + /// that has `nodes` as children. + /// + /// - Complexity: O(Σ_(n in nodes) 1 + n.trackedRanges.count) i.e. O(nodes.count) if no node tracks a tree. + @inline(__always) + init?(trackingRoot node: Syntax) { + guard let treeToTrack = node.trackedTree else { + return nil + } + self.init(trackedTree: treeToTrack, trackedRanges: []) + self.track(originalNode: node, nodeIndexInNewTree: SyntaxIndexInTree(0)) + } +} diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesAB.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesAB.swift index 136a9cf9237..7894ff7fdd0 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesAB.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesAB.swift @@ -163,6 +163,16 @@ public struct AccessorBlockSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftBrace), + Syntax(leftBrace), + Syntax(unexpectedBetweenLeftBraceAndAccessors), + Syntax(accessors), + Syntax(unexpectedBetweenAccessorsAndRightBrace), + Syntax(rightBrace), + Syntax(unexpectedAfterRightBrace) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeftBrace: UnexpectedNodesSyntax? { @@ -336,6 +346,22 @@ public struct AccessorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifier), + Syntax(modifier), + Syntax(unexpectedBetweenModifierAndAccessorSpecifier), + Syntax(accessorSpecifier), + Syntax(unexpectedBetweenAccessorSpecifierAndParameters), + Syntax(parameters), + Syntax(unexpectedBetweenParametersAndEffectSpecifiers), + Syntax(effectSpecifiers), + Syntax(unexpectedBetweenEffectSpecifiersAndBody), + Syntax(body), + Syntax(unexpectedAfterBody) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAttributes: UnexpectedNodesSyntax? { @@ -576,6 +602,14 @@ public struct AccessorEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashable, _L ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAsyncSpecifier), + Syntax(asyncSpecifier), + Syntax(unexpectedBetweenAsyncSpecifierAndThrowsClause), + Syntax(throwsClause), + Syntax(unexpectedAfterThrowsClause) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAsyncSpecifier: UnexpectedNodesSyntax? { @@ -704,6 +738,16 @@ public struct AccessorParametersSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeftParen: UnexpectedNodesSyntax? { @@ -891,6 +935,26 @@ public struct ActorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndActorKeyword), + Syntax(actorKeyword), + Syntax(unexpectedBetweenActorKeywordAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndGenericParameterClause), + Syntax(genericParameterClause), + Syntax(unexpectedBetweenGenericParameterClauseAndInheritanceClause), + Syntax(inheritanceClause), + Syntax(unexpectedBetweenInheritanceClauseAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedBetweenGenericWhereClauseAndMemberBlock), + Syntax(memberBlock), + Syntax(unexpectedAfterMemberBlock) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAttributes: UnexpectedNodesSyntax? { @@ -1195,6 +1259,14 @@ public struct ArrayElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeExpression: UnexpectedNodesSyntax? { @@ -1318,6 +1390,16 @@ public struct ArrayExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftSquare), + Syntax(leftSquare), + Syntax(unexpectedBetweenLeftSquareAndElements), + Syntax(elements), + Syntax(unexpectedBetweenElementsAndRightSquare), + Syntax(rightSquare), + Syntax(unexpectedAfterRightSquare) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeftSquare: UnexpectedNodesSyntax? { @@ -1489,6 +1571,16 @@ public struct ArrayTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftSquare), + Syntax(leftSquare), + Syntax(unexpectedBetweenLeftSquareAndElement), + Syntax(element), + Syntax(unexpectedBetweenElementAndRightSquare), + Syntax(rightSquare), + Syntax(unexpectedAfterRightSquare) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeftSquare: UnexpectedNodesSyntax? { @@ -1636,6 +1728,14 @@ public struct ArrowExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeEffectSpecifiers), + Syntax(effectSpecifiers), + Syntax(unexpectedBetweenEffectSpecifiersAndArrow), + Syntax(arrow), + Syntax(unexpectedAfterArrow) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeEffectSpecifiers: UnexpectedNodesSyntax? { @@ -1779,6 +1879,18 @@ public struct AsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndAsKeyword), + Syntax(asKeyword), + Syntax(unexpectedBetweenAsKeywordAndQuestionOrExclamationMark), + Syntax(questionOrExclamationMark), + Syntax(unexpectedBetweenQuestionOrExclamationMarkAndType), + Syntax(type), + Syntax(unexpectedAfterType) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeExpression: UnexpectedNodesSyntax? { @@ -1923,6 +2035,8 @@ public struct AssignmentExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExp ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforeEqual), Syntax(equal), Syntax(unexpectedAfterEqual)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeEqual: UnexpectedNodesSyntax? { @@ -2081,6 +2195,24 @@ public struct AssociatedTypeDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndAssociatedtypeKeyword), + Syntax(associatedtypeKeyword), + Syntax(unexpectedBetweenAssociatedtypeKeywordAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndInheritanceClause), + Syntax(inheritanceClause), + Syntax(unexpectedBetweenInheritanceClauseAndInitializer), + Syntax(initializer), + Syntax(unexpectedBetweenInitializerAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedAfterGenericWhereClause) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAttributes: UnexpectedNodesSyntax? { @@ -3091,6 +3223,20 @@ public struct AttributeSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodePr ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAtSign), + Syntax(atSign), + Syntax(unexpectedBetweenAtSignAndAttributeName), + Syntax(attributeName), + Syntax(unexpectedBetweenAttributeNameAndLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAtSign: UnexpectedNodesSyntax? { @@ -3292,6 +3438,16 @@ public struct AttributedTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeSpecifiers), + Syntax(specifiers), + Syntax(unexpectedBetweenSpecifiersAndAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndBaseType), + Syntax(baseType), + Syntax(unexpectedAfterBaseType) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeSpecifiers: UnexpectedNodesSyntax? { @@ -3603,6 +3759,14 @@ public struct AvailabilityArgumentSyntax: SyntaxProtocol, SyntaxHashable, _LeafS ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeArgument), + Syntax(argument), + Syntax(unexpectedBetweenArgumentAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeArgument: UnexpectedNodesSyntax? { @@ -3738,6 +3902,18 @@ public struct AvailabilityConditionSyntax: SyntaxProtocol, SyntaxHashable, _Leaf ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAvailabilityKeyword), + Syntax(availabilityKeyword), + Syntax(unexpectedBetweenAvailabilityKeywordAndLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndAvailabilityArguments), + Syntax(availabilityArguments), + Syntax(unexpectedBetweenAvailabilityArgumentsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAvailabilityKeyword: UnexpectedNodesSyntax? { @@ -4025,6 +4201,16 @@ public struct AvailabilityLabeledArgumentSyntax: SyntaxProtocol, SyntaxHashable, ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLabel), + Syntax(label), + Syntax(unexpectedBetweenLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndValue), + Syntax(value), + Syntax(unexpectedAfterValue) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLabel: UnexpectedNodesSyntax? { @@ -4172,6 +4358,14 @@ public struct AwaitExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAwaitKeyword), + Syntax(awaitKeyword), + Syntax(unexpectedBetweenAwaitKeywordAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAwaitKeyword: UnexpectedNodesSyntax? { @@ -4302,6 +4496,16 @@ public struct BackDeployedAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashab ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeBeforeLabel), + Syntax(beforeLabel), + Syntax(unexpectedBetweenBeforeLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndPlatforms), + Syntax(platforms), + Syntax(unexpectedAfterPlatforms) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeBeforeLabel: UnexpectedNodesSyntax? { @@ -4462,6 +4666,8 @@ public struct BinaryOperatorExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforeOperator), Syntax(`operator`), Syntax(unexpectedAfterOperator)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeOperator: UnexpectedNodesSyntax? { @@ -4537,6 +4743,8 @@ public struct BooleanLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforeLiteral), Syntax(literal), Syntax(unexpectedAfterLiteral)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLiteral: UnexpectedNodesSyntax? { @@ -4629,6 +4837,14 @@ public struct BorrowExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyn ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeBorrowKeyword), + Syntax(borrowKeyword), + Syntax(unexpectedBetweenBorrowKeywordAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeBorrowKeyword: UnexpectedNodesSyntax? { @@ -4743,6 +4959,14 @@ public struct BreakStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeBreakKeyword), + Syntax(breakKeyword), + Syntax(unexpectedBetweenBreakKeywordAndLabel), + Syntax(label), + Syntax(unexpectedAfterLabel) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeBreakKeyword: UnexpectedNodesSyntax? { diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesC.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesC.swift index bfdce0dd3ce..2a17d4d5cfc 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesC.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesC.swift @@ -88,6 +88,20 @@ public struct _CanImportExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExp ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeCanImportKeyword), + Syntax(canImportKeyword), + Syntax(unexpectedBetweenCanImportKeywordAndLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndImportPath), + Syntax(importPath), + Syntax(unexpectedBetweenImportPathAndVersionInfo), + Syntax(versionInfo), + Syntax(unexpectedBetweenVersionInfoAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeCanImportKeyword: UnexpectedNodesSyntax? { @@ -289,6 +303,18 @@ public struct _CanImportVersionInfoSyntax: ExprSyntaxProtocol, SyntaxHashable, _ ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeComma), + Syntax(comma), + Syntax(unexpectedBetweenCommaAndLabel), + Syntax(label), + Syntax(unexpectedBetweenLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndVersion), + Syntax(version), + Syntax(unexpectedAfterVersion) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeComma: UnexpectedNodesSyntax? { @@ -462,6 +488,16 @@ public struct CatchClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeCatchKeyword), + Syntax(catchKeyword), + Syntax(unexpectedBetweenCatchKeywordAndCatchItems), + Syntax(catchItems), + Syntax(unexpectedBetweenCatchItemsAndBody), + Syntax(body), + Syntax(unexpectedAfterBody) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeCatchKeyword: UnexpectedNodesSyntax? { @@ -634,6 +670,16 @@ public struct CatchItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodePr ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforePattern), + Syntax(pattern), + Syntax(unexpectedBetweenPatternAndWhereClause), + Syntax(whereClause), + Syntax(unexpectedBetweenWhereClauseAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforePattern: UnexpectedNodesSyntax? { @@ -842,6 +888,26 @@ public struct ClassDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndClassKeyword), + Syntax(classKeyword), + Syntax(unexpectedBetweenClassKeywordAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndGenericParameterClause), + Syntax(genericParameterClause), + Syntax(unexpectedBetweenGenericParameterClauseAndInheritanceClause), + Syntax(inheritanceClause), + Syntax(unexpectedBetweenInheritanceClauseAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedBetweenGenericWhereClauseAndMemberBlock), + Syntax(memberBlock), + Syntax(unexpectedAfterMemberBlock) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAttributes: UnexpectedNodesSyntax? { @@ -1128,6 +1194,8 @@ public struct ClassRestrictionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _L ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforeClassKeyword), Syntax(classKeyword), Syntax(unexpectedAfterClassKeyword)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeClassKeyword: UnexpectedNodesSyntax? { @@ -1229,6 +1297,16 @@ public struct ClosureCaptureClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafS ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftSquare), + Syntax(leftSquare), + Syntax(unexpectedBetweenLeftSquareAndItems), + Syntax(items), + Syntax(unexpectedBetweenItemsAndRightSquare), + Syntax(rightSquare), + Syntax(unexpectedAfterRightSquare) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeftSquare: UnexpectedNodesSyntax? { @@ -1411,6 +1489,18 @@ public struct ClosureCaptureSpecifierSyntax: SyntaxProtocol, SyntaxHashable, _Le ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeSpecifier), + Syntax(specifier), + Syntax(unexpectedBetweenSpecifierAndLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndDetail), + Syntax(detail), + Syntax(unexpectedBetweenDetailAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeSpecifier: UnexpectedNodesSyntax? { @@ -1603,6 +1693,20 @@ public struct ClosureCaptureSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeSpecifier), + Syntax(specifier), + Syntax(unexpectedBetweenSpecifierAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndEqual), + Syntax(equal), + Syntax(unexpectedBetweenEqualAndExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeSpecifier: UnexpectedNodesSyntax? { @@ -1805,6 +1909,18 @@ public struct ClosureExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftBrace), + Syntax(leftBrace), + Syntax(unexpectedBetweenLeftBraceAndSignature), + Syntax(signature), + Syntax(unexpectedBetweenSignatureAndStatements), + Syntax(statements), + Syntax(unexpectedBetweenStatementsAndRightBrace), + Syntax(rightBrace), + Syntax(unexpectedAfterRightBrace) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeftBrace: UnexpectedNodesSyntax? { @@ -2003,6 +2119,16 @@ public struct ClosureParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Lea ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndParameters), + Syntax(parameters), + Syntax(unexpectedBetweenParametersAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeftParen: UnexpectedNodesSyntax? { @@ -2224,6 +2350,26 @@ public struct ClosureParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndFirstName), + Syntax(firstName), + Syntax(unexpectedBetweenFirstNameAndSecondName), + Syntax(secondName), + Syntax(unexpectedBetweenSecondNameAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndType), + Syntax(type), + Syntax(unexpectedBetweenTypeAndEllipsis), + Syntax(ellipsis), + Syntax(unexpectedBetweenEllipsisAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAttributes: UnexpectedNodesSyntax? { @@ -2543,6 +2689,14 @@ public struct ClosureShorthandParameterSyntax: SyntaxProtocol, SyntaxHashable, _ ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeName), + Syntax(name), + Syntax(unexpectedBetweenNameAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeName: UnexpectedNodesSyntax? { @@ -2776,6 +2930,22 @@ public struct ClosureSignatureSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndCapture), + Syntax(capture), + Syntax(unexpectedBetweenCaptureAndParameterClause), + Syntax(parameterClause), + Syntax(unexpectedBetweenParameterClauseAndEffectSpecifiers), + Syntax(effectSpecifiers), + Syntax(unexpectedBetweenEffectSpecifiersAndReturnClause), + Syntax(returnClause), + Syntax(unexpectedBetweenReturnClauseAndInKeyword), + Syntax(inKeyword), + Syntax(unexpectedAfterInKeyword) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAttributes: UnexpectedNodesSyntax? { @@ -3120,6 +3290,14 @@ public struct CodeBlockItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeItem), + Syntax(item), + Syntax(unexpectedBetweenItemAndSemicolon), + Syntax(semicolon), + Syntax(unexpectedAfterSemicolon) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeItem: UnexpectedNodesSyntax? { @@ -3262,6 +3440,16 @@ public struct CodeBlockSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodePr ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftBrace), + Syntax(leftBrace), + Syntax(unexpectedBetweenLeftBraceAndStatements), + Syntax(statements), + Syntax(unexpectedBetweenStatementsAndRightBrace), + Syntax(rightBrace), + Syntax(unexpectedAfterRightBrace) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeftBrace: UnexpectedNodesSyntax? { @@ -3434,6 +3622,14 @@ public struct CompositionTypeElementSyntax: SyntaxProtocol, SyntaxHashable, _Lea ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeType), + Syntax(type), + Syntax(unexpectedBetweenTypeAndAmpersand), + Syntax(ampersand), + Syntax(unexpectedAfterAmpersand) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeType: UnexpectedNodesSyntax? { @@ -3530,6 +3726,8 @@ public struct CompositionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforeElements), Syntax(elements), Syntax(unexpectedAfterElements)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeElements: UnexpectedNodesSyntax? { @@ -3801,6 +3999,14 @@ public struct ConditionElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeCondition), + Syntax(condition), + Syntax(unexpectedBetweenConditionAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeCondition: UnexpectedNodesSyntax? { @@ -3926,6 +4132,16 @@ public struct ConformanceRequirementSyntax: SyntaxProtocol, SyntaxHashable, _Lea ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftType), + Syntax(leftType), + Syntax(unexpectedBetweenLeftTypeAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndRightType), + Syntax(rightType), + Syntax(unexpectedAfterRightType) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeftType: UnexpectedNodesSyntax? { @@ -4060,6 +4276,14 @@ public struct ConsumeExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeConsumeKeyword), + Syntax(consumeKeyword), + Syntax(unexpectedBetweenConsumeKeywordAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeConsumeKeyword: UnexpectedNodesSyntax? { @@ -4176,6 +4400,14 @@ public struct ContinueStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtS ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeContinueKeyword), + Syntax(continueKeyword), + Syntax(unexpectedBetweenContinueKeywordAndLabel), + Syntax(label), + Syntax(unexpectedAfterLabel) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeContinueKeyword: UnexpectedNodesSyntax? { @@ -4321,6 +4553,20 @@ public struct ConventionAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeConventionLabel), + Syntax(conventionLabel), + Syntax(unexpectedBetweenConventionLabelAndComma), + Syntax(comma), + Syntax(unexpectedBetweenCommaAndCTypeLabel), + Syntax(cTypeLabel), + Syntax(unexpectedBetweenCTypeLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndCTypeString), + Syntax(cTypeString), + Syntax(unexpectedAfterCTypeString) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeConventionLabel: UnexpectedNodesSyntax? { @@ -4522,6 +4768,16 @@ public struct ConventionWitnessMethodAttributeArgumentsSyntax: SyntaxProtocol, S ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeWitnessMethodLabel), + Syntax(witnessMethodLabel), + Syntax(unexpectedBetweenWitnessMethodLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndProtocolName), + Syntax(protocolName), + Syntax(unexpectedAfterProtocolName) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeWitnessMethodLabel: UnexpectedNodesSyntax? { @@ -4668,6 +4924,14 @@ public struct CopyExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynta ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeCopyKeyword), + Syntax(copyKeyword), + Syntax(unexpectedBetweenCopyKeywordAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeCopyKeyword: UnexpectedNodesSyntax? { diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift index f2b33bb792d..5b4dbff8bc2 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift @@ -78,6 +78,16 @@ public struct DeclModifierDetailSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndDetail), + Syntax(detail), + Syntax(unexpectedBetweenDetailAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeftParen: UnexpectedNodesSyntax? { @@ -223,6 +233,14 @@ public struct DeclModifierSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeName), + Syntax(name), + Syntax(unexpectedBetweenNameAndDetail), + Syntax(detail), + Syntax(unexpectedAfterDetail) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeName: UnexpectedNodesSyntax? { @@ -377,6 +395,14 @@ public struct DeclNameArgumentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeName), + Syntax(name), + Syntax(unexpectedBetweenNameAndColon), + Syntax(colon), + Syntax(unexpectedAfterColon) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeName: UnexpectedNodesSyntax? { @@ -502,6 +528,16 @@ public struct DeclNameArgumentsSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeftParen: UnexpectedNodesSyntax? { @@ -674,6 +710,14 @@ public struct DeclReferenceExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeBaseName), + Syntax(baseName), + Syntax(unexpectedBetweenBaseNameAndArgumentNames), + Syntax(argumentNames), + Syntax(unexpectedAfterArgumentNames) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeBaseName: UnexpectedNodesSyntax? { @@ -797,6 +841,14 @@ public struct DeferStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeDeferKeyword), + Syntax(deferKeyword), + Syntax(unexpectedBetweenDeferKeywordAndBody), + Syntax(body), + Syntax(unexpectedAfterBody) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeDeferKeyword: UnexpectedNodesSyntax? { @@ -945,6 +997,20 @@ public struct DeinitializerDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Leaf ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndDeinitKeyword), + Syntax(deinitKeyword), + Syntax(unexpectedBetweenDeinitKeywordAndEffectSpecifiers), + Syntax(effectSpecifiers), + Syntax(unexpectedBetweenEffectSpecifiersAndBody), + Syntax(body), + Syntax(unexpectedAfterBody) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAttributes: UnexpectedNodesSyntax? { @@ -1168,6 +1234,8 @@ public struct DeinitializerEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashabl ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforeAsyncSpecifier), Syntax(asyncSpecifier), Syntax(unexpectedAfterAsyncSpecifier)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAsyncSpecifier: UnexpectedNodesSyntax? { @@ -1306,6 +1374,24 @@ public struct DerivativeAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeOfLabel), + Syntax(ofLabel), + Syntax(unexpectedBetweenOfLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndOriginalDeclName), + Syntax(originalDeclName), + Syntax(unexpectedBetweenOriginalDeclNameAndPeriod), + Syntax(period), + Syntax(unexpectedBetweenPeriodAndAccessorSpecifier), + Syntax(accessorSpecifier), + Syntax(unexpectedBetweenAccessorSpecifierAndComma), + Syntax(comma), + Syntax(unexpectedBetweenCommaAndArguments), + Syntax(arguments), + Syntax(unexpectedAfterArguments) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeOfLabel: UnexpectedNodesSyntax? { @@ -1547,6 +1633,14 @@ public struct DesignatedTypeSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeadingComma), + Syntax(leadingComma), + Syntax(unexpectedBetweenLeadingCommaAndName), + Syntax(name), + Syntax(unexpectedAfterName) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeadingComma: UnexpectedNodesSyntax? { @@ -1681,6 +1775,18 @@ public struct DictionaryElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeKey), + Syntax(key), + Syntax(unexpectedBetweenKeyAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndValue), + Syntax(value), + Syntax(unexpectedBetweenValueAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeKey: UnexpectedNodesSyntax? { @@ -1929,6 +2035,16 @@ public struct DictionaryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExp ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftSquare), + Syntax(leftSquare), + Syntax(unexpectedBetweenLeftSquareAndContent), + Syntax(content), + Syntax(unexpectedBetweenContentAndRightSquare), + Syntax(rightSquare), + Syntax(unexpectedAfterRightSquare) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeftSquare: UnexpectedNodesSyntax? { @@ -2087,6 +2203,20 @@ public struct DictionaryTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftSquare), + Syntax(leftSquare), + Syntax(unexpectedBetweenLeftSquareAndKey), + Syntax(key), + Syntax(unexpectedBetweenKeyAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndValue), + Syntax(value), + Syntax(unexpectedBetweenValueAndRightSquare), + Syntax(rightSquare), + Syntax(unexpectedAfterRightSquare) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeftSquare: UnexpectedNodesSyntax? { @@ -2274,6 +2404,14 @@ public struct DifferentiabilityArgumentSyntax: SyntaxProtocol, SyntaxHashable, _ ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeArgument), + Syntax(argument), + Syntax(unexpectedBetweenArgumentAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeArgument: UnexpectedNodesSyntax? { @@ -2408,6 +2546,16 @@ public struct DifferentiabilityArgumentsSyntax: SyntaxProtocol, SyntaxHashable, ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeftParen: UnexpectedNodesSyntax? { @@ -2671,6 +2819,16 @@ public struct DifferentiabilityWithRespectToArgumentSyntax: SyntaxProtocol, Synt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeWrtLabel), + Syntax(wrtLabel), + Syntax(unexpectedBetweenWrtLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndArguments), + Syntax(arguments), + Syntax(unexpectedAfterArguments) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeWrtLabel: UnexpectedNodesSyntax? { @@ -2844,6 +3002,20 @@ public struct DifferentiableAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHash ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeKindSpecifier), + Syntax(kindSpecifier), + Syntax(unexpectedBetweenKindSpecifierAndKindSpecifierComma), + Syntax(kindSpecifierComma), + Syntax(unexpectedBetweenKindSpecifierCommaAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndArgumentsComma), + Syntax(argumentsComma), + Syntax(unexpectedBetweenArgumentsCommaAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedAfterGenericWhereClause) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeKindSpecifier: UnexpectedNodesSyntax? { @@ -3033,6 +3205,8 @@ public struct DiscardAssignmentExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _ ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforeWildcard), Syntax(wildcard), Syntax(unexpectedAfterWildcard)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeWildcard: UnexpectedNodesSyntax? { @@ -3123,6 +3297,14 @@ public struct DiscardStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeDiscardKeyword), + Syntax(discardKeyword), + Syntax(unexpectedBetweenDiscardKeywordAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeDiscardKeyword: UnexpectedNodesSyntax? { @@ -3271,6 +3453,16 @@ public struct DoExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeDoKeyword), + Syntax(doKeyword), + Syntax(unexpectedBetweenDoKeywordAndBody), + Syntax(body), + Syntax(unexpectedBetweenBodyAndCatchClauses), + Syntax(catchClauses), + Syntax(unexpectedAfterCatchClauses) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeDoKeyword: UnexpectedNodesSyntax? { @@ -3447,6 +3639,18 @@ public struct DoStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntaxN ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeDoKeyword), + Syntax(doKeyword), + Syntax(unexpectedBetweenDoKeywordAndThrowsClause), + Syntax(throwsClause), + Syntax(unexpectedBetweenThrowsClauseAndBody), + Syntax(body), + Syntax(unexpectedBetweenBodyAndCatchClauses), + Syntax(catchClauses), + Syntax(unexpectedAfterCatchClauses) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeDoKeyword: UnexpectedNodesSyntax? { @@ -3730,6 +3934,18 @@ public struct DocumentationAttributeArgumentSyntax: SyntaxProtocol, SyntaxHashab ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLabel), + Syntax(label), + Syntax(unexpectedBetweenLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndValue), + Syntax(value), + Syntax(unexpectedBetweenValueAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLabel: UnexpectedNodesSyntax? { @@ -3907,6 +4123,16 @@ public struct DynamicReplacementAttributeArgumentsSyntax: SyntaxProtocol, Syntax ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeForLabel), + Syntax(forLabel), + Syntax(unexpectedBetweenForLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndDeclName), + Syntax(declName), + Syntax(unexpectedAfterDeclName) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeForLabel: UnexpectedNodesSyntax? { diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesEF.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesEF.swift index 0d336fd635a..e20aed85c35 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesEF.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesEF.swift @@ -81,6 +81,16 @@ public struct EditorPlaceholderDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _ ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndPlaceholder), + Syntax(placeholder), + Syntax(unexpectedAfterPlaceholder) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAttributes: UnexpectedNodesSyntax? { @@ -260,6 +270,8 @@ public struct EditorPlaceholderExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _ ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforePlaceholder: UnexpectedNodesSyntax? { @@ -370,6 +382,18 @@ public struct EnumCaseDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndCaseKeyword), + Syntax(caseKeyword), + Syntax(unexpectedBetweenCaseKeywordAndElements), + Syntax(elements), + Syntax(unexpectedAfterElements) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAttributes: UnexpectedNodesSyntax? { @@ -634,6 +658,18 @@ public struct EnumCaseElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeName), + Syntax(name), + Syntax(unexpectedBetweenNameAndParameterClause), + Syntax(parameterClause), + Syntax(unexpectedBetweenParameterClauseAndRawValue), + Syntax(rawValue), + Syntax(unexpectedBetweenRawValueAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeName: UnexpectedNodesSyntax? { @@ -811,6 +847,16 @@ public struct EnumCaseParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Le ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndParameters), + Syntax(parameters), + Syntax(unexpectedBetweenParametersAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeftParen: UnexpectedNodesSyntax? { @@ -1023,6 +1069,24 @@ public struct EnumCaseParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndFirstName), + Syntax(firstName), + Syntax(unexpectedBetweenFirstNameAndSecondName), + Syntax(secondName), + Syntax(unexpectedBetweenSecondNameAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndType), + Syntax(type), + Syntax(unexpectedBetweenTypeAndDefaultValue), + Syntax(defaultValue), + Syntax(unexpectedBetweenDefaultValueAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeModifiers: UnexpectedNodesSyntax? { @@ -1335,6 +1399,26 @@ public struct EnumDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynta ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndEnumKeyword), + Syntax(enumKeyword), + Syntax(unexpectedBetweenEnumKeywordAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndGenericParameterClause), + Syntax(genericParameterClause), + Syntax(unexpectedBetweenGenericParameterClauseAndInheritanceClause), + Syntax(inheritanceClause), + Syntax(unexpectedBetweenInheritanceClauseAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedBetweenGenericWhereClauseAndMemberBlock), + Syntax(memberBlock), + Syntax(unexpectedAfterMemberBlock) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAttributes: UnexpectedNodesSyntax? { @@ -1649,6 +1733,16 @@ public struct ExposeAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable, _L ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLanguage), + Syntax(language), + Syntax(unexpectedBetweenLanguageAndComma), + Syntax(comma), + Syntax(unexpectedBetweenCommaAndCxxName), + Syntax(cxxName), + Syntax(unexpectedAfterCxxName) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLanguage: UnexpectedNodesSyntax? { @@ -1782,6 +1876,8 @@ public struct ExpressionPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _L ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforeExpression), Syntax(expression), Syntax(unexpectedAfterExpression)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeExpression: UnexpectedNodesSyntax? { @@ -1898,6 +1994,20 @@ public struct ExpressionSegmentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeBackslash), + Syntax(backslash), + Syntax(unexpectedBetweenBackslashAndPounds), + Syntax(pounds), + Syntax(unexpectedBetweenPoundsAndLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndExpressions), + Syntax(expressions), + Syntax(unexpectedBetweenExpressionsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeBackslash: UnexpectedNodesSyntax? { @@ -2093,6 +2203,8 @@ public struct ExpressionStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStm ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforeExpression), Syntax(expression), Syntax(unexpectedAfterExpression)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeExpression: UnexpectedNodesSyntax? { @@ -2234,6 +2346,24 @@ public struct ExtensionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndExtensionKeyword), + Syntax(extensionKeyword), + Syntax(unexpectedBetweenExtensionKeywordAndExtendedType), + Syntax(extendedType), + Syntax(unexpectedBetweenExtendedTypeAndInheritanceClause), + Syntax(inheritanceClause), + Syntax(unexpectedBetweenInheritanceClauseAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedBetweenGenericWhereClauseAndMemberBlock), + Syntax(memberBlock), + Syntax(unexpectedAfterMemberBlock) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAttributes: UnexpectedNodesSyntax? { @@ -2503,6 +2633,8 @@ public struct FallThroughStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafSt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforeFallthroughKeyword), Syntax(fallthroughKeyword), Syntax(unexpectedAfterFallthroughKeyword)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeFallthroughKeyword: UnexpectedNodesSyntax? { @@ -2578,6 +2710,8 @@ public struct FloatLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforeLiteral), Syntax(literal), Syntax(unexpectedAfterLiteral)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLiteral: UnexpectedNodesSyntax? { @@ -2724,6 +2858,30 @@ public struct ForStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntax ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeForKeyword), + Syntax(forKeyword), + Syntax(unexpectedBetweenForKeywordAndTryKeyword), + Syntax(tryKeyword), + Syntax(unexpectedBetweenTryKeywordAndAwaitKeyword), + Syntax(awaitKeyword), + Syntax(unexpectedBetweenAwaitKeywordAndCaseKeyword), + Syntax(caseKeyword), + Syntax(unexpectedBetweenCaseKeywordAndPattern), + Syntax(pattern), + Syntax(unexpectedBetweenPatternAndTypeAnnotation), + Syntax(typeAnnotation), + Syntax(unexpectedBetweenTypeAnnotationAndInKeyword), + Syntax(inKeyword), + Syntax(unexpectedBetweenInKeywordAndSequence), + Syntax(sequence), + Syntax(unexpectedBetweenSequenceAndWhereClause), + Syntax(whereClause), + Syntax(unexpectedBetweenWhereClauseAndBody), + Syntax(body), + Syntax(unexpectedAfterBody) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeForKeyword: UnexpectedNodesSyntax? { @@ -3010,6 +3168,14 @@ public struct ForceUnwrapExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafEx ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndExclamationMark), + Syntax(exclamationMark), + Syntax(unexpectedAfterExclamationMark) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeExpression: UnexpectedNodesSyntax? { @@ -3152,6 +3318,22 @@ public struct FunctionCallExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeCalledExpression), + Syntax(calledExpression), + Syntax(unexpectedBetweenCalledExpressionAndLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedBetweenRightParenAndTrailingClosure), + Syntax(trailingClosure), + Syntax(unexpectedBetweenTrailingClosureAndAdditionalTrailingClosures), + Syntax(additionalTrailingClosures), + Syntax(unexpectedAfterAdditionalTrailingClosures) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeCalledExpression: UnexpectedNodesSyntax? { @@ -3473,6 +3655,26 @@ public struct FunctionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndFuncKeyword), + Syntax(funcKeyword), + Syntax(unexpectedBetweenFuncKeywordAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndGenericParameterClause), + Syntax(genericParameterClause), + Syntax(unexpectedBetweenGenericParameterClauseAndSignature), + Syntax(signature), + Syntax(unexpectedBetweenSignatureAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedBetweenGenericWhereClauseAndBody), + Syntax(body), + Syntax(unexpectedAfterBody) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAttributes: UnexpectedNodesSyntax? { @@ -3784,6 +3986,14 @@ public struct FunctionEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashable, _L ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAsyncSpecifier), + Syntax(asyncSpecifier), + Syntax(unexpectedBetweenAsyncSpecifierAndThrowsClause), + Syntax(throwsClause), + Syntax(unexpectedAfterThrowsClause) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAsyncSpecifier: UnexpectedNodesSyntax? { @@ -3915,6 +4125,16 @@ public struct FunctionParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Le ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndParameters), + Syntax(parameters), + Syntax(unexpectedBetweenParametersAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeftParen: UnexpectedNodesSyntax? { @@ -4143,6 +4363,28 @@ public struct FunctionParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndFirstName), + Syntax(firstName), + Syntax(unexpectedBetweenFirstNameAndSecondName), + Syntax(secondName), + Syntax(unexpectedBetweenSecondNameAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndType), + Syntax(type), + Syntax(unexpectedBetweenTypeAndEllipsis), + Syntax(ellipsis), + Syntax(unexpectedBetweenEllipsisAndDefaultValue), + Syntax(defaultValue), + Syntax(unexpectedBetweenDefaultValueAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAttributes: UnexpectedNodesSyntax? { @@ -4499,6 +4741,16 @@ public struct FunctionSignatureSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeParameterClause), + Syntax(parameterClause), + Syntax(unexpectedBetweenParameterClauseAndEffectSpecifiers), + Syntax(effectSpecifiers), + Syntax(unexpectedBetweenEffectSpecifiersAndReturnClause), + Syntax(returnClause), + Syntax(unexpectedAfterReturnClause) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeParameterClause: UnexpectedNodesSyntax? { @@ -4654,6 +4906,20 @@ public struct FunctionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeS ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndParameters), + Syntax(parameters), + Syntax(unexpectedBetweenParametersAndRightParen), + Syntax(rightParen), + Syntax(unexpectedBetweenRightParenAndEffectSpecifiers), + Syntax(effectSpecifiers), + Syntax(unexpectedBetweenEffectSpecifiersAndReturnClause), + Syntax(returnClause), + Syntax(unexpectedAfterReturnClause) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeftParen: UnexpectedNodesSyntax? { diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesGHI.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesGHI.swift index 2a4290515da..22b0b38e38c 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesGHI.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesGHI.swift @@ -83,6 +83,16 @@ public struct GenericArgumentClauseSyntax: SyntaxProtocol, SyntaxHashable, _Leaf ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftAngle), + Syntax(leftAngle), + Syntax(unexpectedBetweenLeftAngleAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndRightAngle), + Syntax(rightAngle), + Syntax(unexpectedAfterRightAngle) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeftAngle: UnexpectedNodesSyntax? { @@ -251,6 +261,14 @@ public struct GenericArgumentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeArgument), + Syntax(argument), + Syntax(unexpectedBetweenArgumentAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeArgument: UnexpectedNodesSyntax? { @@ -398,6 +416,18 @@ public struct GenericParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Lea ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftAngle), + Syntax(leftAngle), + Syntax(unexpectedBetweenLeftAngleAndParameters), + Syntax(parameters), + Syntax(unexpectedBetweenParametersAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedBetweenGenericWhereClauseAndRightAngle), + Syntax(rightAngle), + Syntax(unexpectedAfterRightAngle) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeftAngle: UnexpectedNodesSyntax? { @@ -620,6 +650,22 @@ public struct GenericParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndEachKeyword), + Syntax(eachKeyword), + Syntax(unexpectedBetweenEachKeywordAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndInheritedType), + Syntax(inheritedType), + Syntax(unexpectedBetweenInheritedTypeAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAttributes: UnexpectedNodesSyntax? { @@ -969,6 +1015,14 @@ public struct GenericRequirementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeRequirement), + Syntax(requirement), + Syntax(unexpectedBetweenRequirementAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeRequirement: UnexpectedNodesSyntax? { @@ -1083,6 +1137,14 @@ public struct GenericSpecializationExprSyntax: ExprSyntaxProtocol, SyntaxHashabl ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndGenericArgumentClause), + Syntax(genericArgumentClause), + Syntax(unexpectedAfterGenericArgumentClause) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeExpression: UnexpectedNodesSyntax? { @@ -1216,6 +1278,14 @@ public struct GenericWhereClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeWhereKeyword), + Syntax(whereKeyword), + Syntax(unexpectedBetweenWhereKeywordAndRequirements), + Syntax(requirements), + Syntax(unexpectedAfterRequirements) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeWhereKeyword: UnexpectedNodesSyntax? { @@ -1374,6 +1444,18 @@ public struct GuardStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeGuardKeyword), + Syntax(guardKeyword), + Syntax(unexpectedBetweenGuardKeywordAndConditions), + Syntax(conditions), + Syntax(unexpectedBetweenConditionsAndElseKeyword), + Syntax(elseKeyword), + Syntax(unexpectedBetweenElseKeywordAndBody), + Syntax(body), + Syntax(unexpectedAfterBody) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeGuardKeyword: UnexpectedNodesSyntax? { @@ -1554,6 +1636,8 @@ public struct IdentifierPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _L ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforeIdentifier), Syntax(identifier), Syntax(unexpectedAfterIdentifier)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeIdentifier: UnexpectedNodesSyntax? { @@ -1649,6 +1733,14 @@ public struct IdentifierTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeName), + Syntax(name), + Syntax(unexpectedBetweenNameAndGenericArgumentClause), + Syntax(genericArgumentClause), + Syntax(unexpectedAfterGenericArgumentClause) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeName: UnexpectedNodesSyntax? { @@ -1965,6 +2057,16 @@ public struct IfConfigClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforePoundKeyword), + Syntax(poundKeyword), + Syntax(unexpectedBetweenPoundKeywordAndCondition), + Syntax(condition), + Syntax(unexpectedBetweenConditionAndElements), + Syntax(elements), + Syntax(unexpectedAfterElements) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforePoundKeyword: UnexpectedNodesSyntax? { @@ -2108,6 +2210,14 @@ public struct IfConfigDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeClauses), + Syntax(clauses), + Syntax(unexpectedBetweenClausesAndPoundEndif), + Syntax(poundEndif), + Syntax(unexpectedAfterPoundEndif) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeClauses: UnexpectedNodesSyntax? { @@ -2356,6 +2466,20 @@ public struct IfExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeIfKeyword), + Syntax(ifKeyword), + Syntax(unexpectedBetweenIfKeywordAndConditions), + Syntax(conditions), + Syntax(unexpectedBetweenConditionsAndBody), + Syntax(body), + Syntax(unexpectedBetweenBodyAndElseKeyword), + Syntax(elseKeyword), + Syntax(unexpectedBetweenElseKeywordAndElseBody), + Syntax(elseBody), + Syntax(unexpectedAfterElseBody) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeIfKeyword: UnexpectedNodesSyntax? { @@ -2576,6 +2700,16 @@ public struct ImplementsAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeType), + Syntax(type), + Syntax(unexpectedBetweenTypeAndComma), + Syntax(comma), + Syntax(unexpectedBetweenCommaAndDeclName), + Syntax(declName), + Syntax(unexpectedAfterDeclName) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeType: UnexpectedNodesSyntax? { @@ -2714,6 +2848,14 @@ public struct ImplicitlyUnwrappedOptionalTypeSyntax: TypeSyntaxProtocol, SyntaxH ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeWrappedType), + Syntax(wrappedType), + Syntax(unexpectedBetweenWrappedTypeAndExclamationMark), + Syntax(exclamationMark), + Syntax(unexpectedAfterExclamationMark) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeWrappedType: UnexpectedNodesSyntax? { @@ -2862,6 +3004,20 @@ public struct ImportDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyn ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndImportKeyword), + Syntax(importKeyword), + Syntax(unexpectedBetweenImportKeywordAndImportKindSpecifier), + Syntax(importKindSpecifier), + Syntax(unexpectedBetweenImportKindSpecifierAndPath), + Syntax(path), + Syntax(unexpectedAfterPath) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAttributes: UnexpectedNodesSyntax? { @@ -3142,6 +3298,14 @@ public struct ImportPathComponentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeName), + Syntax(name), + Syntax(unexpectedBetweenNameAndTrailingPeriod), + Syntax(trailingPeriod), + Syntax(unexpectedAfterTrailingPeriod) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeName: UnexpectedNodesSyntax? { @@ -3265,6 +3429,14 @@ public struct InOutExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAmpersand), + Syntax(ampersand), + Syntax(unexpectedBetweenAmpersandAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAmpersand: UnexpectedNodesSyntax? { @@ -3392,6 +3564,16 @@ public struct InfixOperatorExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftOperand), + Syntax(leftOperand), + Syntax(unexpectedBetweenLeftOperandAndOperator), + Syntax(`operator`), + Syntax(unexpectedBetweenOperatorAndRightOperand), + Syntax(rightOperand), + Syntax(unexpectedAfterRightOperand) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeftOperand: UnexpectedNodesSyntax? { @@ -3533,6 +3715,14 @@ public struct InheritanceClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndInheritedTypes), + Syntax(inheritedTypes), + Syntax(unexpectedAfterInheritedTypes) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeColon: UnexpectedNodesSyntax? { @@ -3678,6 +3868,14 @@ public struct InheritedTypeSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeType), + Syntax(type), + Syntax(unexpectedBetweenTypeAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeType: UnexpectedNodesSyntax? { @@ -3802,6 +4000,14 @@ public struct InitializerClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeEqual), + Syntax(equal), + Syntax(unexpectedBetweenEqualAndValue), + Syntax(value), + Syntax(unexpectedAfterValue) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeEqual: UnexpectedNodesSyntax? { @@ -3977,6 +4183,26 @@ public struct InitializerDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDe ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndInitKeyword), + Syntax(initKeyword), + Syntax(unexpectedBetweenInitKeywordAndOptionalMark), + Syntax(optionalMark), + Syntax(unexpectedBetweenOptionalMarkAndGenericParameterClause), + Syntax(genericParameterClause), + Syntax(unexpectedBetweenGenericParameterClauseAndSignature), + Syntax(signature), + Syntax(unexpectedBetweenSignatureAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedBetweenGenericWhereClauseAndBody), + Syntax(body), + Syntax(unexpectedAfterBody) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAttributes: UnexpectedNodesSyntax? { @@ -4265,6 +4491,8 @@ public struct IntegerLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforeLiteral), Syntax(literal), Syntax(unexpectedAfterLiteral)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLiteral: UnexpectedNodesSyntax? { @@ -4376,6 +4604,16 @@ public struct IsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndIsKeyword), + Syntax(isKeyword), + Syntax(unexpectedBetweenIsKeywordAndType), + Syntax(type), + Syntax(unexpectedAfterType) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeExpression: UnexpectedNodesSyntax? { @@ -4514,6 +4752,14 @@ public struct IsTypePatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _LeafP ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeIsKeyword), + Syntax(isKeyword), + Syntax(unexpectedBetweenIsKeywordAndType), + Syntax(type), + Syntax(unexpectedAfterType) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeIsKeyword: UnexpectedNodesSyntax? { diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesJKLMN.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesJKLMN.swift index d4f30a1e54b..757dab966a3 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesJKLMN.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesJKLMN.swift @@ -188,6 +188,14 @@ public struct KeyPathComponentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforePeriod), + Syntax(period), + Syntax(unexpectedBetweenPeriodAndComponent), + Syntax(component), + Syntax(unexpectedAfterComponent) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforePeriod: UnexpectedNodesSyntax? { @@ -317,6 +325,16 @@ public struct KeyPathExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeBackslash), + Syntax(backslash), + Syntax(unexpectedBetweenBackslashAndRoot), + Syntax(root), + Syntax(unexpectedBetweenRootAndComponents), + Syntax(components), + Syntax(unexpectedAfterComponents) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeBackslash: UnexpectedNodesSyntax? { @@ -469,6 +487,8 @@ public struct KeyPathOptionalComponentSyntax: SyntaxProtocol, SyntaxHashable, _L ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforeQuestionOrExclamationMark), Syntax(questionOrExclamationMark), Syntax(unexpectedAfterQuestionOrExclamationMark)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeQuestionOrExclamationMark: UnexpectedNodesSyntax? { @@ -567,6 +587,14 @@ public struct KeyPathPropertyComponentSyntax: SyntaxProtocol, SyntaxHashable, _L ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeDeclName), + Syntax(declName), + Syntax(unexpectedBetweenDeclNameAndGenericArgumentClause), + Syntax(genericArgumentClause), + Syntax(unexpectedAfterGenericArgumentClause) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeDeclName: UnexpectedNodesSyntax? { @@ -691,6 +719,16 @@ public struct KeyPathSubscriptComponentSyntax: SyntaxProtocol, SyntaxHashable, _ ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftSquare), + Syntax(leftSquare), + Syntax(unexpectedBetweenLeftSquareAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndRightSquare), + Syntax(rightSquare), + Syntax(unexpectedAfterRightSquare) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeftSquare: UnexpectedNodesSyntax? { @@ -879,6 +917,18 @@ public struct LabeledExprSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLabel), + Syntax(label), + Syntax(unexpectedBetweenLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLabel: UnexpectedNodesSyntax? { @@ -1065,6 +1115,18 @@ public struct LabeledSpecializeArgumentSyntax: SyntaxProtocol, SyntaxHashable, _ ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLabel), + Syntax(label), + Syntax(unexpectedBetweenLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndValue), + Syntax(value), + Syntax(unexpectedBetweenValueAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLabel: UnexpectedNodesSyntax? { @@ -1245,6 +1307,16 @@ public struct LabeledStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLabel), + Syntax(label), + Syntax(unexpectedBetweenLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndStatement), + Syntax(statement), + Syntax(unexpectedAfterStatement) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLabel: UnexpectedNodesSyntax? { @@ -1428,6 +1500,26 @@ public struct LayoutRequirementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeType), + Syntax(type), + Syntax(unexpectedBetweenTypeAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndLayoutSpecifier), + Syntax(layoutSpecifier), + Syntax(unexpectedBetweenLayoutSpecifierAndLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndSize), + Syntax(size), + Syntax(unexpectedBetweenSizeAndComma), + Syntax(comma), + Syntax(unexpectedBetweenCommaAndAlignment), + Syntax(alignment), + Syntax(unexpectedBetweenAlignmentAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeType: UnexpectedNodesSyntax? { @@ -1700,6 +1792,14 @@ public struct LifetimeSpecifierArgumentSyntax: SyntaxProtocol, SyntaxHashable, _ ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeParameter), + Syntax(parameter), + Syntax(unexpectedBetweenParameterAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeParameter: UnexpectedNodesSyntax? { @@ -1859,6 +1959,20 @@ public struct LifetimeTypeSpecifierSyntax: SyntaxProtocol, SyntaxHashable, _Leaf ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeDependsOnKeyword), + Syntax(dependsOnKeyword), + Syntax(unexpectedBetweenDependsOnKeywordAndLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndScopedKeyword), + Syntax(scopedKeyword), + Syntax(unexpectedBetweenScopedKeywordAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeDependsOnKeyword: UnexpectedNodesSyntax? { @@ -2117,6 +2231,26 @@ public struct MacroDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndMacroKeyword), + Syntax(macroKeyword), + Syntax(unexpectedBetweenMacroKeywordAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndGenericParameterClause), + Syntax(genericParameterClause), + Syntax(unexpectedBetweenGenericParameterClauseAndSignature), + Syntax(signature), + Syntax(unexpectedBetweenSignatureAndDefinition), + Syntax(definition), + Syntax(unexpectedBetweenDefinitionAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedAfterGenericWhereClause) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAttributes: UnexpectedNodesSyntax? { @@ -2469,6 +2603,30 @@ public struct MacroExpansionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndPound), + Syntax(pound), + Syntax(unexpectedBetweenPoundAndMacroName), + Syntax(macroName), + Syntax(unexpectedBetweenMacroNameAndGenericArgumentClause), + Syntax(genericArgumentClause), + Syntax(unexpectedBetweenGenericArgumentClauseAndLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedBetweenRightParenAndTrailingClosure), + Syntax(trailingClosure), + Syntax(unexpectedBetweenTrailingClosureAndAdditionalTrailingClosures), + Syntax(additionalTrailingClosures), + Syntax(unexpectedAfterAdditionalTrailingClosures) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAttributes: UnexpectedNodesSyntax? { @@ -2907,6 +3065,26 @@ public struct MacroExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforePound), + Syntax(pound), + Syntax(unexpectedBetweenPoundAndMacroName), + Syntax(macroName), + Syntax(unexpectedBetweenMacroNameAndGenericArgumentClause), + Syntax(genericArgumentClause), + Syntax(unexpectedBetweenGenericArgumentClauseAndLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedBetweenRightParenAndTrailingClosure), + Syntax(trailingClosure), + Syntax(unexpectedBetweenTrailingClosureAndAdditionalTrailingClosures), + Syntax(additionalTrailingClosures), + Syntax(unexpectedAfterAdditionalTrailingClosures) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforePound: UnexpectedNodesSyntax? { @@ -3224,6 +3402,18 @@ public struct MatchingPatternConditionSyntax: SyntaxProtocol, SyntaxHashable, _L ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeCaseKeyword), + Syntax(caseKeyword), + Syntax(unexpectedBetweenCaseKeywordAndPattern), + Syntax(pattern), + Syntax(unexpectedBetweenPatternAndTypeAnnotation), + Syntax(typeAnnotation), + Syntax(unexpectedBetweenTypeAnnotationAndInitializer), + Syntax(initializer), + Syntax(unexpectedAfterInitializer) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeCaseKeyword: UnexpectedNodesSyntax? { @@ -3389,6 +3579,16 @@ public struct MemberAccessExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeBase), + Syntax(base), + Syntax(unexpectedBetweenBaseAndPeriod), + Syntax(period), + Syntax(unexpectedBetweenPeriodAndDeclName), + Syntax(declName), + Syntax(unexpectedAfterDeclName) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeBase: UnexpectedNodesSyntax? { @@ -3533,6 +3733,14 @@ public struct MemberBlockItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeDecl), + Syntax(decl), + Syntax(unexpectedBetweenDeclAndSemicolon), + Syntax(semicolon), + Syntax(unexpectedAfterSemicolon) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeDecl: UnexpectedNodesSyntax? { @@ -3666,6 +3874,16 @@ public struct MemberBlockSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftBrace), + Syntax(leftBrace), + Syntax(unexpectedBetweenLeftBraceAndMembers), + Syntax(members), + Syntax(unexpectedBetweenMembersAndRightBrace), + Syntax(rightBrace), + Syntax(unexpectedAfterRightBrace) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeftBrace: UnexpectedNodesSyntax? { @@ -3844,6 +4062,18 @@ public struct MemberTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSyn ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeBaseType), + Syntax(baseType), + Syntax(unexpectedBetweenBaseTypeAndPeriod), + Syntax(period), + Syntax(unexpectedBetweenPeriodAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndGenericArgumentClause), + Syntax(genericArgumentClause), + Syntax(unexpectedAfterGenericArgumentClause) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeBaseType: UnexpectedNodesSyntax? { @@ -4010,6 +4240,16 @@ public struct MetatypeTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeS ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeBaseType), + Syntax(baseType), + Syntax(unexpectedBetweenBaseTypeAndPeriod), + Syntax(period), + Syntax(unexpectedBetweenPeriodAndMetatypeSpecifier), + Syntax(metatypeSpecifier), + Syntax(unexpectedAfterMetatypeSpecifier) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeBaseType: UnexpectedNodesSyntax? { @@ -4161,6 +4401,16 @@ public struct MissingDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndPlaceholder), + Syntax(placeholder), + Syntax(unexpectedAfterPlaceholder) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAttributes: UnexpectedNodesSyntax? { @@ -4343,6 +4593,8 @@ public struct MissingExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforePlaceholder: UnexpectedNodesSyntax? { @@ -4425,6 +4677,8 @@ public struct MissingPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _Leaf ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforePlaceholder: UnexpectedNodesSyntax? { @@ -4507,6 +4761,8 @@ public struct MissingStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforePlaceholder: UnexpectedNodesSyntax? { @@ -4589,6 +4845,8 @@ public struct MissingSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodeProt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforePlaceholder: UnexpectedNodesSyntax? { @@ -4671,6 +4929,8 @@ public struct MissingTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforePlaceholder: UnexpectedNodesSyntax? { @@ -4776,6 +5036,16 @@ public struct MultipleTrailingClosureElementSyntax: SyntaxProtocol, SyntaxHashab ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLabel), + Syntax(label), + Syntax(unexpectedBetweenLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndClosure), + Syntax(closure), + Syntax(unexpectedAfterClosure) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLabel: UnexpectedNodesSyntax? { @@ -4916,6 +5186,14 @@ public struct NamedOpaqueReturnTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _ ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeGenericParameterClause), + Syntax(genericParameterClause), + Syntax(unexpectedBetweenGenericParameterClauseAndType), + Syntax(type), + Syntax(unexpectedAfterType) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeGenericParameterClause: UnexpectedNodesSyntax? { @@ -5013,6 +5291,8 @@ public struct NilLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExp ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforeNilKeyword), Syntax(nilKeyword), Syntax(unexpectedAfterNilKeyword)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeNilKeyword: UnexpectedNodesSyntax? { diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesOP.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesOP.swift index 76a1e9e0384..fa99351508a 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesOP.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesOP.swift @@ -75,6 +75,14 @@ public struct ObjCSelectorPieceSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeName), + Syntax(name), + Syntax(unexpectedBetweenNameAndColon), + Syntax(colon), + Syntax(unexpectedAfterColon) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeName: UnexpectedNodesSyntax? { @@ -207,6 +215,16 @@ public struct OpaqueReturnTypeOfAttributeArgumentsSyntax: SyntaxProtocol, Syntax ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeMangledName), + Syntax(mangledName), + Syntax(unexpectedBetweenMangledNameAndComma), + Syntax(comma), + Syntax(unexpectedBetweenCommaAndOrdinal), + Syntax(ordinal), + Syntax(unexpectedAfterOrdinal) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeMangledName: UnexpectedNodesSyntax? { @@ -365,6 +383,18 @@ public struct OperatorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeFixitySpecifier), + Syntax(fixitySpecifier), + Syntax(unexpectedBetweenFixitySpecifierAndOperatorKeyword), + Syntax(operatorKeyword), + Syntax(unexpectedBetweenOperatorKeywordAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndOperatorPrecedenceAndTypes), + Syntax(operatorPrecedenceAndTypes), + Syntax(unexpectedAfterOperatorPrecedenceAndTypes) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeFixitySpecifier: UnexpectedNodesSyntax? { @@ -549,6 +579,16 @@ public struct OperatorPrecedenceAndTypesSyntax: SyntaxProtocol, SyntaxHashable, ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndPrecedenceGroup), + Syntax(precedenceGroup), + Syntax(unexpectedBetweenPrecedenceGroupAndDesignatedTypes), + Syntax(designatedTypes), + Syntax(unexpectedAfterDesignatedTypes) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeColon: UnexpectedNodesSyntax? { @@ -734,6 +774,18 @@ public struct OptionalBindingConditionSyntax: SyntaxProtocol, SyntaxHashable, _L ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeBindingSpecifier), + Syntax(bindingSpecifier), + Syntax(unexpectedBetweenBindingSpecifierAndPattern), + Syntax(pattern), + Syntax(unexpectedBetweenPatternAndTypeAnnotation), + Syntax(typeAnnotation), + Syntax(unexpectedBetweenTypeAnnotationAndInitializer), + Syntax(initializer), + Syntax(unexpectedAfterInitializer) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeBindingSpecifier: UnexpectedNodesSyntax? { @@ -894,6 +946,14 @@ public struct OptionalChainingExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _L ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndQuestionMark), + Syntax(questionMark), + Syntax(unexpectedAfterQuestionMark) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeExpression: UnexpectedNodesSyntax? { @@ -1008,6 +1068,14 @@ public struct OptionalTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeS ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeWrappedType), + Syntax(wrappedType), + Syntax(unexpectedBetweenWrappedTypeAndQuestionMark), + Syntax(questionMark), + Syntax(unexpectedAfterQuestionMark) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeWrappedType: UnexpectedNodesSyntax? { @@ -1149,6 +1217,20 @@ public struct OriginallyDefinedInAttributeArgumentsSyntax: SyntaxProtocol, Synta ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeModuleLabel), + Syntax(moduleLabel), + Syntax(unexpectedBetweenModuleLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndModuleName), + Syntax(moduleName), + Syntax(unexpectedBetweenModuleNameAndComma), + Syntax(comma), + Syntax(unexpectedBetweenCommaAndPlatforms), + Syntax(platforms), + Syntax(unexpectedAfterPlatforms) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeModuleLabel: UnexpectedNodesSyntax? { @@ -1358,6 +1440,14 @@ public struct PackElementExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafEx ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeEachKeyword), + Syntax(eachKeyword), + Syntax(unexpectedBetweenEachKeywordAndPack), + Syntax(pack), + Syntax(unexpectedAfterPack) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeEachKeyword: UnexpectedNodesSyntax? { @@ -1472,6 +1562,14 @@ public struct PackElementTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeEachKeyword), + Syntax(eachKeyword), + Syntax(unexpectedBetweenEachKeywordAndPack), + Syntax(pack), + Syntax(unexpectedAfterPack) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeEachKeyword: UnexpectedNodesSyntax? { @@ -1588,6 +1686,14 @@ public struct PackExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeRepeatKeyword), + Syntax(repeatKeyword), + Syntax(unexpectedBetweenRepeatKeywordAndRepetitionPattern), + Syntax(repetitionPattern), + Syntax(unexpectedAfterRepetitionPattern) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeRepeatKeyword: UnexpectedNodesSyntax? { @@ -1702,6 +1808,14 @@ public struct PackExpansionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _Leaf ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeRepeatKeyword), + Syntax(repeatKeyword), + Syntax(unexpectedBetweenRepeatKeywordAndRepetitionPattern), + Syntax(repetitionPattern), + Syntax(unexpectedAfterRepetitionPattern) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeRepeatKeyword: UnexpectedNodesSyntax? { @@ -1847,6 +1961,20 @@ public struct PatternBindingSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforePattern), + Syntax(pattern), + Syntax(unexpectedBetweenPatternAndTypeAnnotation), + Syntax(typeAnnotation), + Syntax(unexpectedBetweenTypeAnnotationAndInitializer), + Syntax(initializer), + Syntax(unexpectedBetweenInitializerAndAccessorBlock), + Syntax(accessorBlock), + Syntax(unexpectedBetweenAccessorBlockAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforePattern: UnexpectedNodesSyntax? { @@ -2022,6 +2150,8 @@ public struct PatternExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforePattern), Syntax(pattern), Syntax(unexpectedAfterPattern)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforePattern: UnexpectedNodesSyntax? { @@ -2117,6 +2247,14 @@ public struct PlatformVersionItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforePlatformVersion), + Syntax(platformVersion), + Syntax(unexpectedBetweenPlatformVersionAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforePlatformVersion: UnexpectedNodesSyntax? { @@ -2243,6 +2381,14 @@ public struct PlatformVersionSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforePlatform), + Syntax(platform), + Syntax(unexpectedBetweenPlatformAndVersion), + Syntax(version), + Syntax(unexpectedAfterVersion) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforePlatform: UnexpectedNodesSyntax? { @@ -2364,6 +2510,14 @@ public struct PostfixIfConfigExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Le ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeBase), + Syntax(base), + Syntax(unexpectedBetweenBaseAndConfig), + Syntax(config), + Syntax(unexpectedAfterConfig) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeBase: UnexpectedNodesSyntax? { @@ -2475,6 +2629,14 @@ public struct PostfixOperatorExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Le ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndOperator), + Syntax(`operator`), + Syntax(unexpectedAfterOperator) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeExpression: UnexpectedNodesSyntax? { @@ -2628,6 +2790,24 @@ public struct PoundSourceLocationArgumentsSyntax: SyntaxProtocol, SyntaxHashable ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeFileLabel), + Syntax(fileLabel), + Syntax(unexpectedBetweenFileLabelAndFileColon), + Syntax(fileColon), + Syntax(unexpectedBetweenFileColonAndFileName), + Syntax(fileName), + Syntax(unexpectedBetweenFileNameAndComma), + Syntax(comma), + Syntax(unexpectedBetweenCommaAndLineLabel), + Syntax(lineLabel), + Syntax(unexpectedBetweenLineLabelAndLineColon), + Syntax(lineColon), + Syntax(unexpectedBetweenLineColonAndLineNumber), + Syntax(lineNumber), + Syntax(unexpectedAfterLineNumber) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeFileLabel: UnexpectedNodesSyntax? { @@ -2871,6 +3051,18 @@ public struct PoundSourceLocationSyntax: DeclSyntaxProtocol, SyntaxHashable, _Le ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforePoundSourceLocation), + Syntax(poundSourceLocation), + Syntax(unexpectedBetweenPoundSourceLocationAndLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforePoundSourceLocation: UnexpectedNodesSyntax? { @@ -3045,6 +3237,16 @@ public struct PrecedenceGroupAssignmentSyntax: SyntaxProtocol, SyntaxHashable, _ ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAssignmentLabel), + Syntax(assignmentLabel), + Syntax(unexpectedBetweenAssignmentLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndValue), + Syntax(value), + Syntax(unexpectedAfterValue) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAssignmentLabel: UnexpectedNodesSyntax? { @@ -3203,6 +3405,16 @@ public struct PrecedenceGroupAssociativitySyntax: SyntaxProtocol, SyntaxHashable ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAssociativityLabel), + Syntax(associativityLabel), + Syntax(unexpectedBetweenAssociativityLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndValue), + Syntax(value), + Syntax(unexpectedAfterValue) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAssociativityLabel: UnexpectedNodesSyntax? { @@ -3389,6 +3601,24 @@ public struct PrecedenceGroupDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Le ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndPrecedencegroupKeyword), + Syntax(precedencegroupKeyword), + Syntax(unexpectedBetweenPrecedencegroupKeywordAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndLeftBrace), + Syntax(leftBrace), + Syntax(unexpectedBetweenLeftBraceAndGroupAttributes), + Syntax(groupAttributes), + Syntax(unexpectedBetweenGroupAttributesAndRightBrace), + Syntax(rightBrace), + Syntax(unexpectedAfterRightBrace) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAttributes: UnexpectedNodesSyntax? { @@ -3702,6 +3932,14 @@ public struct PrecedenceGroupNameSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeName), + Syntax(name), + Syntax(unexpectedBetweenNameAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeName: UnexpectedNodesSyntax? { @@ -3834,6 +4072,16 @@ public struct PrecedenceGroupRelationSyntax: SyntaxProtocol, SyntaxHashable, _Le ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeHigherThanOrLowerThanLabel), + Syntax(higherThanOrLowerThanLabel), + Syntax(unexpectedBetweenHigherThanOrLowerThanLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndPrecedenceGroups), + Syntax(precedenceGroups), + Syntax(unexpectedAfterPrecedenceGroups) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeHigherThanOrLowerThanLabel: UnexpectedNodesSyntax? { @@ -4015,6 +4263,14 @@ public struct PrefixOperatorExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeOperator), + Syntax(`operator`), + Syntax(unexpectedBetweenOperatorAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeOperator: UnexpectedNodesSyntax? { @@ -4140,6 +4396,16 @@ public struct PrimaryAssociatedTypeClauseSyntax: SyntaxProtocol, SyntaxHashable, ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftAngle), + Syntax(leftAngle), + Syntax(unexpectedBetweenLeftAngleAndPrimaryAssociatedTypes), + Syntax(primaryAssociatedTypes), + Syntax(unexpectedBetweenPrimaryAssociatedTypesAndRightAngle), + Syntax(rightAngle), + Syntax(unexpectedAfterRightAngle) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeftAngle: UnexpectedNodesSyntax? { @@ -4308,6 +4574,14 @@ public struct PrimaryAssociatedTypeSyntax: SyntaxProtocol, SyntaxHashable, _Leaf ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeName), + Syntax(name), + Syntax(unexpectedBetweenNameAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeName: UnexpectedNodesSyntax? { @@ -4485,6 +4759,26 @@ public struct ProtocolDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndProtocolKeyword), + Syntax(protocolKeyword), + Syntax(unexpectedBetweenProtocolKeywordAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndPrimaryAssociatedTypeClause), + Syntax(primaryAssociatedTypeClause), + Syntax(unexpectedBetweenPrimaryAssociatedTypeClauseAndInheritanceClause), + Syntax(inheritanceClause), + Syntax(unexpectedBetweenInheritanceClauseAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedBetweenGenericWhereClauseAndMemberBlock), + Syntax(memberBlock), + Syntax(unexpectedAfterMemberBlock) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAttributes: UnexpectedNodesSyntax? { diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift index b76e03d360b..310f6ae7ec5 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift @@ -88,6 +88,20 @@ public struct RegexLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeOpeningPounds), + Syntax(openingPounds), + Syntax(unexpectedBetweenOpeningPoundsAndOpeningSlash), + Syntax(openingSlash), + Syntax(unexpectedBetweenOpeningSlashAndRegex), + Syntax(regex), + Syntax(unexpectedBetweenRegexAndClosingSlash), + Syntax(closingSlash), + Syntax(unexpectedBetweenClosingSlashAndClosingPounds), + Syntax(closingPounds), + Syntax(unexpectedAfterClosingPounds) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeOpeningPounds: UnexpectedNodesSyntax? { @@ -288,6 +302,18 @@ public struct RepeatStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyn ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeRepeatKeyword), + Syntax(repeatKeyword), + Syntax(unexpectedBetweenRepeatKeywordAndBody), + Syntax(body), + Syntax(unexpectedBetweenBodyAndWhileKeyword), + Syntax(whileKeyword), + Syntax(unexpectedBetweenWhileKeywordAndCondition), + Syntax(condition), + Syntax(unexpectedAfterCondition) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeRepeatKeyword: UnexpectedNodesSyntax? { @@ -454,6 +480,14 @@ public struct ReturnClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeArrow), + Syntax(arrow), + Syntax(unexpectedBetweenArrowAndType), + Syntax(type), + Syntax(unexpectedAfterType) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeArrow: UnexpectedNodesSyntax? { @@ -571,6 +605,14 @@ public struct ReturnStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyn ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeReturnKeyword), + Syntax(returnKeyword), + Syntax(unexpectedBetweenReturnKeywordAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeReturnKeyword: UnexpectedNodesSyntax? { @@ -696,6 +738,16 @@ public struct SameTypeRequirementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftType), + Syntax(leftType), + Syntax(unexpectedBetweenLeftTypeAndEqual), + Syntax(equal), + Syntax(unexpectedBetweenEqualAndRightType), + Syntax(rightType), + Syntax(unexpectedAfterRightType) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeftType: UnexpectedNodesSyntax? { @@ -826,6 +878,8 @@ public struct SequenceExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprS ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforeElements), Syntax(elements), Syntax(unexpectedAfterElements)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeElements: UnexpectedNodesSyntax? { @@ -957,6 +1011,16 @@ public struct SimpleStringLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeOpeningQuote), + Syntax(openingQuote), + Syntax(unexpectedBetweenOpeningQuoteAndSegments), + Syntax(segments), + Syntax(unexpectedBetweenSegmentsAndClosingQuote), + Syntax(closingQuote), + Syntax(unexpectedAfterClosingQuote) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeOpeningQuote: UnexpectedNodesSyntax? { @@ -1122,6 +1186,8 @@ public struct SimpleTypeSpecifierSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforeSpecifier), Syntax(specifier), Syntax(unexpectedAfterSpecifier)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeSpecifier: UnexpectedNodesSyntax? { @@ -1222,6 +1288,14 @@ public struct SomeOrAnyTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafType ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeSomeOrAnySpecifier), + Syntax(someOrAnySpecifier), + Syntax(unexpectedBetweenSomeOrAnySpecifierAndConstraint), + Syntax(constraint), + Syntax(unexpectedAfterConstraint) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeSomeOrAnySpecifier: UnexpectedNodesSyntax? { @@ -1346,6 +1420,16 @@ public struct SourceFileSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodeP ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeShebang), + Syntax(shebang), + Syntax(unexpectedBetweenShebangAndStatements), + Syntax(statements), + Syntax(unexpectedBetweenStatementsAndEndOfFileToken), + Syntax(endOfFileToken), + Syntax(unexpectedAfterEndOfFileToken) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeShebang: UnexpectedNodesSyntax? { @@ -1534,6 +1618,18 @@ public struct SpecializeAvailabilityArgumentSyntax: SyntaxProtocol, SyntaxHashab ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAvailabilityLabel), + Syntax(availabilityLabel), + Syntax(unexpectedBetweenAvailabilityLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndAvailabilityArguments), + Syntax(availabilityArguments), + Syntax(unexpectedBetweenAvailabilityArgumentsAndSemicolon), + Syntax(semicolon), + Syntax(unexpectedAfterSemicolon) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAvailabilityLabel: UnexpectedNodesSyntax? { @@ -1749,6 +1845,18 @@ public struct SpecializeTargetFunctionArgumentSyntax: SyntaxProtocol, SyntaxHash ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeTargetLabel), + Syntax(targetLabel), + Syntax(unexpectedBetweenTargetLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndDeclName), + Syntax(declName), + Syntax(unexpectedBetweenDeclNameAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeTargetLabel: UnexpectedNodesSyntax? { @@ -1956,6 +2064,20 @@ public struct StringLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeOpeningPounds), + Syntax(openingPounds), + Syntax(unexpectedBetweenOpeningPoundsAndOpeningQuote), + Syntax(openingQuote), + Syntax(unexpectedBetweenOpeningQuoteAndSegments), + Syntax(segments), + Syntax(unexpectedBetweenSegmentsAndClosingQuote), + Syntax(closingQuote), + Syntax(unexpectedBetweenClosingQuoteAndClosingPounds), + Syntax(closingPounds), + Syntax(unexpectedAfterClosingPounds) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeOpeningPounds: UnexpectedNodesSyntax? { @@ -2166,6 +2288,8 @@ public struct StringSegmentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforeContent), Syntax(content), Syntax(unexpectedAfterContent)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeContent: UnexpectedNodesSyntax? { @@ -2364,6 +2488,26 @@ public struct StructDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyn ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndStructKeyword), + Syntax(structKeyword), + Syntax(unexpectedBetweenStructKeywordAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndGenericParameterClause), + Syntax(genericParameterClause), + Syntax(unexpectedBetweenGenericParameterClauseAndInheritanceClause), + Syntax(inheritanceClause), + Syntax(unexpectedBetweenInheritanceClauseAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedBetweenGenericWhereClauseAndMemberBlock), + Syntax(memberBlock), + Syntax(unexpectedAfterMemberBlock) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAttributes: UnexpectedNodesSyntax? { @@ -2693,6 +2837,22 @@ public struct SubscriptCallExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeCalledExpression), + Syntax(calledExpression), + Syntax(unexpectedBetweenCalledExpressionAndLeftSquare), + Syntax(leftSquare), + Syntax(unexpectedBetweenLeftSquareAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndRightSquare), + Syntax(rightSquare), + Syntax(unexpectedBetweenRightSquareAndTrailingClosure), + Syntax(trailingClosure), + Syntax(unexpectedBetweenTrailingClosureAndAdditionalTrailingClosures), + Syntax(additionalTrailingClosures), + Syntax(unexpectedAfterAdditionalTrailingClosures) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeCalledExpression: UnexpectedNodesSyntax? { @@ -2988,6 +3148,26 @@ public struct SubscriptDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndSubscriptKeyword), + Syntax(subscriptKeyword), + Syntax(unexpectedBetweenSubscriptKeywordAndGenericParameterClause), + Syntax(genericParameterClause), + Syntax(unexpectedBetweenGenericParameterClauseAndParameterClause), + Syntax(parameterClause), + Syntax(unexpectedBetweenParameterClauseAndReturnClause), + Syntax(returnClause), + Syntax(unexpectedBetweenReturnClauseAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedBetweenGenericWhereClauseAndAccessorBlock), + Syntax(accessorBlock), + Syntax(unexpectedAfterAccessorBlock) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAttributes: UnexpectedNodesSyntax? { @@ -3263,6 +3443,8 @@ public struct SuperExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforeSuperKeyword), Syntax(superKeyword), Syntax(unexpectedAfterSuperKeyword)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeSuperKeyword: UnexpectedNodesSyntax? { @@ -3353,6 +3535,14 @@ public struct SuppressedTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeWithoutTilde), + Syntax(withoutTilde), + Syntax(unexpectedBetweenWithoutTildeAndType), + Syntax(type), + Syntax(unexpectedAfterType) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeWithoutTilde: UnexpectedNodesSyntax? { @@ -3478,6 +3668,16 @@ public struct SwitchCaseItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforePattern), + Syntax(pattern), + Syntax(unexpectedBetweenPatternAndWhereClause), + Syntax(whereClause), + Syntax(unexpectedBetweenWhereClauseAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforePattern: UnexpectedNodesSyntax? { @@ -3623,6 +3823,16 @@ public struct SwitchCaseLabelSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeCaseKeyword), + Syntax(caseKeyword), + Syntax(unexpectedBetweenCaseKeywordAndCaseItems), + Syntax(caseItems), + Syntax(unexpectedBetweenCaseItemsAndColon), + Syntax(colon), + Syntax(unexpectedAfterColon) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeCaseKeyword: UnexpectedNodesSyntax? { @@ -3881,6 +4091,16 @@ public struct SwitchCaseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodeP ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttribute), + Syntax(attribute), + Syntax(unexpectedBetweenAttributeAndLabel), + Syntax(label), + Syntax(unexpectedBetweenLabelAndStatements), + Syntax(statements), + Syntax(unexpectedAfterStatements) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAttribute: UnexpectedNodesSyntax? { @@ -4044,6 +4264,14 @@ public struct SwitchDefaultLabelSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeDefaultKeyword), + Syntax(defaultKeyword), + Syntax(unexpectedBetweenDefaultKeywordAndColon), + Syntax(colon), + Syntax(unexpectedAfterColon) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeDefaultKeyword: UnexpectedNodesSyntax? { @@ -4200,6 +4428,20 @@ public struct SwitchExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyn ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeSwitchKeyword), + Syntax(switchKeyword), + Syntax(unexpectedBetweenSwitchKeywordAndSubject), + Syntax(subject), + Syntax(unexpectedBetweenSubjectAndLeftBrace), + Syntax(leftBrace), + Syntax(unexpectedBetweenLeftBraceAndCases), + Syntax(cases), + Syntax(unexpectedBetweenCasesAndRightBrace), + Syntax(rightBrace), + Syntax(unexpectedAfterRightBrace) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeSwitchKeyword: UnexpectedNodesSyntax? { diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesTUVWXYZ.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesTUVWXYZ.swift index 61a0750101c..92c3e44d306 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesTUVWXYZ.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesTUVWXYZ.swift @@ -99,6 +99,20 @@ public struct TernaryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeCondition), + Syntax(condition), + Syntax(unexpectedBetweenConditionAndQuestionMark), + Syntax(questionMark), + Syntax(unexpectedBetweenQuestionMarkAndThenExpression), + Syntax(thenExpression), + Syntax(unexpectedBetweenThenExpressionAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndElseExpression), + Syntax(elseExpression), + Syntax(unexpectedAfterElseExpression) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeCondition: UnexpectedNodesSyntax? { @@ -289,6 +303,14 @@ public struct ThenStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynta ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeThenKeyword), + Syntax(thenKeyword), + Syntax(unexpectedBetweenThenKeywordAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeThenKeyword: UnexpectedNodesSyntax? { @@ -403,6 +425,14 @@ public struct ThrowStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeThrowKeyword), + Syntax(throwKeyword), + Syntax(unexpectedBetweenThrowKeywordAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeThrowKeyword: UnexpectedNodesSyntax? { @@ -542,6 +572,18 @@ public struct ThrowsClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeThrowsSpecifier), + Syntax(throwsSpecifier), + Syntax(unexpectedBetweenThrowsSpecifierAndLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndType), + Syntax(type), + Syntax(unexpectedBetweenTypeAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeThrowsSpecifier: UnexpectedNodesSyntax? { @@ -734,6 +776,16 @@ public struct TryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntax ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeTryKeyword), + Syntax(tryKeyword), + Syntax(unexpectedBetweenTryKeywordAndQuestionOrExclamationMark), + Syntax(questionOrExclamationMark), + Syntax(unexpectedBetweenQuestionOrExclamationMarkAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeTryKeyword: UnexpectedNodesSyntax? { @@ -880,6 +932,16 @@ public struct TupleExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndElements), + Syntax(elements), + Syntax(unexpectedBetweenElementsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeftParen: UnexpectedNodesSyntax? { @@ -1068,6 +1130,18 @@ public struct TuplePatternElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLabel), + Syntax(label), + Syntax(unexpectedBetweenLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndPattern), + Syntax(pattern), + Syntax(unexpectedBetweenPatternAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLabel: UnexpectedNodesSyntax? { @@ -1255,6 +1329,16 @@ public struct TuplePatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _LeafPa ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndElements), + Syntax(elements), + Syntax(unexpectedBetweenElementsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeftParen: UnexpectedNodesSyntax? { @@ -1462,6 +1546,24 @@ public struct TupleTypeElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeInoutKeyword), + Syntax(inoutKeyword), + Syntax(unexpectedBetweenInoutKeywordAndFirstName), + Syntax(firstName), + Syntax(unexpectedBetweenFirstNameAndSecondName), + Syntax(secondName), + Syntax(unexpectedBetweenSecondNameAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndType), + Syntax(type), + Syntax(unexpectedBetweenTypeAndEllipsis), + Syntax(ellipsis), + Syntax(unexpectedBetweenEllipsisAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeInoutKeyword: UnexpectedNodesSyntax? { @@ -1702,6 +1804,16 @@ public struct TupleTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndElements), + Syntax(elements), + Syntax(unexpectedBetweenElementsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeftParen: UnexpectedNodesSyntax? { @@ -1903,6 +2015,24 @@ public struct TypeAliasDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndTypealiasKeyword), + Syntax(typealiasKeyword), + Syntax(unexpectedBetweenTypealiasKeywordAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndGenericParameterClause), + Syntax(genericParameterClause), + Syntax(unexpectedBetweenGenericParameterClauseAndInitializer), + Syntax(initializer), + Syntax(unexpectedBetweenInitializerAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedAfterGenericWhereClause) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAttributes: UnexpectedNodesSyntax? { @@ -2184,6 +2314,14 @@ public struct TypeAnnotationSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndType), + Syntax(type), + Syntax(unexpectedAfterType) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeColon: UnexpectedNodesSyntax? { @@ -2307,6 +2445,14 @@ public struct TypeEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashable, _LeafS ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAsyncSpecifier), + Syntax(asyncSpecifier), + Syntax(unexpectedBetweenAsyncSpecifierAndThrowsClause), + Syntax(throwsClause), + Syntax(unexpectedAfterThrowsClause) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAsyncSpecifier: UnexpectedNodesSyntax? { @@ -2407,6 +2553,8 @@ public struct TypeExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynta ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforeType), Syntax(type), Syntax(unexpectedAfterType)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeType: UnexpectedNodesSyntax? { @@ -2499,6 +2647,14 @@ public struct TypeInitializerClauseSyntax: SyntaxProtocol, SyntaxHashable, _Leaf ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeEqual), + Syntax(equal), + Syntax(unexpectedBetweenEqualAndValue), + Syntax(value), + Syntax(unexpectedAfterValue) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeEqual: UnexpectedNodesSyntax? { @@ -2626,6 +2782,16 @@ public struct UnavailableFromAsyncAttributeArgumentsSyntax: SyntaxProtocol, Synt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeMessageLabel), + Syntax(messageLabel), + Syntax(unexpectedBetweenMessageLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndMessage), + Syntax(message), + Syntax(unexpectedAfterMessage) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeMessageLabel: UnexpectedNodesSyntax? { @@ -2776,6 +2942,16 @@ public struct UnderscorePrivateAttributeArgumentsSyntax: SyntaxProtocol, SyntaxH ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeSourceFileLabel), + Syntax(sourceFileLabel), + Syntax(unexpectedBetweenSourceFileLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndFilename), + Syntax(filename), + Syntax(unexpectedAfterFilename) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeSourceFileLabel: UnexpectedNodesSyntax? { @@ -2918,6 +3094,14 @@ public struct UnresolvedAsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAsKeyword), + Syntax(asKeyword), + Syntax(unexpectedBetweenAsKeywordAndQuestionOrExclamationMark), + Syntax(questionOrExclamationMark), + Syntax(unexpectedAfterQuestionOrExclamationMark) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAsKeyword: UnexpectedNodesSyntax? { @@ -3027,6 +3211,8 @@ public struct UnresolvedIsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforeIsKeyword), Syntax(isKeyword), Syntax(unexpectedAfterIsKeyword)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeIsKeyword: UnexpectedNodesSyntax? { @@ -3130,6 +3316,16 @@ public struct UnresolvedTernaryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _ ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeQuestionMark), + Syntax(questionMark), + Syntax(unexpectedBetweenQuestionMarkAndThenExpression), + Syntax(thenExpression), + Syntax(unexpectedBetweenThenExpressionAndColon), + Syntax(colon), + Syntax(unexpectedAfterColon) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeQuestionMark: UnexpectedNodesSyntax? { @@ -3267,6 +3463,14 @@ public struct ValueBindingPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeBindingSpecifier), + Syntax(bindingSpecifier), + Syntax(unexpectedBetweenBindingSpecifierAndPattern), + Syntax(pattern), + Syntax(unexpectedAfterPattern) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeBindingSpecifier: UnexpectedNodesSyntax? { @@ -3410,6 +3614,18 @@ public struct VariableDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndBindingSpecifier), + Syntax(bindingSpecifier), + Syntax(unexpectedBetweenBindingSpecifierAndBindings), + Syntax(bindings), + Syntax(unexpectedAfterBindings) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeAttributes: UnexpectedNodesSyntax? { @@ -3673,6 +3889,14 @@ public struct VersionComponentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforePeriod), + Syntax(period), + Syntax(unexpectedBetweenPeriodAndNumber), + Syntax(number), + Syntax(unexpectedAfterNumber) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforePeriod: UnexpectedNodesSyntax? { @@ -3804,6 +4028,14 @@ public struct VersionTupleSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeMajor), + Syntax(major), + Syntax(unexpectedBetweenMajorAndComponents), + Syntax(components), + Syntax(unexpectedAfterComponents) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeMajor: UnexpectedNodesSyntax? { @@ -3954,6 +4186,14 @@ public struct WhereClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeWhereKeyword), + Syntax(whereKeyword), + Syntax(unexpectedBetweenWhereKeywordAndCondition), + Syntax(condition), + Syntax(unexpectedAfterCondition) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeWhereKeyword: UnexpectedNodesSyntax? { @@ -4075,6 +4315,16 @@ public struct WhileStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeWhileKeyword), + Syntax(whileKeyword), + Syntax(unexpectedBetweenWhileKeywordAndConditions), + Syntax(conditions), + Syntax(unexpectedBetweenConditionsAndBody), + Syntax(body), + Syntax(unexpectedAfterBody) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeWhileKeyword: UnexpectedNodesSyntax? { @@ -4234,6 +4484,8 @@ public struct WildcardPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _Lea ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [Syntax(unexpectedBeforeWildcard), Syntax(wildcard), Syntax(unexpectedAfterWildcard)] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeWildcard: UnexpectedNodesSyntax? { @@ -4406,6 +4658,14 @@ public struct YieldStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeYieldKeyword), + Syntax(yieldKeyword), + Syntax(unexpectedBetweenYieldKeywordAndYieldedExpressions), + Syntax(yieldedExpressions), + Syntax(unexpectedAfterYieldedExpressions) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeYieldKeyword: UnexpectedNodesSyntax? { @@ -4524,6 +4784,14 @@ public struct YieldedExpressionSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndComma), + Syntax(comma), + Syntax(unexpectedAfterComma) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeExpression: UnexpectedNodesSyntax? { @@ -4649,6 +4917,16 @@ public struct YieldedExpressionsClauseSyntax: SyntaxProtocol, SyntaxHashable, _L ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndElements), + Syntax(elements), + Syntax(unexpectedBetweenElementsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] + Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } public var unexpectedBeforeLeftParen: UnexpectedNodesSyntax? { diff --git a/Tests/SwiftSyntaxTest/MemoryLayoutTest.swift b/Tests/SwiftSyntaxTest/MemoryLayoutTest.swift index ad4a6bbc4ba..c4f18e7edfc 100644 --- a/Tests/SwiftSyntaxTest/MemoryLayoutTest.swift +++ b/Tests/SwiftSyntaxTest/MemoryLayoutTest.swift @@ -34,7 +34,7 @@ final class MemoryLayoutTest: XCTestCase { "Syntax": .init(size: 16, stride: 16, alignment: 8), "Syntax.Info": .init(size: 8, stride: 8, alignment: 8), - "Syntax.Info.Root": .init(size: 8, stride: 8, alignment: 8), + "Syntax.Info.Root": .init(size: 24, stride: 24, alignment: 8), "Syntax.Info.NonRoot": .init(size: 48, stride: 48, alignment: 8), ] diff --git a/Tests/SwiftSyntaxTest/SyntaxTrackingTests.swift b/Tests/SwiftSyntaxTest/SyntaxTrackingTests.swift new file mode 100644 index 00000000000..9bfc153d58b --- /dev/null +++ b/Tests/SwiftSyntaxTest/SyntaxTrackingTests.swift @@ -0,0 +1,120 @@ +//===----------------------------------------------------------------------===// +// +// This source file is part of the Swift.org open source project +// +// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors +// Licensed under Apache License v2.0 with Runtime Library Exception +// +// See https://swift.org/LICENSE.txt for license information +// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors +// +//===----------------------------------------------------------------------===// + +@_spi(RawSyntax) import SwiftSyntax +import SwiftSyntaxBuilder +import XCTest + +public class SyntaxTrackingTests: XCTestCase { + func testReuseSubtreeWithoutNodeShiftInSameArena() { + let originalAccessorBlock = AccessorBlockSyntax("{ return 1 }").tracked + + let newAccessorBlock = AccessorBlockSyntax( + leadingTrivia: .spaces(10), + accessors: originalAccessorBlock.accessors + ) + + XCTAssertNotEqual(newAccessorBlock.accessors.id, originalAccessorBlock.accessors.id) + XCTAssertEqual( + newAccessorBlock.accessors.originalNode(in: originalAccessorBlock)?.id, + originalAccessorBlock.accessors.id + ) + } + + func testReuseSubtreeWithoutNodeShiftInNewArena() { + let originalAccessorBlock = AccessorBlockSyntax("{ return 1 }").tracked + + let newAccessorBlock = AccessorBlockSyntax( + leadingTrivia: .spaces(10), + accessors: originalAccessorBlock.accessors + ) + + XCTAssertEqual( + newAccessorBlock.accessors.originalNode(in: originalAccessorBlock)?.id, + originalAccessorBlock.accessors.id + ) + } + + func testReuseSubtreeWithNodeShift() { + let originalAccessorBlock = AccessorBlockSyntax("{ return 1 }").tracked + + let newAccessorBlock = AccessorBlockSyntax( + leadingTrivia: .spaces(10), + [Syntax(TokenSyntax.identifier("unexpected"))], + accessors: originalAccessorBlock.accessors + ) + + XCTAssertEqual( + newAccessorBlock.accessors.originalNode(in: originalAccessorBlock)?.id, + originalAccessorBlock.accessors.id + ) + } + + func testReplaceOtherNodeWithoutNodeShift() { + let originalAccessorBlock = AccessorBlockSyntax("{ return 1 }").tracked + + let newAccessor = originalAccessorBlock.with(\.leftBrace, .leftBraceToken()) + + XCTAssertEqual( + newAccessor.accessors.originalNode(in: originalAccessorBlock)?.id, + originalAccessorBlock.accessors.id + ) + } + + func testReplaceNonNilByNil() throws { + let originalFunction = try FunctionDeclSyntax("func foo() async {}").tracked + var modifiedFunction = originalFunction + modifiedFunction.signature.effectSpecifiers = nil + + XCTAssertEqual(modifiedFunction.body?.originalNode(in: originalFunction)?.id, originalFunction.body?.id) + } + + func testReplaceNilByNonNil() throws { + let originalFunction = try FunctionDeclSyntax("func foo() {}").tracked + var modifiedFunction = originalFunction + modifiedFunction.signature.effectSpecifiers = FunctionEffectSpecifiersSyntax(asyncSpecifier: .keyword(.async)) + + XCTAssertEqual(modifiedFunction.body?.originalNode(in: originalFunction)?.id, originalFunction.body?.id) + } + + func testReplaceNilByNil() throws { + let originalFunction = try FunctionDeclSyntax("func foo() {}").tracked + var modifiedFunction = originalFunction + modifiedFunction.signature.effectSpecifiers = nil + + XCTAssertEqual(modifiedFunction.body?.originalNode(in: originalFunction)?.id, originalFunction.body?.id) + } + + func testDetach() throws { + let originalFunction = try FunctionDeclSyntax("func foo() {}").tracked + let modifiedFunction = originalFunction.body?.detached + + XCTAssertEqual(modifiedFunction?.originalNode(in: originalFunction)?.id, originalFunction.body?.id) + } + + func testSyntaxCollection() throws { + let originalFunction = DeclSyntax("func foo() {}").tracked + + let codeBlockItemList = CodeBlockItemListSyntax([CodeBlockItemSyntax(item: .decl(originalFunction))]) + + XCTAssertEqual(codeBlockItemList.first?.item.originalNode(in: originalFunction)?.id, originalFunction.id) + } + + func testSyntaxCollectionModification() throws { + let originalFunction = DeclSyntax("func foo() {}").tracked + + var codeBlockItemList = CodeBlockItemListSyntax([CodeBlockItemSyntax(item: .decl(originalFunction))]) + codeBlockItemList.insert(CodeBlockItemSyntax("func bar() {}"), at: codeBlockItemList.startIndex) + + XCTAssertEqual(codeBlockItemList.last?.item.originalNode(in: originalFunction)?.id, originalFunction.id) + } +} From 0cdc8e69e8ef183749e4f1349f7525fcab522a20 Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Thu, 1 Aug 2024 14:36:48 -0700 Subject: [PATCH 5/9] Cast syntax nodes to `Syntax` when keeping them alive in the syntax node initializers --- .../swiftsyntax/SyntaxNodesFile.swift | 6 +- .../generated/syntaxNodes/SyntaxNodesAB.swift | 322 +++++++------- .../generated/syntaxNodes/SyntaxNodesC.swift | 386 ++++++++-------- .../generated/syntaxNodes/SyntaxNodesD.swift | 322 +++++++------- .../generated/syntaxNodes/SyntaxNodesEF.swift | 414 ++++++++--------- .../syntaxNodes/SyntaxNodesGHI.swift | 344 +++++++------- .../syntaxNodes/SyntaxNodesJKLMN.swift | 414 ++++++++--------- .../generated/syntaxNodes/SyntaxNodesOP.swift | 418 +++++++++--------- .../syntaxNodes/SyntaxNodesQRS.swift | 356 +++++++-------- .../syntaxNodes/SyntaxNodesTUVWXYZ.swift | 388 ++++++++-------- 10 files changed, 1685 insertions(+), 1685 deletions(-) diff --git a/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxNodesFile.swift b/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxNodesFile.swift index b2ce091aec1..6b6b6583f2b 100644 --- a/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxNodesFile.swift +++ b/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxNodesFile.swift @@ -60,9 +60,9 @@ func syntaxNode(nodesStartingWith: [Character]) -> SourceFileSyntax { \(node.generateInitializerDeclHeader()) """ ) { - let parameters = ClosureParameterListSyntax { + let parameters = TupleExprSyntax { for child in node.children { - ClosureParameterSyntax(firstName: child.varOrCaseName.backtickedIfNeeded) + LabeledExprSyntax(expression: ExprSyntax("Syntax(\(child.varOrCaseName.backtickedIfNeeded))")) } } @@ -94,7 +94,7 @@ func syntaxNode(nodesStartingWith: [Character]) -> SourceFileSyntax { calledExpression: ExprSyntax("withExtendedLifetime"), leftParen: .leftParenToken(), arguments: LabeledExprListSyntax { - LabeledExprSyntax(expression: ExprSyntax("(SyntaxArena(), (\(parameters)))")) + LabeledExprSyntax(expression: ExprSyntax("(SyntaxArena(), \(parameters))")) }, rightParen: .rightParenToken(), trailingClosure: ClosureExprSyntax(signature: closureSignature) { diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesAB.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesAB.swift index 7894ff7fdd0..b8ac4f45f09 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesAB.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesAB.swift @@ -136,13 +136,13 @@ public struct AccessorBlockSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeftBrace, - leftBrace, - unexpectedBetweenLeftBraceAndAccessors, - accessors, - unexpectedBetweenAccessorsAndRightBrace, - rightBrace, - unexpectedAfterRightBrace + Syntax(unexpectedBeforeLeftBrace), + Syntax(leftBrace), + Syntax(unexpectedBetweenLeftBraceAndAccessors), + Syntax(accessors), + Syntax(unexpectedBetweenAccessorsAndRightBrace), + Syntax(rightBrace), + Syntax(unexpectedAfterRightBrace) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftBrace?.raw, @@ -307,19 +307,19 @@ public struct AccessorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAttributes, - attributes, - unexpectedBetweenAttributesAndModifier, - modifier, - unexpectedBetweenModifierAndAccessorSpecifier, - accessorSpecifier, - unexpectedBetweenAccessorSpecifierAndParameters, - parameters, - unexpectedBetweenParametersAndEffectSpecifiers, - effectSpecifiers, - unexpectedBetweenEffectSpecifiersAndBody, - body, - unexpectedAfterBody + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifier), + Syntax(modifier), + Syntax(unexpectedBetweenModifierAndAccessorSpecifier), + Syntax(accessorSpecifier), + Syntax(unexpectedBetweenAccessorSpecifierAndParameters), + Syntax(parameters), + Syntax(unexpectedBetweenParametersAndEffectSpecifiers), + Syntax(effectSpecifiers), + Syntax(unexpectedBetweenEffectSpecifiersAndBody), + Syntax(body), + Syntax(unexpectedAfterBody) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, @@ -579,11 +579,11 @@ public struct AccessorEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashable, _L // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAsyncSpecifier, - asyncSpecifier, - unexpectedBetweenAsyncSpecifierAndThrowsClause, - throwsClause, - unexpectedAfterThrowsClause + Syntax(unexpectedBeforeAsyncSpecifier), + Syntax(asyncSpecifier), + Syntax(unexpectedBetweenAsyncSpecifierAndThrowsClause), + Syntax(throwsClause), + Syntax(unexpectedAfterThrowsClause) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAsyncSpecifier?.raw, @@ -711,13 +711,13 @@ public struct AccessorParametersSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeftParen, - leftParen, - unexpectedBetweenLeftParenAndName, - name, - unexpectedBetweenNameAndRightParen, - rightParen, - unexpectedAfterRightParen + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftParen?.raw, @@ -888,23 +888,23 @@ public struct ActorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAttributes, - attributes, - unexpectedBetweenAttributesAndModifiers, - modifiers, - unexpectedBetweenModifiersAndActorKeyword, - actorKeyword, - unexpectedBetweenActorKeywordAndName, - name, - unexpectedBetweenNameAndGenericParameterClause, - genericParameterClause, - unexpectedBetweenGenericParameterClauseAndInheritanceClause, - inheritanceClause, - unexpectedBetweenInheritanceClauseAndGenericWhereClause, - genericWhereClause, - unexpectedBetweenGenericWhereClauseAndMemberBlock, - memberBlock, - unexpectedAfterMemberBlock + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndActorKeyword), + Syntax(actorKeyword), + Syntax(unexpectedBetweenActorKeywordAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndGenericParameterClause), + Syntax(genericParameterClause), + Syntax(unexpectedBetweenGenericParameterClauseAndInheritanceClause), + Syntax(inheritanceClause), + Syntax(unexpectedBetweenInheritanceClauseAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedBetweenGenericWhereClauseAndMemberBlock), + Syntax(memberBlock), + Syntax(unexpectedAfterMemberBlock) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, @@ -1236,11 +1236,11 @@ public struct ArrayElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeExpression, - expression, - unexpectedBetweenExpressionAndTrailingComma, - trailingComma, - unexpectedAfterTrailingComma + Syntax(unexpectedBeforeExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeExpression?.raw, @@ -1363,13 +1363,13 @@ public struct ArrayExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeftSquare, - leftSquare, - unexpectedBetweenLeftSquareAndElements, - elements, - unexpectedBetweenElementsAndRightSquare, - rightSquare, - unexpectedAfterRightSquare + Syntax(unexpectedBeforeLeftSquare), + Syntax(leftSquare), + Syntax(unexpectedBetweenLeftSquareAndElements), + Syntax(elements), + Syntax(unexpectedBetweenElementsAndRightSquare), + Syntax(rightSquare), + Syntax(unexpectedAfterRightSquare) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftSquare?.raw, @@ -1544,13 +1544,13 @@ public struct ArrayTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSynt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeftSquare, - leftSquare, - unexpectedBetweenLeftSquareAndElement, - element, - unexpectedBetweenElementAndRightSquare, - rightSquare, - unexpectedAfterRightSquare + Syntax(unexpectedBeforeLeftSquare), + Syntax(leftSquare), + Syntax(unexpectedBetweenLeftSquareAndElement), + Syntax(element), + Syntax(unexpectedBetweenElementAndRightSquare), + Syntax(rightSquare), + Syntax(unexpectedAfterRightSquare) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftSquare?.raw, @@ -1705,11 +1705,11 @@ public struct ArrowExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeEffectSpecifiers, - effectSpecifiers, - unexpectedBetweenEffectSpecifiersAndArrow, - arrow, - unexpectedAfterArrow + Syntax(unexpectedBeforeEffectSpecifiers), + Syntax(effectSpecifiers), + Syntax(unexpectedBetweenEffectSpecifiersAndArrow), + Syntax(arrow), + Syntax(unexpectedAfterArrow) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeEffectSpecifiers?.raw, @@ -1848,15 +1848,15 @@ public struct AsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeExpression, - expression, - unexpectedBetweenExpressionAndAsKeyword, - asKeyword, - unexpectedBetweenAsKeywordAndQuestionOrExclamationMark, - questionOrExclamationMark, - unexpectedBetweenQuestionOrExclamationMarkAndType, - type, - unexpectedAfterType + Syntax(unexpectedBeforeExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndAsKeyword), + Syntax(asKeyword), + Syntax(unexpectedBetweenAsKeywordAndQuestionOrExclamationMark), + Syntax(questionOrExclamationMark), + Syntax(unexpectedBetweenQuestionOrExclamationMarkAndType), + Syntax(type), + Syntax(unexpectedAfterType) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeExpression?.raw, @@ -2023,7 +2023,7 @@ public struct AssignmentExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExp ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforeEqual, equal, unexpectedAfterEqual))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeEqual), Syntax(equal), Syntax(unexpectedAfterEqual)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforeEqual?.raw, equal.raw, unexpectedAfterEqual?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.assignmentExpr, @@ -2152,21 +2152,21 @@ public struct AssociatedTypeDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAttributes, - attributes, - unexpectedBetweenAttributesAndModifiers, - modifiers, - unexpectedBetweenModifiersAndAssociatedtypeKeyword, - associatedtypeKeyword, - unexpectedBetweenAssociatedtypeKeywordAndName, - name, - unexpectedBetweenNameAndInheritanceClause, - inheritanceClause, - unexpectedBetweenInheritanceClauseAndInitializer, - initializer, - unexpectedBetweenInitializerAndGenericWhereClause, - genericWhereClause, - unexpectedAfterGenericWhereClause + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndAssociatedtypeKeyword), + Syntax(associatedtypeKeyword), + Syntax(unexpectedBetweenAssociatedtypeKeywordAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndInheritanceClause), + Syntax(inheritanceClause), + Syntax(unexpectedBetweenInheritanceClauseAndInitializer), + Syntax(initializer), + Syntax(unexpectedBetweenInitializerAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedAfterGenericWhereClause) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, @@ -3188,17 +3188,17 @@ public struct AttributeSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodePr // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAtSign, - atSign, - unexpectedBetweenAtSignAndAttributeName, - attributeName, - unexpectedBetweenAttributeNameAndLeftParen, - leftParen, - unexpectedBetweenLeftParenAndArguments, - arguments, - unexpectedBetweenArgumentsAndRightParen, - rightParen, - unexpectedAfterRightParen + Syntax(unexpectedBeforeAtSign), + Syntax(atSign), + Syntax(unexpectedBetweenAtSignAndAttributeName), + Syntax(attributeName), + Syntax(unexpectedBetweenAttributeNameAndLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAtSign?.raw, @@ -3411,13 +3411,13 @@ public struct AttributedTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeSpecifiers, - specifiers, - unexpectedBetweenSpecifiersAndAttributes, - attributes, - unexpectedBetweenAttributesAndBaseType, - baseType, - unexpectedAfterBaseType + Syntax(unexpectedBeforeSpecifiers), + Syntax(specifiers), + Syntax(unexpectedBetweenSpecifiersAndAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndBaseType), + Syntax(baseType), + Syntax(unexpectedAfterBaseType) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeSpecifiers?.raw, @@ -3736,11 +3736,11 @@ public struct AvailabilityArgumentSyntax: SyntaxProtocol, SyntaxHashable, _LeafS // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeArgument, - argument, - unexpectedBetweenArgumentAndTrailingComma, - trailingComma, - unexpectedAfterTrailingComma + Syntax(unexpectedBeforeArgument), + Syntax(argument), + Syntax(unexpectedBetweenArgumentAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeArgument?.raw, @@ -3871,15 +3871,15 @@ public struct AvailabilityConditionSyntax: SyntaxProtocol, SyntaxHashable, _Leaf // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAvailabilityKeyword, - availabilityKeyword, - unexpectedBetweenAvailabilityKeywordAndLeftParen, - leftParen, - unexpectedBetweenLeftParenAndAvailabilityArguments, - availabilityArguments, - unexpectedBetweenAvailabilityArgumentsAndRightParen, - rightParen, - unexpectedAfterRightParen + Syntax(unexpectedBeforeAvailabilityKeyword), + Syntax(availabilityKeyword), + Syntax(unexpectedBetweenAvailabilityKeywordAndLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndAvailabilityArguments), + Syntax(availabilityArguments), + Syntax(unexpectedBetweenAvailabilityArgumentsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAvailabilityKeyword?.raw, @@ -4174,13 +4174,13 @@ public struct AvailabilityLabeledArgumentSyntax: SyntaxProtocol, SyntaxHashable, // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLabel, - label, - unexpectedBetweenLabelAndColon, - colon, - unexpectedBetweenColonAndValue, - value, - unexpectedAfterValue + Syntax(unexpectedBeforeLabel), + Syntax(label), + Syntax(unexpectedBetweenLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndValue), + Syntax(value), + Syntax(unexpectedAfterValue) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLabel?.raw, @@ -4335,11 +4335,11 @@ public struct AwaitExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAwaitKeyword, - awaitKeyword, - unexpectedBetweenAwaitKeywordAndExpression, - expression, - unexpectedAfterExpression + Syntax(unexpectedBeforeAwaitKeyword), + Syntax(awaitKeyword), + Syntax(unexpectedBetweenAwaitKeywordAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAwaitKeyword?.raw, @@ -4469,13 +4469,13 @@ public struct BackDeployedAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashab // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeBeforeLabel, - beforeLabel, - unexpectedBetweenBeforeLabelAndColon, - colon, - unexpectedBetweenColonAndPlatforms, - platforms, - unexpectedAfterPlatforms + Syntax(unexpectedBeforeBeforeLabel), + Syntax(beforeLabel), + Syntax(unexpectedBetweenBeforeLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndPlatforms), + Syntax(platforms), + Syntax(unexpectedAfterPlatforms) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeBeforeLabel?.raw, @@ -4654,7 +4654,7 @@ public struct BinaryOperatorExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforeOperator, `operator`, unexpectedAfterOperator))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeOperator), Syntax(`operator`), Syntax(unexpectedAfterOperator)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforeOperator?.raw, `operator`.raw, unexpectedAfterOperator?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.binaryOperatorExpr, @@ -4731,7 +4731,7 @@ public struct BooleanLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforeLiteral, literal, unexpectedAfterLiteral))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeLiteral), Syntax(literal), Syntax(unexpectedAfterLiteral)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforeLiteral?.raw, literal.raw, unexpectedAfterLiteral?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.booleanLiteralExpr, @@ -4814,11 +4814,11 @@ public struct BorrowExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyn // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeBorrowKeyword, - borrowKeyword, - unexpectedBetweenBorrowKeywordAndExpression, - expression, - unexpectedAfterExpression + Syntax(unexpectedBeforeBorrowKeyword), + Syntax(borrowKeyword), + Syntax(unexpectedBetweenBorrowKeywordAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeBorrowKeyword?.raw, @@ -4936,11 +4936,11 @@ public struct BreakStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeBreakKeyword, - breakKeyword, - unexpectedBetweenBreakKeywordAndLabel, - label, - unexpectedAfterLabel + Syntax(unexpectedBeforeBreakKeyword), + Syntax(breakKeyword), + Syntax(unexpectedBetweenBreakKeywordAndLabel), + Syntax(label), + Syntax(unexpectedAfterLabel) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeBreakKeyword?.raw, diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesC.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesC.swift index 2a17d4d5cfc..f74376046bf 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesC.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesC.swift @@ -53,17 +53,17 @@ public struct _CanImportExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExp // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeCanImportKeyword, - canImportKeyword, - unexpectedBetweenCanImportKeywordAndLeftParen, - leftParen, - unexpectedBetweenLeftParenAndImportPath, - importPath, - unexpectedBetweenImportPathAndVersionInfo, - versionInfo, - unexpectedBetweenVersionInfoAndRightParen, - rightParen, - unexpectedAfterRightParen + Syntax(unexpectedBeforeCanImportKeyword), + Syntax(canImportKeyword), + Syntax(unexpectedBetweenCanImportKeywordAndLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndImportPath), + Syntax(importPath), + Syntax(unexpectedBetweenImportPathAndVersionInfo), + Syntax(versionInfo), + Syntax(unexpectedBetweenVersionInfoAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeCanImportKeyword?.raw, @@ -272,15 +272,15 @@ public struct _CanImportVersionInfoSyntax: ExprSyntaxProtocol, SyntaxHashable, _ // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeComma, - comma, - unexpectedBetweenCommaAndLabel, - label, - unexpectedBetweenLabelAndColon, - colon, - unexpectedBetweenColonAndVersion, - version, - unexpectedAfterVersion + Syntax(unexpectedBeforeComma), + Syntax(comma), + Syntax(unexpectedBetweenCommaAndLabel), + Syntax(label), + Syntax(unexpectedBetweenLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndVersion), + Syntax(version), + Syntax(unexpectedAfterVersion) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeComma?.raw, @@ -461,13 +461,13 @@ public struct CatchClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeCatchKeyword, - catchKeyword, - unexpectedBetweenCatchKeywordAndCatchItems, - catchItems, - unexpectedBetweenCatchItemsAndBody, - body, - unexpectedAfterBody + Syntax(unexpectedBeforeCatchKeyword), + Syntax(catchKeyword), + Syntax(unexpectedBetweenCatchKeywordAndCatchItems), + Syntax(catchItems), + Syntax(unexpectedBetweenCatchItemsAndBody), + Syntax(body), + Syntax(unexpectedAfterBody) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeCatchKeyword?.raw, @@ -643,13 +643,13 @@ public struct CatchItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodePr // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforePattern, - pattern, - unexpectedBetweenPatternAndWhereClause, - whereClause, - unexpectedBetweenWhereClauseAndTrailingComma, - trailingComma, - unexpectedAfterTrailingComma + Syntax(unexpectedBeforePattern), + Syntax(pattern), + Syntax(unexpectedBetweenPatternAndWhereClause), + Syntax(whereClause), + Syntax(unexpectedBetweenWhereClauseAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforePattern?.raw, @@ -841,23 +841,23 @@ public struct ClassDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAttributes, - attributes, - unexpectedBetweenAttributesAndModifiers, - modifiers, - unexpectedBetweenModifiersAndClassKeyword, - classKeyword, - unexpectedBetweenClassKeywordAndName, - name, - unexpectedBetweenNameAndGenericParameterClause, - genericParameterClause, - unexpectedBetweenGenericParameterClauseAndInheritanceClause, - inheritanceClause, - unexpectedBetweenInheritanceClauseAndGenericWhereClause, - genericWhereClause, - unexpectedBetweenGenericWhereClauseAndMemberBlock, - memberBlock, - unexpectedAfterMemberBlock + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndClassKeyword), + Syntax(classKeyword), + Syntax(unexpectedBetweenClassKeywordAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndGenericParameterClause), + Syntax(genericParameterClause), + Syntax(unexpectedBetweenGenericParameterClauseAndInheritanceClause), + Syntax(inheritanceClause), + Syntax(unexpectedBetweenInheritanceClauseAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedBetweenGenericWhereClauseAndMemberBlock), + Syntax(memberBlock), + Syntax(unexpectedAfterMemberBlock) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, @@ -1182,7 +1182,7 @@ public struct ClassRestrictionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _L ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforeClassKeyword, classKeyword, unexpectedAfterClassKeyword))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeClassKeyword), Syntax(classKeyword), Syntax(unexpectedAfterClassKeyword)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforeClassKeyword?.raw, classKeyword.raw, unexpectedAfterClassKeyword?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.classRestrictionType, @@ -1270,13 +1270,13 @@ public struct ClosureCaptureClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafS // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeftSquare, - leftSquare, - unexpectedBetweenLeftSquareAndItems, - items, - unexpectedBetweenItemsAndRightSquare, - rightSquare, - unexpectedAfterRightSquare + Syntax(unexpectedBeforeLeftSquare), + Syntax(leftSquare), + Syntax(unexpectedBetweenLeftSquareAndItems), + Syntax(items), + Syntax(unexpectedBetweenItemsAndRightSquare), + Syntax(rightSquare), + Syntax(unexpectedAfterRightSquare) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftSquare?.raw, @@ -1458,15 +1458,15 @@ public struct ClosureCaptureSpecifierSyntax: SyntaxProtocol, SyntaxHashable, _Le // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeSpecifier, - specifier, - unexpectedBetweenSpecifierAndLeftParen, - leftParen, - unexpectedBetweenLeftParenAndDetail, - detail, - unexpectedBetweenDetailAndRightParen, - rightParen, - unexpectedAfterRightParen + Syntax(unexpectedBeforeSpecifier), + Syntax(specifier), + Syntax(unexpectedBetweenSpecifierAndLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndDetail), + Syntax(detail), + Syntax(unexpectedBetweenDetailAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeSpecifier?.raw, @@ -1658,17 +1658,17 @@ public struct ClosureCaptureSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeSpecifier, - specifier, - unexpectedBetweenSpecifierAndName, - name, - unexpectedBetweenNameAndEqual, - equal, - unexpectedBetweenEqualAndExpression, - expression, - unexpectedBetweenExpressionAndTrailingComma, - trailingComma, - unexpectedAfterTrailingComma + Syntax(unexpectedBeforeSpecifier), + Syntax(specifier), + Syntax(unexpectedBetweenSpecifierAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndEqual), + Syntax(equal), + Syntax(unexpectedBetweenEqualAndExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeSpecifier?.raw, @@ -1878,15 +1878,15 @@ public struct ClosureExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeftBrace, - leftBrace, - unexpectedBetweenLeftBraceAndSignature, - signature, - unexpectedBetweenSignatureAndStatements, - statements, - unexpectedBetweenStatementsAndRightBrace, - rightBrace, - unexpectedAfterRightBrace + Syntax(unexpectedBeforeLeftBrace), + Syntax(leftBrace), + Syntax(unexpectedBetweenLeftBraceAndSignature), + Syntax(signature), + Syntax(unexpectedBetweenSignatureAndStatements), + Syntax(statements), + Syntax(unexpectedBetweenStatementsAndRightBrace), + Syntax(rightBrace), + Syntax(unexpectedAfterRightBrace) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftBrace?.raw, @@ -2092,13 +2092,13 @@ public struct ClosureParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Lea // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeftParen, - leftParen, - unexpectedBetweenLeftParenAndParameters, - parameters, - unexpectedBetweenParametersAndRightParen, - rightParen, - unexpectedAfterRightParen + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndParameters), + Syntax(parameters), + Syntax(unexpectedBetweenParametersAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftParen?.raw, @@ -2303,23 +2303,23 @@ public struct ClosureParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAttributes, - attributes, - unexpectedBetweenAttributesAndModifiers, - modifiers, - unexpectedBetweenModifiersAndFirstName, - firstName, - unexpectedBetweenFirstNameAndSecondName, - secondName, - unexpectedBetweenSecondNameAndColon, - colon, - unexpectedBetweenColonAndType, - type, - unexpectedBetweenTypeAndEllipsis, - ellipsis, - unexpectedBetweenEllipsisAndTrailingComma, - trailingComma, - unexpectedAfterTrailingComma + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndFirstName), + Syntax(firstName), + Syntax(unexpectedBetweenFirstNameAndSecondName), + Syntax(secondName), + Syntax(unexpectedBetweenSecondNameAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndType), + Syntax(type), + Syntax(unexpectedBetweenTypeAndEllipsis), + Syntax(ellipsis), + Syntax(unexpectedBetweenEllipsisAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, @@ -2666,11 +2666,11 @@ public struct ClosureShorthandParameterSyntax: SyntaxProtocol, SyntaxHashable, _ // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeName, - name, - unexpectedBetweenNameAndTrailingComma, - trailingComma, - unexpectedAfterTrailingComma + Syntax(unexpectedBeforeName), + Syntax(name), + Syntax(unexpectedBetweenNameAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeName?.raw, @@ -2891,19 +2891,19 @@ public struct ClosureSignatureSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAttributes, - attributes, - unexpectedBetweenAttributesAndCapture, - capture, - unexpectedBetweenCaptureAndParameterClause, - parameterClause, - unexpectedBetweenParameterClauseAndEffectSpecifiers, - effectSpecifiers, - unexpectedBetweenEffectSpecifiersAndReturnClause, - returnClause, - unexpectedBetweenReturnClauseAndInKeyword, - inKeyword, - unexpectedAfterInKeyword + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndCapture), + Syntax(capture), + Syntax(unexpectedBetweenCaptureAndParameterClause), + Syntax(parameterClause), + Syntax(unexpectedBetweenParameterClauseAndEffectSpecifiers), + Syntax(effectSpecifiers), + Syntax(unexpectedBetweenEffectSpecifiersAndReturnClause), + Syntax(returnClause), + Syntax(unexpectedBetweenReturnClauseAndInKeyword), + Syntax(inKeyword), + Syntax(unexpectedAfterInKeyword) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, @@ -3267,11 +3267,11 @@ public struct CodeBlockItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeItem, - item, - unexpectedBetweenItemAndSemicolon, - semicolon, - unexpectedAfterSemicolon + Syntax(unexpectedBeforeItem), + Syntax(item), + Syntax(unexpectedBetweenItemAndSemicolon), + Syntax(semicolon), + Syntax(unexpectedAfterSemicolon) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeItem?.raw, @@ -3413,13 +3413,13 @@ public struct CodeBlockSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodePr // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeftBrace, - leftBrace, - unexpectedBetweenLeftBraceAndStatements, - statements, - unexpectedBetweenStatementsAndRightBrace, - rightBrace, - unexpectedAfterRightBrace + Syntax(unexpectedBeforeLeftBrace), + Syntax(leftBrace), + Syntax(unexpectedBetweenLeftBraceAndStatements), + Syntax(statements), + Syntax(unexpectedBetweenStatementsAndRightBrace), + Syntax(rightBrace), + Syntax(unexpectedAfterRightBrace) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftBrace?.raw, @@ -3599,11 +3599,11 @@ public struct CompositionTypeElementSyntax: SyntaxProtocol, SyntaxHashable, _Lea // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeType, - type, - unexpectedBetweenTypeAndAmpersand, - ampersand, - unexpectedAfterAmpersand + Syntax(unexpectedBeforeType), + Syntax(type), + Syntax(unexpectedBetweenTypeAndAmpersand), + Syntax(ampersand), + Syntax(unexpectedAfterAmpersand) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeType?.raw, @@ -3714,7 +3714,7 @@ public struct CompositionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTy ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforeElements, elements, unexpectedAfterElements))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeElements), Syntax(elements), Syntax(unexpectedAfterElements)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforeElements?.raw, elements.raw, unexpectedAfterElements?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.compositionType, @@ -3976,11 +3976,11 @@ public struct ConditionElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeCondition, - condition, - unexpectedBetweenConditionAndTrailingComma, - trailingComma, - unexpectedAfterTrailingComma + Syntax(unexpectedBeforeCondition), + Syntax(condition), + Syntax(unexpectedBetweenConditionAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeCondition?.raw, @@ -4105,13 +4105,13 @@ public struct ConformanceRequirementSyntax: SyntaxProtocol, SyntaxHashable, _Lea // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeftType, - leftType, - unexpectedBetweenLeftTypeAndColon, - colon, - unexpectedBetweenColonAndRightType, - rightType, - unexpectedAfterRightType + Syntax(unexpectedBeforeLeftType), + Syntax(leftType), + Syntax(unexpectedBetweenLeftTypeAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndRightType), + Syntax(rightType), + Syntax(unexpectedAfterRightType) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftType?.raw, @@ -4253,11 +4253,11 @@ public struct ConsumeExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeConsumeKeyword, - consumeKeyword, - unexpectedBetweenConsumeKeywordAndExpression, - expression, - unexpectedAfterExpression + Syntax(unexpectedBeforeConsumeKeyword), + Syntax(consumeKeyword), + Syntax(unexpectedBetweenConsumeKeywordAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeConsumeKeyword?.raw, @@ -4377,11 +4377,11 @@ public struct ContinueStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtS // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeContinueKeyword, - continueKeyword, - unexpectedBetweenContinueKeywordAndLabel, - label, - unexpectedAfterLabel + Syntax(unexpectedBeforeContinueKeyword), + Syntax(continueKeyword), + Syntax(unexpectedBetweenContinueKeywordAndLabel), + Syntax(label), + Syntax(unexpectedAfterLabel) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeContinueKeyword?.raw, @@ -4518,17 +4518,17 @@ public struct ConventionAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeConventionLabel, - conventionLabel, - unexpectedBetweenConventionLabelAndComma, - comma, - unexpectedBetweenCommaAndCTypeLabel, - cTypeLabel, - unexpectedBetweenCTypeLabelAndColon, - colon, - unexpectedBetweenColonAndCTypeString, - cTypeString, - unexpectedAfterCTypeString + Syntax(unexpectedBeforeConventionLabel), + Syntax(conventionLabel), + Syntax(unexpectedBetweenConventionLabelAndComma), + Syntax(comma), + Syntax(unexpectedBetweenCommaAndCTypeLabel), + Syntax(cTypeLabel), + Syntax(unexpectedBetweenCTypeLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndCTypeString), + Syntax(cTypeString), + Syntax(unexpectedAfterCTypeString) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeConventionLabel?.raw, @@ -4741,13 +4741,13 @@ public struct ConventionWitnessMethodAttributeArgumentsSyntax: SyntaxProtocol, S // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeWitnessMethodLabel, - witnessMethodLabel, - unexpectedBetweenWitnessMethodLabelAndColon, - colon, - unexpectedBetweenColonAndProtocolName, - protocolName, - unexpectedAfterProtocolName + Syntax(unexpectedBeforeWitnessMethodLabel), + Syntax(witnessMethodLabel), + Syntax(unexpectedBetweenWitnessMethodLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndProtocolName), + Syntax(protocolName), + Syntax(unexpectedAfterProtocolName) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeWitnessMethodLabel?.raw, @@ -4901,11 +4901,11 @@ public struct CopyExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynta // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeCopyKeyword, - copyKeyword, - unexpectedBetweenCopyKeywordAndExpression, - expression, - unexpectedAfterExpression + Syntax(unexpectedBeforeCopyKeyword), + Syntax(copyKeyword), + Syntax(unexpectedBetweenCopyKeywordAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeCopyKeyword?.raw, diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift index 5b4dbff8bc2..bbd7eca81bb 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift @@ -51,13 +51,13 @@ public struct DeclModifierDetailSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeftParen, - leftParen, - unexpectedBetweenLeftParenAndDetail, - detail, - unexpectedBetweenDetailAndRightParen, - rightParen, - unexpectedAfterRightParen + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndDetail), + Syntax(detail), + Syntax(unexpectedBetweenDetailAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftParen?.raw, @@ -210,11 +210,11 @@ public struct DeclModifierSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeName, - name, - unexpectedBetweenNameAndDetail, - detail, - unexpectedAfterDetail + Syntax(unexpectedBeforeName), + Syntax(name), + Syntax(unexpectedBetweenNameAndDetail), + Syntax(detail), + Syntax(unexpectedAfterDetail) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeName?.raw, @@ -372,11 +372,11 @@ public struct DeclNameArgumentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeName, - name, - unexpectedBetweenNameAndColon, - colon, - unexpectedAfterColon + Syntax(unexpectedBeforeName), + Syntax(name), + Syntax(unexpectedBetweenNameAndColon), + Syntax(colon), + Syntax(unexpectedAfterColon) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeName?.raw, @@ -501,13 +501,13 @@ public struct DeclNameArgumentsSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeftParen, - leftParen, - unexpectedBetweenLeftParenAndArguments, - arguments, - unexpectedBetweenArgumentsAndRightParen, - rightParen, - unexpectedAfterRightParen + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftParen?.raw, @@ -687,11 +687,11 @@ public struct DeclReferenceExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeBaseName, - baseName, - unexpectedBetweenBaseNameAndArgumentNames, - argumentNames, - unexpectedAfterArgumentNames + Syntax(unexpectedBeforeBaseName), + Syntax(baseName), + Syntax(unexpectedBetweenBaseNameAndArgumentNames), + Syntax(argumentNames), + Syntax(unexpectedAfterArgumentNames) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeBaseName?.raw, @@ -818,11 +818,11 @@ public struct DeferStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeDeferKeyword, - deferKeyword, - unexpectedBetweenDeferKeywordAndBody, - body, - unexpectedAfterBody + Syntax(unexpectedBeforeDeferKeyword), + Syntax(deferKeyword), + Syntax(unexpectedBetweenDeferKeywordAndBody), + Syntax(body), + Syntax(unexpectedAfterBody) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeDeferKeyword?.raw, @@ -962,17 +962,17 @@ public struct DeinitializerDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Leaf // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAttributes, - attributes, - unexpectedBetweenAttributesAndModifiers, - modifiers, - unexpectedBetweenModifiersAndDeinitKeyword, - deinitKeyword, - unexpectedBetweenDeinitKeywordAndEffectSpecifiers, - effectSpecifiers, - unexpectedBetweenEffectSpecifiersAndBody, - body, - unexpectedAfterBody + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndDeinitKeyword), + Syntax(deinitKeyword), + Syntax(unexpectedBetweenDeinitKeywordAndEffectSpecifiers), + Syntax(effectSpecifiers), + Syntax(unexpectedBetweenEffectSpecifiersAndBody), + Syntax(body), + Syntax(unexpectedAfterBody) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, @@ -1222,7 +1222,7 @@ public struct DeinitializerEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashabl ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforeAsyncSpecifier, asyncSpecifier, unexpectedAfterAsyncSpecifier))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeAsyncSpecifier), Syntax(asyncSpecifier), Syntax(unexpectedAfterAsyncSpecifier)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforeAsyncSpecifier?.raw, asyncSpecifier?.raw, unexpectedAfterAsyncSpecifier?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.deinitializerEffectSpecifiers, @@ -1331,21 +1331,21 @@ public struct DerivativeAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeOfLabel, - ofLabel, - unexpectedBetweenOfLabelAndColon, - colon, - unexpectedBetweenColonAndOriginalDeclName, - originalDeclName, - unexpectedBetweenOriginalDeclNameAndPeriod, - period, - unexpectedBetweenPeriodAndAccessorSpecifier, - accessorSpecifier, - unexpectedBetweenAccessorSpecifierAndComma, - comma, - unexpectedBetweenCommaAndArguments, - arguments, - unexpectedAfterArguments + Syntax(unexpectedBeforeOfLabel), + Syntax(ofLabel), + Syntax(unexpectedBetweenOfLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndOriginalDeclName), + Syntax(originalDeclName), + Syntax(unexpectedBetweenOriginalDeclNameAndPeriod), + Syntax(period), + Syntax(unexpectedBetweenPeriodAndAccessorSpecifier), + Syntax(accessorSpecifier), + Syntax(unexpectedBetweenAccessorSpecifierAndComma), + Syntax(comma), + Syntax(unexpectedBetweenCommaAndArguments), + Syntax(arguments), + Syntax(unexpectedAfterArguments) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeOfLabel?.raw, @@ -1610,11 +1610,11 @@ public struct DesignatedTypeSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeadingComma, - leadingComma, - unexpectedBetweenLeadingCommaAndName, - name, - unexpectedAfterName + Syntax(unexpectedBeforeLeadingComma), + Syntax(leadingComma), + Syntax(unexpectedBetweenLeadingCommaAndName), + Syntax(name), + Syntax(unexpectedAfterName) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeadingComma?.raw, @@ -1744,15 +1744,15 @@ public struct DictionaryElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeKey, - key, - unexpectedBetweenKeyAndColon, - colon, - unexpectedBetweenColonAndValue, - value, - unexpectedBetweenValueAndTrailingComma, - trailingComma, - unexpectedAfterTrailingComma + Syntax(unexpectedBeforeKey), + Syntax(key), + Syntax(unexpectedBetweenKeyAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndValue), + Syntax(value), + Syntax(unexpectedBetweenValueAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeKey?.raw, @@ -2008,13 +2008,13 @@ public struct DictionaryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExp // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeftSquare, - leftSquare, - unexpectedBetweenLeftSquareAndContent, - content, - unexpectedBetweenContentAndRightSquare, - rightSquare, - unexpectedAfterRightSquare + Syntax(unexpectedBeforeLeftSquare), + Syntax(leftSquare), + Syntax(unexpectedBetweenLeftSquareAndContent), + Syntax(content), + Syntax(unexpectedBetweenContentAndRightSquare), + Syntax(rightSquare), + Syntax(unexpectedAfterRightSquare) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftSquare?.raw, @@ -2168,17 +2168,17 @@ public struct DictionaryTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeftSquare, - leftSquare, - unexpectedBetweenLeftSquareAndKey, - key, - unexpectedBetweenKeyAndColon, - colon, - unexpectedBetweenColonAndValue, - value, - unexpectedBetweenValueAndRightSquare, - rightSquare, - unexpectedAfterRightSquare + Syntax(unexpectedBeforeLeftSquare), + Syntax(leftSquare), + Syntax(unexpectedBetweenLeftSquareAndKey), + Syntax(key), + Syntax(unexpectedBetweenKeyAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndValue), + Syntax(value), + Syntax(unexpectedBetweenValueAndRightSquare), + Syntax(rightSquare), + Syntax(unexpectedAfterRightSquare) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftSquare?.raw, @@ -2381,11 +2381,11 @@ public struct DifferentiabilityArgumentSyntax: SyntaxProtocol, SyntaxHashable, _ // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeArgument, - argument, - unexpectedBetweenArgumentAndTrailingComma, - trailingComma, - unexpectedAfterTrailingComma + Syntax(unexpectedBeforeArgument), + Syntax(argument), + Syntax(unexpectedBetweenArgumentAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeArgument?.raw, @@ -2519,13 +2519,13 @@ public struct DifferentiabilityArgumentsSyntax: SyntaxProtocol, SyntaxHashable, // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeftParen, - leftParen, - unexpectedBetweenLeftParenAndArguments, - arguments, - unexpectedBetweenArgumentsAndRightParen, - rightParen, - unexpectedAfterRightParen + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftParen?.raw, @@ -2792,13 +2792,13 @@ public struct DifferentiabilityWithRespectToArgumentSyntax: SyntaxProtocol, Synt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeWrtLabel, - wrtLabel, - unexpectedBetweenWrtLabelAndColon, - colon, - unexpectedBetweenColonAndArguments, - arguments, - unexpectedAfterArguments + Syntax(unexpectedBeforeWrtLabel), + Syntax(wrtLabel), + Syntax(unexpectedBetweenWrtLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndArguments), + Syntax(arguments), + Syntax(unexpectedAfterArguments) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeWrtLabel?.raw, @@ -2967,17 +2967,17 @@ public struct DifferentiableAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHash // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeKindSpecifier, - kindSpecifier, - unexpectedBetweenKindSpecifierAndKindSpecifierComma, - kindSpecifierComma, - unexpectedBetweenKindSpecifierCommaAndArguments, - arguments, - unexpectedBetweenArgumentsAndArgumentsComma, - argumentsComma, - unexpectedBetweenArgumentsCommaAndGenericWhereClause, - genericWhereClause, - unexpectedAfterGenericWhereClause + Syntax(unexpectedBeforeKindSpecifier), + Syntax(kindSpecifier), + Syntax(unexpectedBetweenKindSpecifierAndKindSpecifierComma), + Syntax(kindSpecifierComma), + Syntax(unexpectedBetweenKindSpecifierCommaAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndArgumentsComma), + Syntax(argumentsComma), + Syntax(unexpectedBetweenArgumentsCommaAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedAfterGenericWhereClause) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeKindSpecifier?.raw, @@ -3193,7 +3193,7 @@ public struct DiscardAssignmentExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _ ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforeWildcard, wildcard, unexpectedAfterWildcard))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeWildcard), Syntax(wildcard), Syntax(unexpectedAfterWildcard)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforeWildcard?.raw, wildcard.raw, unexpectedAfterWildcard?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.discardAssignmentExpr, @@ -3274,11 +3274,11 @@ public struct DiscardStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSy // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeDiscardKeyword, - discardKeyword, - unexpectedBetweenDiscardKeywordAndExpression, - expression, - unexpectedAfterExpression + Syntax(unexpectedBeforeDiscardKeyword), + Syntax(discardKeyword), + Syntax(unexpectedBetweenDiscardKeywordAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeDiscardKeyword?.raw, @@ -3426,13 +3426,13 @@ public struct DoExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeDoKeyword, - doKeyword, - unexpectedBetweenDoKeywordAndBody, - body, - unexpectedBetweenBodyAndCatchClauses, - catchClauses, - unexpectedAfterCatchClauses + Syntax(unexpectedBeforeDoKeyword), + Syntax(doKeyword), + Syntax(unexpectedBetweenDoKeywordAndBody), + Syntax(body), + Syntax(unexpectedBetweenBodyAndCatchClauses), + Syntax(catchClauses), + Syntax(unexpectedAfterCatchClauses) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeDoKeyword?.raw, @@ -3608,15 +3608,15 @@ public struct DoStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntaxN // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeDoKeyword, - doKeyword, - unexpectedBetweenDoKeywordAndThrowsClause, - throwsClause, - unexpectedBetweenThrowsClauseAndBody, - body, - unexpectedBetweenBodyAndCatchClauses, - catchClauses, - unexpectedAfterCatchClauses + Syntax(unexpectedBeforeDoKeyword), + Syntax(doKeyword), + Syntax(unexpectedBetweenDoKeywordAndThrowsClause), + Syntax(throwsClause), + Syntax(unexpectedBetweenThrowsClauseAndBody), + Syntax(body), + Syntax(unexpectedBetweenBodyAndCatchClauses), + Syntax(catchClauses), + Syntax(unexpectedAfterCatchClauses) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeDoKeyword?.raw, @@ -3903,15 +3903,15 @@ public struct DocumentationAttributeArgumentSyntax: SyntaxProtocol, SyntaxHashab // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLabel, - label, - unexpectedBetweenLabelAndColon, - colon, - unexpectedBetweenColonAndValue, - value, - unexpectedBetweenValueAndTrailingComma, - trailingComma, - unexpectedAfterTrailingComma + Syntax(unexpectedBeforeLabel), + Syntax(label), + Syntax(unexpectedBetweenLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndValue), + Syntax(value), + Syntax(unexpectedBetweenValueAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLabel?.raw, @@ -4096,13 +4096,13 @@ public struct DynamicReplacementAttributeArgumentsSyntax: SyntaxProtocol, Syntax // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeForLabel, - forLabel, - unexpectedBetweenForLabelAndColon, - colon, - unexpectedBetweenColonAndDeclName, - declName, - unexpectedAfterDeclName + Syntax(unexpectedBeforeForLabel), + Syntax(forLabel), + Syntax(unexpectedBetweenForLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndDeclName), + Syntax(declName), + Syntax(unexpectedAfterDeclName) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeForLabel?.raw, diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesEF.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesEF.swift index e20aed85c35..c1e47c8aa2a 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesEF.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesEF.swift @@ -54,13 +54,13 @@ public struct EditorPlaceholderDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _ // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAttributes, - attributes, - unexpectedBetweenAttributesAndModifiers, - modifiers, - unexpectedBetweenModifiersAndPlaceholder, - placeholder, - unexpectedAfterPlaceholder + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndPlaceholder), + Syntax(placeholder), + Syntax(unexpectedAfterPlaceholder) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, @@ -258,7 +258,7 @@ public struct EditorPlaceholderExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _ ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforePlaceholder, placeholder, unexpectedAfterPlaceholder))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforePlaceholder?.raw, placeholder.raw, unexpectedAfterPlaceholder?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.editorPlaceholderExpr, @@ -351,15 +351,15 @@ public struct EnumCaseDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAttributes, - attributes, - unexpectedBetweenAttributesAndModifiers, - modifiers, - unexpectedBetweenModifiersAndCaseKeyword, - caseKeyword, - unexpectedBetweenCaseKeywordAndElements, - elements, - unexpectedAfterElements + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndCaseKeyword), + Syntax(caseKeyword), + Syntax(unexpectedBetweenCaseKeywordAndElements), + Syntax(elements), + Syntax(unexpectedAfterElements) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, @@ -627,15 +627,15 @@ public struct EnumCaseElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeName, - name, - unexpectedBetweenNameAndParameterClause, - parameterClause, - unexpectedBetweenParameterClauseAndRawValue, - rawValue, - unexpectedBetweenRawValueAndTrailingComma, - trailingComma, - unexpectedAfterTrailingComma + Syntax(unexpectedBeforeName), + Syntax(name), + Syntax(unexpectedBetweenNameAndParameterClause), + Syntax(parameterClause), + Syntax(unexpectedBetweenParameterClauseAndRawValue), + Syntax(rawValue), + Syntax(unexpectedBetweenRawValueAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeName?.raw, @@ -820,13 +820,13 @@ public struct EnumCaseParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Le // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeftParen, - leftParen, - unexpectedBetweenLeftParenAndParameters, - parameters, - unexpectedBetweenParametersAndRightParen, - rightParen, - unexpectedAfterRightParen + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndParameters), + Syntax(parameters), + Syntax(unexpectedBetweenParametersAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftParen?.raw, @@ -1026,21 +1026,21 @@ public struct EnumCaseParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeModifiers, - modifiers, - unexpectedBetweenModifiersAndFirstName, - firstName, - unexpectedBetweenFirstNameAndSecondName, - secondName, - unexpectedBetweenSecondNameAndColon, - colon, - unexpectedBetweenColonAndType, - type, - unexpectedBetweenTypeAndDefaultValue, - defaultValue, - unexpectedBetweenDefaultValueAndTrailingComma, - trailingComma, - unexpectedAfterTrailingComma + Syntax(unexpectedBeforeModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndFirstName), + Syntax(firstName), + Syntax(unexpectedBetweenFirstNameAndSecondName), + Syntax(secondName), + Syntax(unexpectedBetweenSecondNameAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndType), + Syntax(type), + Syntax(unexpectedBetweenTypeAndDefaultValue), + Syntax(defaultValue), + Syntax(unexpectedBetweenDefaultValueAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeModifiers?.raw, @@ -1352,23 +1352,23 @@ public struct EnumDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynta // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAttributes, - attributes, - unexpectedBetweenAttributesAndModifiers, - modifiers, - unexpectedBetweenModifiersAndEnumKeyword, - enumKeyword, - unexpectedBetweenEnumKeywordAndName, - name, - unexpectedBetweenNameAndGenericParameterClause, - genericParameterClause, - unexpectedBetweenGenericParameterClauseAndInheritanceClause, - inheritanceClause, - unexpectedBetweenInheritanceClauseAndGenericWhereClause, - genericWhereClause, - unexpectedBetweenGenericWhereClauseAndMemberBlock, - memberBlock, - unexpectedAfterMemberBlock + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndEnumKeyword), + Syntax(enumKeyword), + Syntax(unexpectedBetweenEnumKeywordAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndGenericParameterClause), + Syntax(genericParameterClause), + Syntax(unexpectedBetweenGenericParameterClauseAndInheritanceClause), + Syntax(inheritanceClause), + Syntax(unexpectedBetweenInheritanceClauseAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedBetweenGenericWhereClauseAndMemberBlock), + Syntax(memberBlock), + Syntax(unexpectedAfterMemberBlock) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, @@ -1706,13 +1706,13 @@ public struct ExposeAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable, _L // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLanguage, - language, - unexpectedBetweenLanguageAndComma, - comma, - unexpectedBetweenCommaAndCxxName, - cxxName, - unexpectedAfterCxxName + Syntax(unexpectedBeforeLanguage), + Syntax(language), + Syntax(unexpectedBetweenLanguageAndComma), + Syntax(comma), + Syntax(unexpectedBetweenCommaAndCxxName), + Syntax(cxxName), + Syntax(unexpectedAfterCxxName) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLanguage?.raw, @@ -1864,7 +1864,7 @@ public struct ExpressionPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _L ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforeExpression, expression, unexpectedAfterExpression))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeExpression), Syntax(expression), Syntax(unexpectedAfterExpression)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforeExpression?.raw, expression.raw, unexpectedAfterExpression?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.expressionPattern, @@ -1959,17 +1959,17 @@ public struct ExpressionSegmentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeBackslash, - backslash, - unexpectedBetweenBackslashAndPounds, - pounds, - unexpectedBetweenPoundsAndLeftParen, - leftParen, - unexpectedBetweenLeftParenAndExpressions, - expressions, - unexpectedBetweenExpressionsAndRightParen, - rightParen, - unexpectedAfterRightParen + Syntax(unexpectedBeforeBackslash), + Syntax(backslash), + Syntax(unexpectedBetweenBackslashAndPounds), + Syntax(pounds), + Syntax(unexpectedBetweenPoundsAndLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndExpressions), + Syntax(expressions), + Syntax(unexpectedBetweenExpressionsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeBackslash?.raw, @@ -2191,7 +2191,7 @@ public struct ExpressionStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStm ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforeExpression, expression, unexpectedAfterExpression))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeExpression), Syntax(expression), Syntax(unexpectedAfterExpression)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforeExpression?.raw, expression.raw, unexpectedAfterExpression?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.expressionStmt, @@ -2303,21 +2303,21 @@ public struct ExtensionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAttributes, - attributes, - unexpectedBetweenAttributesAndModifiers, - modifiers, - unexpectedBetweenModifiersAndExtensionKeyword, - extensionKeyword, - unexpectedBetweenExtensionKeywordAndExtendedType, - extendedType, - unexpectedBetweenExtendedTypeAndInheritanceClause, - inheritanceClause, - unexpectedBetweenInheritanceClauseAndGenericWhereClause, - genericWhereClause, - unexpectedBetweenGenericWhereClauseAndMemberBlock, - memberBlock, - unexpectedAfterMemberBlock + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndExtensionKeyword), + Syntax(extensionKeyword), + Syntax(unexpectedBetweenExtensionKeywordAndExtendedType), + Syntax(extendedType), + Syntax(unexpectedBetweenExtendedTypeAndInheritanceClause), + Syntax(inheritanceClause), + Syntax(unexpectedBetweenInheritanceClauseAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedBetweenGenericWhereClauseAndMemberBlock), + Syntax(memberBlock), + Syntax(unexpectedAfterMemberBlock) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, @@ -2621,7 +2621,7 @@ public struct FallThroughStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafSt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforeFallthroughKeyword, fallthroughKeyword, unexpectedAfterFallthroughKeyword))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeFallthroughKeyword), Syntax(fallthroughKeyword), Syntax(unexpectedAfterFallthroughKeyword)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforeFallthroughKeyword?.raw, fallthroughKeyword.raw, unexpectedAfterFallthroughKeyword?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.fallThroughStmt, @@ -2698,7 +2698,7 @@ public struct FloatLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforeLiteral, literal, unexpectedAfterLiteral))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeLiteral), Syntax(literal), Syntax(unexpectedAfterLiteral)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforeLiteral?.raw, literal.raw, unexpectedAfterLiteral?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.floatLiteralExpr, @@ -2803,27 +2803,27 @@ public struct ForStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntax // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeForKeyword, - forKeyword, - unexpectedBetweenForKeywordAndTryKeyword, - tryKeyword, - unexpectedBetweenTryKeywordAndAwaitKeyword, - awaitKeyword, - unexpectedBetweenAwaitKeywordAndCaseKeyword, - caseKeyword, - unexpectedBetweenCaseKeywordAndPattern, - pattern, - unexpectedBetweenPatternAndTypeAnnotation, - typeAnnotation, - unexpectedBetweenTypeAnnotationAndInKeyword, - inKeyword, - unexpectedBetweenInKeywordAndSequence, - sequence, - unexpectedBetweenSequenceAndWhereClause, - whereClause, - unexpectedBetweenWhereClauseAndBody, - body, - unexpectedAfterBody + Syntax(unexpectedBeforeForKeyword), + Syntax(forKeyword), + Syntax(unexpectedBetweenForKeywordAndTryKeyword), + Syntax(tryKeyword), + Syntax(unexpectedBetweenTryKeywordAndAwaitKeyword), + Syntax(awaitKeyword), + Syntax(unexpectedBetweenAwaitKeywordAndCaseKeyword), + Syntax(caseKeyword), + Syntax(unexpectedBetweenCaseKeywordAndPattern), + Syntax(pattern), + Syntax(unexpectedBetweenPatternAndTypeAnnotation), + Syntax(typeAnnotation), + Syntax(unexpectedBetweenTypeAnnotationAndInKeyword), + Syntax(inKeyword), + Syntax(unexpectedBetweenInKeywordAndSequence), + Syntax(sequence), + Syntax(unexpectedBetweenSequenceAndWhereClause), + Syntax(whereClause), + Syntax(unexpectedBetweenWhereClauseAndBody), + Syntax(body), + Syntax(unexpectedAfterBody) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeForKeyword?.raw, @@ -3145,11 +3145,11 @@ public struct ForceUnwrapExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafEx // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeExpression, - expression, - unexpectedBetweenExpressionAndExclamationMark, - exclamationMark, - unexpectedAfterExclamationMark + Syntax(unexpectedBeforeExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndExclamationMark), + Syntax(exclamationMark), + Syntax(unexpectedAfterExclamationMark) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeExpression?.raw, @@ -3279,19 +3279,19 @@ public struct FunctionCallExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeCalledExpression, - calledExpression, - unexpectedBetweenCalledExpressionAndLeftParen, - leftParen, - unexpectedBetweenLeftParenAndArguments, - arguments, - unexpectedBetweenArgumentsAndRightParen, - rightParen, - unexpectedBetweenRightParenAndTrailingClosure, - trailingClosure, - unexpectedBetweenTrailingClosureAndAdditionalTrailingClosures, - additionalTrailingClosures, - unexpectedAfterAdditionalTrailingClosures + Syntax(unexpectedBeforeCalledExpression), + Syntax(calledExpression), + Syntax(unexpectedBetweenCalledExpressionAndLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedBetweenRightParenAndTrailingClosure), + Syntax(trailingClosure), + Syntax(unexpectedBetweenTrailingClosureAndAdditionalTrailingClosures), + Syntax(additionalTrailingClosures), + Syntax(unexpectedAfterAdditionalTrailingClosures) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeCalledExpression?.raw, @@ -3608,23 +3608,23 @@ public struct FunctionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAttributes, - attributes, - unexpectedBetweenAttributesAndModifiers, - modifiers, - unexpectedBetweenModifiersAndFuncKeyword, - funcKeyword, - unexpectedBetweenFuncKeywordAndName, - name, - unexpectedBetweenNameAndGenericParameterClause, - genericParameterClause, - unexpectedBetweenGenericParameterClauseAndSignature, - signature, - unexpectedBetweenSignatureAndGenericWhereClause, - genericWhereClause, - unexpectedBetweenGenericWhereClauseAndBody, - body, - unexpectedAfterBody + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndFuncKeyword), + Syntax(funcKeyword), + Syntax(unexpectedBetweenFuncKeywordAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndGenericParameterClause), + Syntax(genericParameterClause), + Syntax(unexpectedBetweenGenericParameterClauseAndSignature), + Syntax(signature), + Syntax(unexpectedBetweenSignatureAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedBetweenGenericWhereClauseAndBody), + Syntax(body), + Syntax(unexpectedAfterBody) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, @@ -3963,11 +3963,11 @@ public struct FunctionEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashable, _L // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAsyncSpecifier, - asyncSpecifier, - unexpectedBetweenAsyncSpecifierAndThrowsClause, - throwsClause, - unexpectedAfterThrowsClause + Syntax(unexpectedBeforeAsyncSpecifier), + Syntax(asyncSpecifier), + Syntax(unexpectedBetweenAsyncSpecifierAndThrowsClause), + Syntax(throwsClause), + Syntax(unexpectedAfterThrowsClause) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAsyncSpecifier?.raw, @@ -4098,13 +4098,13 @@ public struct FunctionParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Le // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeftParen, - leftParen, - unexpectedBetweenLeftParenAndParameters, - parameters, - unexpectedBetweenParametersAndRightParen, - rightParen, - unexpectedAfterRightParen + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndParameters), + Syntax(parameters), + Syntax(unexpectedBetweenParametersAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftParen?.raw, @@ -4312,25 +4312,25 @@ public struct FunctionParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAttributes, - attributes, - unexpectedBetweenAttributesAndModifiers, - modifiers, - unexpectedBetweenModifiersAndFirstName, - firstName, - unexpectedBetweenFirstNameAndSecondName, - secondName, - unexpectedBetweenSecondNameAndColon, - colon, - unexpectedBetweenColonAndType, - type, - unexpectedBetweenTypeAndEllipsis, - ellipsis, - unexpectedBetweenEllipsisAndDefaultValue, - defaultValue, - unexpectedBetweenDefaultValueAndTrailingComma, - trailingComma, - unexpectedAfterTrailingComma + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndFirstName), + Syntax(firstName), + Syntax(unexpectedBetweenFirstNameAndSecondName), + Syntax(secondName), + Syntax(unexpectedBetweenSecondNameAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndType), + Syntax(type), + Syntax(unexpectedBetweenTypeAndEllipsis), + Syntax(ellipsis), + Syntax(unexpectedBetweenEllipsisAndDefaultValue), + Syntax(defaultValue), + Syntax(unexpectedBetweenDefaultValueAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, @@ -4714,13 +4714,13 @@ public struct FunctionSignatureSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeParameterClause, - parameterClause, - unexpectedBetweenParameterClauseAndEffectSpecifiers, - effectSpecifiers, - unexpectedBetweenEffectSpecifiersAndReturnClause, - returnClause, - unexpectedAfterReturnClause + Syntax(unexpectedBeforeParameterClause), + Syntax(parameterClause), + Syntax(unexpectedBetweenParameterClauseAndEffectSpecifiers), + Syntax(effectSpecifiers), + Syntax(unexpectedBetweenEffectSpecifiersAndReturnClause), + Syntax(returnClause), + Syntax(unexpectedAfterReturnClause) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeParameterClause?.raw, @@ -4871,17 +4871,17 @@ public struct FunctionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeS // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeftParen, - leftParen, - unexpectedBetweenLeftParenAndParameters, - parameters, - unexpectedBetweenParametersAndRightParen, - rightParen, - unexpectedBetweenRightParenAndEffectSpecifiers, - effectSpecifiers, - unexpectedBetweenEffectSpecifiersAndReturnClause, - returnClause, - unexpectedAfterReturnClause + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndParameters), + Syntax(parameters), + Syntax(unexpectedBetweenParametersAndRightParen), + Syntax(rightParen), + Syntax(unexpectedBetweenRightParenAndEffectSpecifiers), + Syntax(effectSpecifiers), + Syntax(unexpectedBetweenEffectSpecifiersAndReturnClause), + Syntax(returnClause), + Syntax(unexpectedAfterReturnClause) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftParen?.raw, diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesGHI.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesGHI.swift index 22b0b38e38c..dc5a8d24fe1 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesGHI.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesGHI.swift @@ -56,13 +56,13 @@ public struct GenericArgumentClauseSyntax: SyntaxProtocol, SyntaxHashable, _Leaf // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeftAngle, - leftAngle, - unexpectedBetweenLeftAngleAndArguments, - arguments, - unexpectedBetweenArgumentsAndRightAngle, - rightAngle, - unexpectedAfterRightAngle + Syntax(unexpectedBeforeLeftAngle), + Syntax(leftAngle), + Syntax(unexpectedBetweenLeftAngleAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndRightAngle), + Syntax(rightAngle), + Syntax(unexpectedAfterRightAngle) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftAngle?.raw, @@ -238,11 +238,11 @@ public struct GenericArgumentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeArgument, - argument, - unexpectedBetweenArgumentAndTrailingComma, - trailingComma, - unexpectedAfterTrailingComma + Syntax(unexpectedBeforeArgument), + Syntax(argument), + Syntax(unexpectedBetweenArgumentAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeArgument?.raw, @@ -385,15 +385,15 @@ public struct GenericParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Lea // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeftAngle, - leftAngle, - unexpectedBetweenLeftAngleAndParameters, - parameters, - unexpectedBetweenParametersAndGenericWhereClause, - genericWhereClause, - unexpectedBetweenGenericWhereClauseAndRightAngle, - rightAngle, - unexpectedAfterRightAngle + Syntax(unexpectedBeforeLeftAngle), + Syntax(leftAngle), + Syntax(unexpectedBetweenLeftAngleAndParameters), + Syntax(parameters), + Syntax(unexpectedBetweenParametersAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedBetweenGenericWhereClauseAndRightAngle), + Syntax(rightAngle), + Syntax(unexpectedAfterRightAngle) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftAngle?.raw, @@ -611,19 +611,19 @@ public struct GenericParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAttributes, - attributes, - unexpectedBetweenAttributesAndEachKeyword, - eachKeyword, - unexpectedBetweenEachKeywordAndName, - name, - unexpectedBetweenNameAndColon, - colon, - unexpectedBetweenColonAndInheritedType, - inheritedType, - unexpectedBetweenInheritedTypeAndTrailingComma, - trailingComma, - unexpectedAfterTrailingComma + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndEachKeyword), + Syntax(eachKeyword), + Syntax(unexpectedBetweenEachKeywordAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndInheritedType), + Syntax(inheritedType), + Syntax(unexpectedBetweenInheritedTypeAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, @@ -992,11 +992,11 @@ public struct GenericRequirementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeRequirement, - requirement, - unexpectedBetweenRequirementAndTrailingComma, - trailingComma, - unexpectedAfterTrailingComma + Syntax(unexpectedBeforeRequirement), + Syntax(requirement), + Syntax(unexpectedBetweenRequirementAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeRequirement?.raw, @@ -1114,11 +1114,11 @@ public struct GenericSpecializationExprSyntax: ExprSyntaxProtocol, SyntaxHashabl // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeExpression, - expression, - unexpectedBetweenExpressionAndGenericArgumentClause, - genericArgumentClause, - unexpectedAfterGenericArgumentClause + Syntax(unexpectedBeforeExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndGenericArgumentClause), + Syntax(genericArgumentClause), + Syntax(unexpectedAfterGenericArgumentClause) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeExpression?.raw, @@ -1255,11 +1255,11 @@ public struct GenericWhereClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeWhereKeyword, - whereKeyword, - unexpectedBetweenWhereKeywordAndRequirements, - requirements, - unexpectedAfterRequirements + Syntax(unexpectedBeforeWhereKeyword), + Syntax(whereKeyword), + Syntax(unexpectedBetweenWhereKeywordAndRequirements), + Syntax(requirements), + Syntax(unexpectedAfterRequirements) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeWhereKeyword?.raw, @@ -1413,15 +1413,15 @@ public struct GuardStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeGuardKeyword, - guardKeyword, - unexpectedBetweenGuardKeywordAndConditions, - conditions, - unexpectedBetweenConditionsAndElseKeyword, - elseKeyword, - unexpectedBetweenElseKeywordAndBody, - body, - unexpectedAfterBody + Syntax(unexpectedBeforeGuardKeyword), + Syntax(guardKeyword), + Syntax(unexpectedBetweenGuardKeywordAndConditions), + Syntax(conditions), + Syntax(unexpectedBetweenConditionsAndElseKeyword), + Syntax(elseKeyword), + Syntax(unexpectedBetweenElseKeywordAndBody), + Syntax(body), + Syntax(unexpectedAfterBody) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeGuardKeyword?.raw, @@ -1624,7 +1624,7 @@ public struct IdentifierPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _L ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforeIdentifier, identifier, unexpectedAfterIdentifier))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeIdentifier), Syntax(identifier), Syntax(unexpectedAfterIdentifier)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforeIdentifier?.raw, identifier.raw, unexpectedAfterIdentifier?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.identifierPattern, @@ -1710,11 +1710,11 @@ public struct IdentifierTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeName, - name, - unexpectedBetweenNameAndGenericArgumentClause, - genericArgumentClause, - unexpectedAfterGenericArgumentClause + Syntax(unexpectedBeforeName), + Syntax(name), + Syntax(unexpectedBetweenNameAndGenericArgumentClause), + Syntax(genericArgumentClause), + Syntax(unexpectedAfterGenericArgumentClause) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeName?.raw, @@ -2030,13 +2030,13 @@ public struct IfConfigClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforePoundKeyword, - poundKeyword, - unexpectedBetweenPoundKeywordAndCondition, - condition, - unexpectedBetweenConditionAndElements, - elements, - unexpectedAfterElements + Syntax(unexpectedBeforePoundKeyword), + Syntax(poundKeyword), + Syntax(unexpectedBetweenPoundKeywordAndCondition), + Syntax(condition), + Syntax(unexpectedBetweenConditionAndElements), + Syntax(elements), + Syntax(unexpectedAfterElements) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforePoundKeyword?.raw, @@ -2187,11 +2187,11 @@ public struct IfConfigDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeClauses, - clauses, - unexpectedBetweenClausesAndPoundEndif, - poundEndif, - unexpectedAfterPoundEndif + Syntax(unexpectedBeforeClauses), + Syntax(clauses), + Syntax(unexpectedBetweenClausesAndPoundEndif), + Syntax(poundEndif), + Syntax(unexpectedAfterPoundEndif) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeClauses?.raw, @@ -2431,17 +2431,17 @@ public struct IfExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeIfKeyword, - ifKeyword, - unexpectedBetweenIfKeywordAndConditions, - conditions, - unexpectedBetweenConditionsAndBody, - body, - unexpectedBetweenBodyAndElseKeyword, - elseKeyword, - unexpectedBetweenElseKeywordAndElseBody, - elseBody, - unexpectedAfterElseBody + Syntax(unexpectedBeforeIfKeyword), + Syntax(ifKeyword), + Syntax(unexpectedBetweenIfKeywordAndConditions), + Syntax(conditions), + Syntax(unexpectedBetweenConditionsAndBody), + Syntax(body), + Syntax(unexpectedBetweenBodyAndElseKeyword), + Syntax(elseKeyword), + Syntax(unexpectedBetweenElseKeywordAndElseBody), + Syntax(elseBody), + Syntax(unexpectedAfterElseBody) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeIfKeyword?.raw, @@ -2673,13 +2673,13 @@ public struct ImplementsAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeType, - type, - unexpectedBetweenTypeAndComma, - comma, - unexpectedBetweenCommaAndDeclName, - declName, - unexpectedAfterDeclName + Syntax(unexpectedBeforeType), + Syntax(type), + Syntax(unexpectedBetweenTypeAndComma), + Syntax(comma), + Syntax(unexpectedBetweenCommaAndDeclName), + Syntax(declName), + Syntax(unexpectedAfterDeclName) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeType?.raw, @@ -2825,11 +2825,11 @@ public struct ImplicitlyUnwrappedOptionalTypeSyntax: TypeSyntaxProtocol, SyntaxH // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeWrappedType, - wrappedType, - unexpectedBetweenWrappedTypeAndExclamationMark, - exclamationMark, - unexpectedAfterExclamationMark + Syntax(unexpectedBeforeWrappedType), + Syntax(wrappedType), + Syntax(unexpectedBetweenWrappedTypeAndExclamationMark), + Syntax(exclamationMark), + Syntax(unexpectedAfterExclamationMark) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeWrappedType?.raw, @@ -2969,17 +2969,17 @@ public struct ImportDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyn // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAttributes, - attributes, - unexpectedBetweenAttributesAndModifiers, - modifiers, - unexpectedBetweenModifiersAndImportKeyword, - importKeyword, - unexpectedBetweenImportKeywordAndImportKindSpecifier, - importKindSpecifier, - unexpectedBetweenImportKindSpecifierAndPath, - path, - unexpectedAfterPath + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndImportKeyword), + Syntax(importKeyword), + Syntax(unexpectedBetweenImportKeywordAndImportKindSpecifier), + Syntax(importKindSpecifier), + Syntax(unexpectedBetweenImportKindSpecifierAndPath), + Syntax(path), + Syntax(unexpectedAfterPath) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, @@ -3275,11 +3275,11 @@ public struct ImportPathComponentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeName, - name, - unexpectedBetweenNameAndTrailingPeriod, - trailingPeriod, - unexpectedAfterTrailingPeriod + Syntax(unexpectedBeforeName), + Syntax(name), + Syntax(unexpectedBetweenNameAndTrailingPeriod), + Syntax(trailingPeriod), + Syntax(unexpectedAfterTrailingPeriod) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeName?.raw, @@ -3406,11 +3406,11 @@ public struct InOutExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAmpersand, - ampersand, - unexpectedBetweenAmpersandAndExpression, - expression, - unexpectedAfterExpression + Syntax(unexpectedBeforeAmpersand), + Syntax(ampersand), + Syntax(unexpectedBetweenAmpersandAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAmpersand?.raw, @@ -3537,13 +3537,13 @@ public struct InfixOperatorExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeftOperand, - leftOperand, - unexpectedBetweenLeftOperandAndOperator, - `operator`, - unexpectedBetweenOperatorAndRightOperand, - rightOperand, - unexpectedAfterRightOperand + Syntax(unexpectedBeforeLeftOperand), + Syntax(leftOperand), + Syntax(unexpectedBetweenLeftOperandAndOperator), + Syntax(`operator`), + Syntax(unexpectedBetweenOperatorAndRightOperand), + Syntax(rightOperand), + Syntax(unexpectedAfterRightOperand) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftOperand?.raw, @@ -3692,11 +3692,11 @@ public struct InheritanceClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeColon, - colon, - unexpectedBetweenColonAndInheritedTypes, - inheritedTypes, - unexpectedAfterInheritedTypes + Syntax(unexpectedBeforeColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndInheritedTypes), + Syntax(inheritedTypes), + Syntax(unexpectedAfterInheritedTypes) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeColon?.raw, @@ -3845,11 +3845,11 @@ public struct InheritedTypeSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeType, - type, - unexpectedBetweenTypeAndTrailingComma, - trailingComma, - unexpectedAfterTrailingComma + Syntax(unexpectedBeforeType), + Syntax(type), + Syntax(unexpectedBetweenTypeAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeType?.raw, @@ -3977,11 +3977,11 @@ public struct InitializerClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeEqual, - equal, - unexpectedBetweenEqualAndValue, - value, - unexpectedAfterValue + Syntax(unexpectedBeforeEqual), + Syntax(equal), + Syntax(unexpectedBetweenEqualAndValue), + Syntax(value), + Syntax(unexpectedAfterValue) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeEqual?.raw, @@ -4136,23 +4136,23 @@ public struct InitializerDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDe // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAttributes, - attributes, - unexpectedBetweenAttributesAndModifiers, - modifiers, - unexpectedBetweenModifiersAndInitKeyword, - initKeyword, - unexpectedBetweenInitKeywordAndOptionalMark, - optionalMark, - unexpectedBetweenOptionalMarkAndGenericParameterClause, - genericParameterClause, - unexpectedBetweenGenericParameterClauseAndSignature, - signature, - unexpectedBetweenSignatureAndGenericWhereClause, - genericWhereClause, - unexpectedBetweenGenericWhereClauseAndBody, - body, - unexpectedAfterBody + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndInitKeyword), + Syntax(initKeyword), + Syntax(unexpectedBetweenInitKeywordAndOptionalMark), + Syntax(optionalMark), + Syntax(unexpectedBetweenOptionalMarkAndGenericParameterClause), + Syntax(genericParameterClause), + Syntax(unexpectedBetweenGenericParameterClauseAndSignature), + Syntax(signature), + Syntax(unexpectedBetweenSignatureAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedBetweenGenericWhereClauseAndBody), + Syntax(body), + Syntax(unexpectedAfterBody) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, @@ -4479,7 +4479,7 @@ public struct IntegerLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforeLiteral, literal, unexpectedAfterLiteral))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeLiteral), Syntax(literal), Syntax(unexpectedAfterLiteral)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforeLiteral?.raw, literal.raw, unexpectedAfterLiteral?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.integerLiteralExpr, @@ -4577,13 +4577,13 @@ public struct IsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeExpression, - expression, - unexpectedBetweenExpressionAndIsKeyword, - isKeyword, - unexpectedBetweenIsKeywordAndType, - type, - unexpectedAfterType + Syntax(unexpectedBeforeExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndIsKeyword), + Syntax(isKeyword), + Syntax(unexpectedBetweenIsKeywordAndType), + Syntax(type), + Syntax(unexpectedAfterType) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeExpression?.raw, @@ -4729,11 +4729,11 @@ public struct IsTypePatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _LeafP // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeIsKeyword, - isKeyword, - unexpectedBetweenIsKeywordAndType, - type, - unexpectedAfterType + Syntax(unexpectedBeforeIsKeyword), + Syntax(isKeyword), + Syntax(unexpectedBetweenIsKeywordAndType), + Syntax(type), + Syntax(unexpectedAfterType) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeIsKeyword?.raw, diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesJKLMN.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesJKLMN.swift index 757dab966a3..9931795347a 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesJKLMN.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesJKLMN.swift @@ -165,11 +165,11 @@ public struct KeyPathComponentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforePeriod, - period, - unexpectedBetweenPeriodAndComponent, - component, - unexpectedAfterComponent + Syntax(unexpectedBeforePeriod), + Syntax(period), + Syntax(unexpectedBetweenPeriodAndComponent), + Syntax(component), + Syntax(unexpectedAfterComponent) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforePeriod?.raw, @@ -298,13 +298,13 @@ public struct KeyPathExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeBackslash, - backslash, - unexpectedBetweenBackslashAndRoot, - root, - unexpectedBetweenRootAndComponents, - components, - unexpectedAfterComponents + Syntax(unexpectedBeforeBackslash), + Syntax(backslash), + Syntax(unexpectedBetweenBackslashAndRoot), + Syntax(root), + Syntax(unexpectedBetweenRootAndComponents), + Syntax(components), + Syntax(unexpectedAfterComponents) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeBackslash?.raw, @@ -475,7 +475,7 @@ public struct KeyPathOptionalComponentSyntax: SyntaxProtocol, SyntaxHashable, _L ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforeQuestionOrExclamationMark, questionOrExclamationMark, unexpectedAfterQuestionOrExclamationMark))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeQuestionOrExclamationMark), Syntax(questionOrExclamationMark), Syntax(unexpectedAfterQuestionOrExclamationMark)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforeQuestionOrExclamationMark?.raw, questionOrExclamationMark.raw, unexpectedAfterQuestionOrExclamationMark?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.keyPathOptionalComponent, @@ -564,11 +564,11 @@ public struct KeyPathPropertyComponentSyntax: SyntaxProtocol, SyntaxHashable, _L // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeDeclName, - declName, - unexpectedBetweenDeclNameAndGenericArgumentClause, - genericArgumentClause, - unexpectedAfterGenericArgumentClause + Syntax(unexpectedBeforeDeclName), + Syntax(declName), + Syntax(unexpectedBetweenDeclNameAndGenericArgumentClause), + Syntax(genericArgumentClause), + Syntax(unexpectedAfterGenericArgumentClause) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeDeclName?.raw, @@ -692,13 +692,13 @@ public struct KeyPathSubscriptComponentSyntax: SyntaxProtocol, SyntaxHashable, _ // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeftSquare, - leftSquare, - unexpectedBetweenLeftSquareAndArguments, - arguments, - unexpectedBetweenArgumentsAndRightSquare, - rightSquare, - unexpectedAfterRightSquare + Syntax(unexpectedBeforeLeftSquare), + Syntax(leftSquare), + Syntax(unexpectedBetweenLeftSquareAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndRightSquare), + Syntax(rightSquare), + Syntax(unexpectedAfterRightSquare) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftSquare?.raw, @@ -886,15 +886,15 @@ public struct LabeledExprSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLabel, - label, - unexpectedBetweenLabelAndColon, - colon, - unexpectedBetweenColonAndExpression, - expression, - unexpectedBetweenExpressionAndTrailingComma, - trailingComma, - unexpectedAfterTrailingComma + Syntax(unexpectedBeforeLabel), + Syntax(label), + Syntax(unexpectedBetweenLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLabel?.raw, @@ -1084,15 +1084,15 @@ public struct LabeledSpecializeArgumentSyntax: SyntaxProtocol, SyntaxHashable, _ // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLabel, - label, - unexpectedBetweenLabelAndColon, - colon, - unexpectedBetweenColonAndValue, - value, - unexpectedBetweenValueAndTrailingComma, - trailingComma, - unexpectedAfterTrailingComma + Syntax(unexpectedBeforeLabel), + Syntax(label), + Syntax(unexpectedBetweenLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndValue), + Syntax(value), + Syntax(unexpectedBetweenValueAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLabel?.raw, @@ -1280,13 +1280,13 @@ public struct LabeledStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSy // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLabel, - label, - unexpectedBetweenLabelAndColon, - colon, - unexpectedBetweenColonAndStatement, - statement, - unexpectedAfterStatement + Syntax(unexpectedBeforeLabel), + Syntax(label), + Syntax(unexpectedBetweenLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndStatement), + Syntax(statement), + Syntax(unexpectedAfterStatement) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLabel?.raw, @@ -1453,23 +1453,23 @@ public struct LayoutRequirementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeType, - type, - unexpectedBetweenTypeAndColon, - colon, - unexpectedBetweenColonAndLayoutSpecifier, - layoutSpecifier, - unexpectedBetweenLayoutSpecifierAndLeftParen, - leftParen, - unexpectedBetweenLeftParenAndSize, - size, - unexpectedBetweenSizeAndComma, - comma, - unexpectedBetweenCommaAndAlignment, - alignment, - unexpectedBetweenAlignmentAndRightParen, - rightParen, - unexpectedAfterRightParen + Syntax(unexpectedBeforeType), + Syntax(type), + Syntax(unexpectedBetweenTypeAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndLayoutSpecifier), + Syntax(layoutSpecifier), + Syntax(unexpectedBetweenLayoutSpecifierAndLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndSize), + Syntax(size), + Syntax(unexpectedBetweenSizeAndComma), + Syntax(comma), + Syntax(unexpectedBetweenCommaAndAlignment), + Syntax(alignment), + Syntax(unexpectedBetweenAlignmentAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeType?.raw, @@ -1769,11 +1769,11 @@ public struct LifetimeSpecifierArgumentSyntax: SyntaxProtocol, SyntaxHashable, _ // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeParameter, - parameter, - unexpectedBetweenParameterAndTrailingComma, - trailingComma, - unexpectedAfterTrailingComma + Syntax(unexpectedBeforeParameter), + Syntax(parameter), + Syntax(unexpectedBetweenParameterAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeParameter?.raw, @@ -1924,17 +1924,17 @@ public struct LifetimeTypeSpecifierSyntax: SyntaxProtocol, SyntaxHashable, _Leaf // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeDependsOnKeyword, - dependsOnKeyword, - unexpectedBetweenDependsOnKeywordAndLeftParen, - leftParen, - unexpectedBetweenLeftParenAndScopedKeyword, - scopedKeyword, - unexpectedBetweenScopedKeywordAndArguments, - arguments, - unexpectedBetweenArgumentsAndRightParen, - rightParen, - unexpectedAfterRightParen + Syntax(unexpectedBeforeDependsOnKeyword), + Syntax(dependsOnKeyword), + Syntax(unexpectedBetweenDependsOnKeywordAndLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndScopedKeyword), + Syntax(scopedKeyword), + Syntax(unexpectedBetweenScopedKeywordAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeDependsOnKeyword?.raw, @@ -2184,23 +2184,23 @@ public struct MacroDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAttributes, - attributes, - unexpectedBetweenAttributesAndModifiers, - modifiers, - unexpectedBetweenModifiersAndMacroKeyword, - macroKeyword, - unexpectedBetweenMacroKeywordAndName, - name, - unexpectedBetweenNameAndGenericParameterClause, - genericParameterClause, - unexpectedBetweenGenericParameterClauseAndSignature, - signature, - unexpectedBetweenSignatureAndDefinition, - definition, - unexpectedBetweenDefinitionAndGenericWhereClause, - genericWhereClause, - unexpectedAfterGenericWhereClause + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndMacroKeyword), + Syntax(macroKeyword), + Syntax(unexpectedBetweenMacroKeywordAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndGenericParameterClause), + Syntax(genericParameterClause), + Syntax(unexpectedBetweenGenericParameterClauseAndSignature), + Syntax(signature), + Syntax(unexpectedBetweenSignatureAndDefinition), + Syntax(definition), + Syntax(unexpectedBetweenDefinitionAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedAfterGenericWhereClause) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, @@ -2548,27 +2548,27 @@ public struct MacroExpansionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAttributes, - attributes, - unexpectedBetweenAttributesAndModifiers, - modifiers, - unexpectedBetweenModifiersAndPound, - pound, - unexpectedBetweenPoundAndMacroName, - macroName, - unexpectedBetweenMacroNameAndGenericArgumentClause, - genericArgumentClause, - unexpectedBetweenGenericArgumentClauseAndLeftParen, - leftParen, - unexpectedBetweenLeftParenAndArguments, - arguments, - unexpectedBetweenArgumentsAndRightParen, - rightParen, - unexpectedBetweenRightParenAndTrailingClosure, - trailingClosure, - unexpectedBetweenTrailingClosureAndAdditionalTrailingClosures, - additionalTrailingClosures, - unexpectedAfterAdditionalTrailingClosures + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndPound), + Syntax(pound), + Syntax(unexpectedBetweenPoundAndMacroName), + Syntax(macroName), + Syntax(unexpectedBetweenMacroNameAndGenericArgumentClause), + Syntax(genericArgumentClause), + Syntax(unexpectedBetweenGenericArgumentClauseAndLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedBetweenRightParenAndTrailingClosure), + Syntax(trailingClosure), + Syntax(unexpectedBetweenTrailingClosureAndAdditionalTrailingClosures), + Syntax(additionalTrailingClosures), + Syntax(unexpectedAfterAdditionalTrailingClosures) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, @@ -3018,23 +3018,23 @@ public struct MacroExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforePound, - pound, - unexpectedBetweenPoundAndMacroName, - macroName, - unexpectedBetweenMacroNameAndGenericArgumentClause, - genericArgumentClause, - unexpectedBetweenGenericArgumentClauseAndLeftParen, - leftParen, - unexpectedBetweenLeftParenAndArguments, - arguments, - unexpectedBetweenArgumentsAndRightParen, - rightParen, - unexpectedBetweenRightParenAndTrailingClosure, - trailingClosure, - unexpectedBetweenTrailingClosureAndAdditionalTrailingClosures, - additionalTrailingClosures, - unexpectedAfterAdditionalTrailingClosures + Syntax(unexpectedBeforePound), + Syntax(pound), + Syntax(unexpectedBetweenPoundAndMacroName), + Syntax(macroName), + Syntax(unexpectedBetweenMacroNameAndGenericArgumentClause), + Syntax(genericArgumentClause), + Syntax(unexpectedBetweenGenericArgumentClauseAndLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedBetweenRightParenAndTrailingClosure), + Syntax(trailingClosure), + Syntax(unexpectedBetweenTrailingClosureAndAdditionalTrailingClosures), + Syntax(additionalTrailingClosures), + Syntax(unexpectedAfterAdditionalTrailingClosures) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforePound?.raw, @@ -3371,15 +3371,15 @@ public struct MatchingPatternConditionSyntax: SyntaxProtocol, SyntaxHashable, _L // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeCaseKeyword, - caseKeyword, - unexpectedBetweenCaseKeywordAndPattern, - pattern, - unexpectedBetweenPatternAndTypeAnnotation, - typeAnnotation, - unexpectedBetweenTypeAnnotationAndInitializer, - initializer, - unexpectedAfterInitializer + Syntax(unexpectedBeforeCaseKeyword), + Syntax(caseKeyword), + Syntax(unexpectedBetweenCaseKeywordAndPattern), + Syntax(pattern), + Syntax(unexpectedBetweenPatternAndTypeAnnotation), + Syntax(typeAnnotation), + Syntax(unexpectedBetweenTypeAnnotationAndInitializer), + Syntax(initializer), + Syntax(unexpectedAfterInitializer) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeCaseKeyword?.raw, @@ -3552,13 +3552,13 @@ public struct MemberAccessExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeBase, - base, - unexpectedBetweenBaseAndPeriod, - period, - unexpectedBetweenPeriodAndDeclName, - declName, - unexpectedAfterDeclName + Syntax(unexpectedBeforeBase), + Syntax(base), + Syntax(unexpectedBetweenBaseAndPeriod), + Syntax(period), + Syntax(unexpectedBetweenPeriodAndDeclName), + Syntax(declName), + Syntax(unexpectedAfterDeclName) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeBase?.raw, @@ -3710,11 +3710,11 @@ public struct MemberBlockItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeDecl, - decl, - unexpectedBetweenDeclAndSemicolon, - semicolon, - unexpectedAfterSemicolon + Syntax(unexpectedBeforeDecl), + Syntax(decl), + Syntax(unexpectedBetweenDeclAndSemicolon), + Syntax(semicolon), + Syntax(unexpectedAfterSemicolon) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeDecl?.raw, @@ -3847,13 +3847,13 @@ public struct MemberBlockSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeftBrace, - leftBrace, - unexpectedBetweenLeftBraceAndMembers, - members, - unexpectedBetweenMembersAndRightBrace, - rightBrace, - unexpectedAfterRightBrace + Syntax(unexpectedBeforeLeftBrace), + Syntax(leftBrace), + Syntax(unexpectedBetweenLeftBraceAndMembers), + Syntax(members), + Syntax(unexpectedBetweenMembersAndRightBrace), + Syntax(rightBrace), + Syntax(unexpectedAfterRightBrace) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftBrace?.raw, @@ -4031,15 +4031,15 @@ public struct MemberTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSyn // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeBaseType, - baseType, - unexpectedBetweenBaseTypeAndPeriod, - period, - unexpectedBetweenPeriodAndName, - name, - unexpectedBetweenNameAndGenericArgumentClause, - genericArgumentClause, - unexpectedAfterGenericArgumentClause + Syntax(unexpectedBeforeBaseType), + Syntax(baseType), + Syntax(unexpectedBetweenBaseTypeAndPeriod), + Syntax(period), + Syntax(unexpectedBetweenPeriodAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndGenericArgumentClause), + Syntax(genericArgumentClause), + Syntax(unexpectedAfterGenericArgumentClause) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeBaseType?.raw, @@ -4213,13 +4213,13 @@ public struct MetatypeTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeS // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeBaseType, - baseType, - unexpectedBetweenBaseTypeAndPeriod, - period, - unexpectedBetweenPeriodAndMetatypeSpecifier, - metatypeSpecifier, - unexpectedAfterMetatypeSpecifier + Syntax(unexpectedBeforeBaseType), + Syntax(baseType), + Syntax(unexpectedBetweenBaseTypeAndPeriod), + Syntax(period), + Syntax(unexpectedBetweenPeriodAndMetatypeSpecifier), + Syntax(metatypeSpecifier), + Syntax(unexpectedAfterMetatypeSpecifier) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeBaseType?.raw, @@ -4374,13 +4374,13 @@ public struct MissingDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSy // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAttributes, - attributes, - unexpectedBetweenAttributesAndModifiers, - modifiers, - unexpectedBetweenModifiersAndPlaceholder, - placeholder, - unexpectedAfterPlaceholder + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndPlaceholder), + Syntax(placeholder), + Syntax(unexpectedAfterPlaceholder) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, @@ -4581,7 +4581,7 @@ public struct MissingExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforePlaceholder, placeholder, unexpectedAfterPlaceholder))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforePlaceholder?.raw, placeholder.raw, unexpectedAfterPlaceholder?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.missingExpr, @@ -4665,7 +4665,7 @@ public struct MissingPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _Leaf ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforePlaceholder, placeholder, unexpectedAfterPlaceholder))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforePlaceholder?.raw, placeholder.raw, unexpectedAfterPlaceholder?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.missingPattern, @@ -4749,7 +4749,7 @@ public struct MissingStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSy ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforePlaceholder, placeholder, unexpectedAfterPlaceholder))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforePlaceholder?.raw, placeholder.raw, unexpectedAfterPlaceholder?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.missingStmt, @@ -4833,7 +4833,7 @@ public struct MissingSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodeProt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforePlaceholder, placeholder, unexpectedAfterPlaceholder))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforePlaceholder?.raw, placeholder.raw, unexpectedAfterPlaceholder?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.missing, @@ -4917,7 +4917,7 @@ public struct MissingTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSy ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforePlaceholder, placeholder, unexpectedAfterPlaceholder))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforePlaceholder?.raw, placeholder.raw, unexpectedAfterPlaceholder?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.missingType, @@ -5009,13 +5009,13 @@ public struct MultipleTrailingClosureElementSyntax: SyntaxProtocol, SyntaxHashab // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLabel, - label, - unexpectedBetweenLabelAndColon, - colon, - unexpectedBetweenColonAndClosure, - closure, - unexpectedAfterClosure + Syntax(unexpectedBeforeLabel), + Syntax(label), + Syntax(unexpectedBetweenLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndClosure), + Syntax(closure), + Syntax(unexpectedAfterClosure) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLabel?.raw, @@ -5163,11 +5163,11 @@ public struct NamedOpaqueReturnTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _ // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeGenericParameterClause, - genericParameterClause, - unexpectedBetweenGenericParameterClauseAndType, - type, - unexpectedAfterType + Syntax(unexpectedBeforeGenericParameterClause), + Syntax(genericParameterClause), + Syntax(unexpectedBetweenGenericParameterClauseAndType), + Syntax(type), + Syntax(unexpectedAfterType) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeGenericParameterClause?.raw, @@ -5279,7 +5279,7 @@ public struct NilLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExp ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforeNilKeyword, nilKeyword, unexpectedAfterNilKeyword))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeNilKeyword), Syntax(nilKeyword), Syntax(unexpectedAfterNilKeyword)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforeNilKeyword?.raw, nilKeyword.raw, unexpectedAfterNilKeyword?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.nilLiteralExpr, diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesOP.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesOP.swift index fa99351508a..9e68c3febf1 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesOP.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesOP.swift @@ -52,11 +52,11 @@ public struct ObjCSelectorPieceSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeName, - name, - unexpectedBetweenNameAndColon, - colon, - unexpectedAfterColon + Syntax(unexpectedBeforeName), + Syntax(name), + Syntax(unexpectedBetweenNameAndColon), + Syntax(colon), + Syntax(unexpectedAfterColon) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeName?.raw, @@ -188,13 +188,13 @@ public struct OpaqueReturnTypeOfAttributeArgumentsSyntax: SyntaxProtocol, Syntax // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeMangledName, - mangledName, - unexpectedBetweenMangledNameAndComma, - comma, - unexpectedBetweenCommaAndOrdinal, - ordinal, - unexpectedAfterOrdinal + Syntax(unexpectedBeforeMangledName), + Syntax(mangledName), + Syntax(unexpectedBetweenMangledNameAndComma), + Syntax(comma), + Syntax(unexpectedBetweenCommaAndOrdinal), + Syntax(ordinal), + Syntax(unexpectedAfterOrdinal) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeMangledName?.raw, @@ -352,15 +352,15 @@ public struct OperatorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeFixitySpecifier, - fixitySpecifier, - unexpectedBetweenFixitySpecifierAndOperatorKeyword, - operatorKeyword, - unexpectedBetweenOperatorKeywordAndName, - name, - unexpectedBetweenNameAndOperatorPrecedenceAndTypes, - operatorPrecedenceAndTypes, - unexpectedAfterOperatorPrecedenceAndTypes + Syntax(unexpectedBeforeFixitySpecifier), + Syntax(fixitySpecifier), + Syntax(unexpectedBetweenFixitySpecifierAndOperatorKeyword), + Syntax(operatorKeyword), + Syntax(unexpectedBetweenOperatorKeywordAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndOperatorPrecedenceAndTypes), + Syntax(operatorPrecedenceAndTypes), + Syntax(unexpectedAfterOperatorPrecedenceAndTypes) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeFixitySpecifier?.raw, @@ -552,13 +552,13 @@ public struct OperatorPrecedenceAndTypesSyntax: SyntaxProtocol, SyntaxHashable, // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeColon, - colon, - unexpectedBetweenColonAndPrecedenceGroup, - precedenceGroup, - unexpectedBetweenPrecedenceGroupAndDesignatedTypes, - designatedTypes, - unexpectedAfterDesignatedTypes + Syntax(unexpectedBeforeColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndPrecedenceGroup), + Syntax(precedenceGroup), + Syntax(unexpectedBetweenPrecedenceGroupAndDesignatedTypes), + Syntax(designatedTypes), + Syntax(unexpectedAfterDesignatedTypes) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeColon?.raw, @@ -743,15 +743,15 @@ public struct OptionalBindingConditionSyntax: SyntaxProtocol, SyntaxHashable, _L // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeBindingSpecifier, - bindingSpecifier, - unexpectedBetweenBindingSpecifierAndPattern, - pattern, - unexpectedBetweenPatternAndTypeAnnotation, - typeAnnotation, - unexpectedBetweenTypeAnnotationAndInitializer, - initializer, - unexpectedAfterInitializer + Syntax(unexpectedBeforeBindingSpecifier), + Syntax(bindingSpecifier), + Syntax(unexpectedBetweenBindingSpecifierAndPattern), + Syntax(pattern), + Syntax(unexpectedBetweenPatternAndTypeAnnotation), + Syntax(typeAnnotation), + Syntax(unexpectedBetweenTypeAnnotationAndInitializer), + Syntax(initializer), + Syntax(unexpectedAfterInitializer) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeBindingSpecifier?.raw, @@ -923,11 +923,11 @@ public struct OptionalChainingExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _L // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeExpression, - expression, - unexpectedBetweenExpressionAndQuestionMark, - questionMark, - unexpectedAfterQuestionMark + Syntax(unexpectedBeforeExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndQuestionMark), + Syntax(questionMark), + Syntax(unexpectedAfterQuestionMark) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeExpression?.raw, @@ -1045,11 +1045,11 @@ public struct OptionalTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeS // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeWrappedType, - wrappedType, - unexpectedBetweenWrappedTypeAndQuestionMark, - questionMark, - unexpectedAfterQuestionMark + Syntax(unexpectedBeforeWrappedType), + Syntax(wrappedType), + Syntax(unexpectedBetweenWrappedTypeAndQuestionMark), + Syntax(questionMark), + Syntax(unexpectedAfterQuestionMark) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeWrappedType?.raw, @@ -1182,17 +1182,17 @@ public struct OriginallyDefinedInAttributeArgumentsSyntax: SyntaxProtocol, Synta // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeModuleLabel, - moduleLabel, - unexpectedBetweenModuleLabelAndColon, - colon, - unexpectedBetweenColonAndModuleName, - moduleName, - unexpectedBetweenModuleNameAndComma, - comma, - unexpectedBetweenCommaAndPlatforms, - platforms, - unexpectedAfterPlatforms + Syntax(unexpectedBeforeModuleLabel), + Syntax(moduleLabel), + Syntax(unexpectedBetweenModuleLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndModuleName), + Syntax(moduleName), + Syntax(unexpectedBetweenModuleNameAndComma), + Syntax(comma), + Syntax(unexpectedBetweenCommaAndPlatforms), + Syntax(platforms), + Syntax(unexpectedAfterPlatforms) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeModuleLabel?.raw, @@ -1417,11 +1417,11 @@ public struct PackElementExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafEx // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeEachKeyword, - eachKeyword, - unexpectedBetweenEachKeywordAndPack, - pack, - unexpectedAfterPack + Syntax(unexpectedBeforeEachKeyword), + Syntax(eachKeyword), + Syntax(unexpectedBetweenEachKeywordAndPack), + Syntax(pack), + Syntax(unexpectedAfterPack) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeEachKeyword?.raw, @@ -1539,11 +1539,11 @@ public struct PackElementTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTy // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeEachKeyword, - eachKeyword, - unexpectedBetweenEachKeywordAndPack, - pack, - unexpectedAfterPack + Syntax(unexpectedBeforeEachKeyword), + Syntax(eachKeyword), + Syntax(unexpectedBetweenEachKeywordAndPack), + Syntax(pack), + Syntax(unexpectedAfterPack) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeEachKeyword?.raw, @@ -1663,11 +1663,11 @@ public struct PackExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeRepeatKeyword, - repeatKeyword, - unexpectedBetweenRepeatKeywordAndRepetitionPattern, - repetitionPattern, - unexpectedAfterRepetitionPattern + Syntax(unexpectedBeforeRepeatKeyword), + Syntax(repeatKeyword), + Syntax(unexpectedBetweenRepeatKeywordAndRepetitionPattern), + Syntax(repetitionPattern), + Syntax(unexpectedAfterRepetitionPattern) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeRepeatKeyword?.raw, @@ -1785,11 +1785,11 @@ public struct PackExpansionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _Leaf // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeRepeatKeyword, - repeatKeyword, - unexpectedBetweenRepeatKeywordAndRepetitionPattern, - repetitionPattern, - unexpectedAfterRepetitionPattern + Syntax(unexpectedBeforeRepeatKeyword), + Syntax(repeatKeyword), + Syntax(unexpectedBetweenRepeatKeywordAndRepetitionPattern), + Syntax(repetitionPattern), + Syntax(unexpectedAfterRepetitionPattern) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeRepeatKeyword?.raw, @@ -1926,17 +1926,17 @@ public struct PatternBindingSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforePattern, - pattern, - unexpectedBetweenPatternAndTypeAnnotation, - typeAnnotation, - unexpectedBetweenTypeAnnotationAndInitializer, - initializer, - unexpectedBetweenInitializerAndAccessorBlock, - accessorBlock, - unexpectedBetweenAccessorBlockAndTrailingComma, - trailingComma, - unexpectedAfterTrailingComma + Syntax(unexpectedBeforePattern), + Syntax(pattern), + Syntax(unexpectedBetweenPatternAndTypeAnnotation), + Syntax(typeAnnotation), + Syntax(unexpectedBetweenTypeAnnotationAndInitializer), + Syntax(initializer), + Syntax(unexpectedBetweenInitializerAndAccessorBlock), + Syntax(accessorBlock), + Syntax(unexpectedBetweenAccessorBlockAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforePattern?.raw, @@ -2138,7 +2138,7 @@ public struct PatternExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforePattern, pattern, unexpectedAfterPattern))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforePattern), Syntax(pattern), Syntax(unexpectedAfterPattern)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforePattern?.raw, pattern.raw, unexpectedAfterPattern?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.patternExpr, @@ -2224,11 +2224,11 @@ public struct PlatformVersionItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforePlatformVersion, - platformVersion, - unexpectedBetweenPlatformVersionAndTrailingComma, - trailingComma, - unexpectedAfterTrailingComma + Syntax(unexpectedBeforePlatformVersion), + Syntax(platformVersion), + Syntax(unexpectedBetweenPlatformVersionAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforePlatformVersion?.raw, @@ -2358,11 +2358,11 @@ public struct PlatformVersionSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforePlatform, - platform, - unexpectedBetweenPlatformAndVersion, - version, - unexpectedAfterVersion + Syntax(unexpectedBeforePlatform), + Syntax(platform), + Syntax(unexpectedBetweenPlatformAndVersion), + Syntax(version), + Syntax(unexpectedAfterVersion) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforePlatform?.raw, @@ -2487,11 +2487,11 @@ public struct PostfixIfConfigExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Le // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeBase, - base, - unexpectedBetweenBaseAndConfig, - config, - unexpectedAfterConfig + Syntax(unexpectedBeforeBase), + Syntax(base), + Syntax(unexpectedBetweenBaseAndConfig), + Syntax(config), + Syntax(unexpectedAfterConfig) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeBase?.raw, @@ -2606,11 +2606,11 @@ public struct PostfixOperatorExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Le // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeExpression, - expression, - unexpectedBetweenExpressionAndOperator, - `operator`, - unexpectedAfterOperator + Syntax(unexpectedBeforeExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndOperator), + Syntax(`operator`), + Syntax(unexpectedAfterOperator) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeExpression?.raw, @@ -2747,21 +2747,21 @@ public struct PoundSourceLocationArgumentsSyntax: SyntaxProtocol, SyntaxHashable // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeFileLabel, - fileLabel, - unexpectedBetweenFileLabelAndFileColon, - fileColon, - unexpectedBetweenFileColonAndFileName, - fileName, - unexpectedBetweenFileNameAndComma, - comma, - unexpectedBetweenCommaAndLineLabel, - lineLabel, - unexpectedBetweenLineLabelAndLineColon, - lineColon, - unexpectedBetweenLineColonAndLineNumber, - lineNumber, - unexpectedAfterLineNumber + Syntax(unexpectedBeforeFileLabel), + Syntax(fileLabel), + Syntax(unexpectedBetweenFileLabelAndFileColon), + Syntax(fileColon), + Syntax(unexpectedBetweenFileColonAndFileName), + Syntax(fileName), + Syntax(unexpectedBetweenFileNameAndComma), + Syntax(comma), + Syntax(unexpectedBetweenCommaAndLineLabel), + Syntax(lineLabel), + Syntax(unexpectedBetweenLineLabelAndLineColon), + Syntax(lineColon), + Syntax(unexpectedBetweenLineColonAndLineNumber), + Syntax(lineNumber), + Syntax(unexpectedAfterLineNumber) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeFileLabel?.raw, @@ -3020,15 +3020,15 @@ public struct PoundSourceLocationSyntax: DeclSyntaxProtocol, SyntaxHashable, _Le // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforePoundSourceLocation, - poundSourceLocation, - unexpectedBetweenPoundSourceLocationAndLeftParen, - leftParen, - unexpectedBetweenLeftParenAndArguments, - arguments, - unexpectedBetweenArgumentsAndRightParen, - rightParen, - unexpectedAfterRightParen + Syntax(unexpectedBeforePoundSourceLocation), + Syntax(poundSourceLocation), + Syntax(unexpectedBetweenPoundSourceLocationAndLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforePoundSourceLocation?.raw, @@ -3210,13 +3210,13 @@ public struct PrecedenceGroupAssignmentSyntax: SyntaxProtocol, SyntaxHashable, _ // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAssignmentLabel, - assignmentLabel, - unexpectedBetweenAssignmentLabelAndColon, - colon, - unexpectedBetweenColonAndValue, - value, - unexpectedAfterValue + Syntax(unexpectedBeforeAssignmentLabel), + Syntax(assignmentLabel), + Syntax(unexpectedBetweenAssignmentLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndValue), + Syntax(value), + Syntax(unexpectedAfterValue) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAssignmentLabel?.raw, @@ -3378,13 +3378,13 @@ public struct PrecedenceGroupAssociativitySyntax: SyntaxProtocol, SyntaxHashable // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAssociativityLabel, - associativityLabel, - unexpectedBetweenAssociativityLabelAndColon, - colon, - unexpectedBetweenColonAndValue, - value, - unexpectedAfterValue + Syntax(unexpectedBeforeAssociativityLabel), + Syntax(associativityLabel), + Syntax(unexpectedBetweenAssociativityLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndValue), + Syntax(value), + Syntax(unexpectedAfterValue) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAssociativityLabel?.raw, @@ -3558,21 +3558,21 @@ public struct PrecedenceGroupDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Le // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAttributes, - attributes, - unexpectedBetweenAttributesAndModifiers, - modifiers, - unexpectedBetweenModifiersAndPrecedencegroupKeyword, - precedencegroupKeyword, - unexpectedBetweenPrecedencegroupKeywordAndName, - name, - unexpectedBetweenNameAndLeftBrace, - leftBrace, - unexpectedBetweenLeftBraceAndGroupAttributes, - groupAttributes, - unexpectedBetweenGroupAttributesAndRightBrace, - rightBrace, - unexpectedAfterRightBrace + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndPrecedencegroupKeyword), + Syntax(precedencegroupKeyword), + Syntax(unexpectedBetweenPrecedencegroupKeywordAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndLeftBrace), + Syntax(leftBrace), + Syntax(unexpectedBetweenLeftBraceAndGroupAttributes), + Syntax(groupAttributes), + Syntax(unexpectedBetweenGroupAttributesAndRightBrace), + Syntax(rightBrace), + Syntax(unexpectedAfterRightBrace) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, @@ -3909,11 +3909,11 @@ public struct PrecedenceGroupNameSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeName, - name, - unexpectedBetweenNameAndTrailingComma, - trailingComma, - unexpectedAfterTrailingComma + Syntax(unexpectedBeforeName), + Syntax(name), + Syntax(unexpectedBetweenNameAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeName?.raw, @@ -4045,13 +4045,13 @@ public struct PrecedenceGroupRelationSyntax: SyntaxProtocol, SyntaxHashable, _Le // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeHigherThanOrLowerThanLabel, - higherThanOrLowerThanLabel, - unexpectedBetweenHigherThanOrLowerThanLabelAndColon, - colon, - unexpectedBetweenColonAndPrecedenceGroups, - precedenceGroups, - unexpectedAfterPrecedenceGroups + Syntax(unexpectedBeforeHigherThanOrLowerThanLabel), + Syntax(higherThanOrLowerThanLabel), + Syntax(unexpectedBetweenHigherThanOrLowerThanLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndPrecedenceGroups), + Syntax(precedenceGroups), + Syntax(unexpectedAfterPrecedenceGroups) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeHigherThanOrLowerThanLabel?.raw, @@ -4240,11 +4240,11 @@ public struct PrefixOperatorExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeOperator, - `operator`, - unexpectedBetweenOperatorAndExpression, - expression, - unexpectedAfterExpression + Syntax(unexpectedBeforeOperator), + Syntax(`operator`), + Syntax(unexpectedBetweenOperatorAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeOperator?.raw, @@ -4369,13 +4369,13 @@ public struct PrimaryAssociatedTypeClauseSyntax: SyntaxProtocol, SyntaxHashable, // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeftAngle, - leftAngle, - unexpectedBetweenLeftAngleAndPrimaryAssociatedTypes, - primaryAssociatedTypes, - unexpectedBetweenPrimaryAssociatedTypesAndRightAngle, - rightAngle, - unexpectedAfterRightAngle + Syntax(unexpectedBeforeLeftAngle), + Syntax(leftAngle), + Syntax(unexpectedBetweenLeftAngleAndPrimaryAssociatedTypes), + Syntax(primaryAssociatedTypes), + Syntax(unexpectedBetweenPrimaryAssociatedTypesAndRightAngle), + Syntax(rightAngle), + Syntax(unexpectedAfterRightAngle) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftAngle?.raw, @@ -4551,11 +4551,11 @@ public struct PrimaryAssociatedTypeSyntax: SyntaxProtocol, SyntaxHashable, _Leaf // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeName, - name, - unexpectedBetweenNameAndTrailingComma, - trailingComma, - unexpectedAfterTrailingComma + Syntax(unexpectedBeforeName), + Syntax(name), + Syntax(unexpectedBetweenNameAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeName?.raw, @@ -4712,23 +4712,23 @@ public struct ProtocolDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAttributes, - attributes, - unexpectedBetweenAttributesAndModifiers, - modifiers, - unexpectedBetweenModifiersAndProtocolKeyword, - protocolKeyword, - unexpectedBetweenProtocolKeywordAndName, - name, - unexpectedBetweenNameAndPrimaryAssociatedTypeClause, - primaryAssociatedTypeClause, - unexpectedBetweenPrimaryAssociatedTypeClauseAndInheritanceClause, - inheritanceClause, - unexpectedBetweenInheritanceClauseAndGenericWhereClause, - genericWhereClause, - unexpectedBetweenGenericWhereClauseAndMemberBlock, - memberBlock, - unexpectedAfterMemberBlock + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndProtocolKeyword), + Syntax(protocolKeyword), + Syntax(unexpectedBetweenProtocolKeywordAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndPrimaryAssociatedTypeClause), + Syntax(primaryAssociatedTypeClause), + Syntax(unexpectedBetweenPrimaryAssociatedTypeClauseAndInheritanceClause), + Syntax(inheritanceClause), + Syntax(unexpectedBetweenInheritanceClauseAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedBetweenGenericWhereClauseAndMemberBlock), + Syntax(memberBlock), + Syntax(unexpectedAfterMemberBlock) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift index 310f6ae7ec5..c4c3bbf6a28 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift @@ -53,17 +53,17 @@ public struct RegexLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeOpeningPounds, - openingPounds, - unexpectedBetweenOpeningPoundsAndOpeningSlash, - openingSlash, - unexpectedBetweenOpeningSlashAndRegex, - regex, - unexpectedBetweenRegexAndClosingSlash, - closingSlash, - unexpectedBetweenClosingSlashAndClosingPounds, - closingPounds, - unexpectedAfterClosingPounds + Syntax(unexpectedBeforeOpeningPounds), + Syntax(openingPounds), + Syntax(unexpectedBetweenOpeningPoundsAndOpeningSlash), + Syntax(openingSlash), + Syntax(unexpectedBetweenOpeningSlashAndRegex), + Syntax(regex), + Syntax(unexpectedBetweenRegexAndClosingSlash), + Syntax(closingSlash), + Syntax(unexpectedBetweenClosingSlashAndClosingPounds), + Syntax(closingPounds), + Syntax(unexpectedAfterClosingPounds) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeOpeningPounds?.raw, @@ -271,15 +271,15 @@ public struct RepeatStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyn // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeRepeatKeyword, - repeatKeyword, - unexpectedBetweenRepeatKeywordAndBody, - body, - unexpectedBetweenBodyAndWhileKeyword, - whileKeyword, - unexpectedBetweenWhileKeywordAndCondition, - condition, - unexpectedAfterCondition + Syntax(unexpectedBeforeRepeatKeyword), + Syntax(repeatKeyword), + Syntax(unexpectedBetweenRepeatKeywordAndBody), + Syntax(body), + Syntax(unexpectedBetweenBodyAndWhileKeyword), + Syntax(whileKeyword), + Syntax(unexpectedBetweenWhileKeywordAndCondition), + Syntax(condition), + Syntax(unexpectedAfterCondition) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeRepeatKeyword?.raw, @@ -457,11 +457,11 @@ public struct ReturnClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeArrow, - arrow, - unexpectedBetweenArrowAndType, - type, - unexpectedAfterType + Syntax(unexpectedBeforeArrow), + Syntax(arrow), + Syntax(unexpectedBetweenArrowAndType), + Syntax(type), + Syntax(unexpectedAfterType) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeArrow?.raw, @@ -582,11 +582,11 @@ public struct ReturnStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyn // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeReturnKeyword, - returnKeyword, - unexpectedBetweenReturnKeywordAndExpression, - expression, - unexpectedAfterExpression + Syntax(unexpectedBeforeReturnKeyword), + Syntax(returnKeyword), + Syntax(unexpectedBetweenReturnKeywordAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeReturnKeyword?.raw, @@ -711,13 +711,13 @@ public struct SameTypeRequirementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeftType, - leftType, - unexpectedBetweenLeftTypeAndEqual, - equal, - unexpectedBetweenEqualAndRightType, - rightType, - unexpectedAfterRightType + Syntax(unexpectedBeforeLeftType), + Syntax(leftType), + Syntax(unexpectedBetweenLeftTypeAndEqual), + Syntax(equal), + Syntax(unexpectedBetweenEqualAndRightType), + Syntax(rightType), + Syntax(unexpectedAfterRightType) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftType?.raw, @@ -866,7 +866,7 @@ public struct SequenceExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprS ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforeElements, elements, unexpectedAfterElements))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeElements), Syntax(elements), Syntax(unexpectedAfterElements)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforeElements?.raw, elements.raw, unexpectedAfterElements?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.sequenceExpr, @@ -984,13 +984,13 @@ public struct SimpleStringLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeOpeningQuote, - openingQuote, - unexpectedBetweenOpeningQuoteAndSegments, - segments, - unexpectedBetweenSegmentsAndClosingQuote, - closingQuote, - unexpectedAfterClosingQuote + Syntax(unexpectedBeforeOpeningQuote), + Syntax(openingQuote), + Syntax(unexpectedBetweenOpeningQuoteAndSegments), + Syntax(segments), + Syntax(unexpectedBetweenSegmentsAndClosingQuote), + Syntax(closingQuote), + Syntax(unexpectedAfterClosingQuote) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeOpeningQuote?.raw, @@ -1174,7 +1174,7 @@ public struct SimpleTypeSpecifierSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforeSpecifier, specifier, unexpectedAfterSpecifier))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeSpecifier), Syntax(specifier), Syntax(unexpectedAfterSpecifier)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforeSpecifier?.raw, specifier.raw, unexpectedAfterSpecifier?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.simpleTypeSpecifier, @@ -1265,11 +1265,11 @@ public struct SomeOrAnyTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafType // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeSomeOrAnySpecifier, - someOrAnySpecifier, - unexpectedBetweenSomeOrAnySpecifierAndConstraint, - constraint, - unexpectedAfterConstraint + Syntax(unexpectedBeforeSomeOrAnySpecifier), + Syntax(someOrAnySpecifier), + Syntax(unexpectedBetweenSomeOrAnySpecifierAndConstraint), + Syntax(constraint), + Syntax(unexpectedAfterConstraint) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeSomeOrAnySpecifier?.raw, @@ -1393,13 +1393,13 @@ public struct SourceFileSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodeP // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeShebang, - shebang, - unexpectedBetweenShebangAndStatements, - statements, - unexpectedBetweenStatementsAndEndOfFileToken, - endOfFileToken, - unexpectedAfterEndOfFileToken + Syntax(unexpectedBeforeShebang), + Syntax(shebang), + Syntax(unexpectedBetweenShebangAndStatements), + Syntax(statements), + Syntax(unexpectedBetweenStatementsAndEndOfFileToken), + Syntax(endOfFileToken), + Syntax(unexpectedAfterEndOfFileToken) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeShebang?.raw, @@ -1587,15 +1587,15 @@ public struct SpecializeAvailabilityArgumentSyntax: SyntaxProtocol, SyntaxHashab // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAvailabilityLabel, - availabilityLabel, - unexpectedBetweenAvailabilityLabelAndColon, - colon, - unexpectedBetweenColonAndAvailabilityArguments, - availabilityArguments, - unexpectedBetweenAvailabilityArgumentsAndSemicolon, - semicolon, - unexpectedAfterSemicolon + Syntax(unexpectedBeforeAvailabilityLabel), + Syntax(availabilityLabel), + Syntax(unexpectedBetweenAvailabilityLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndAvailabilityArguments), + Syntax(availabilityArguments), + Syntax(unexpectedBetweenAvailabilityArgumentsAndSemicolon), + Syntax(semicolon), + Syntax(unexpectedAfterSemicolon) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAvailabilityLabel?.raw, @@ -1814,15 +1814,15 @@ public struct SpecializeTargetFunctionArgumentSyntax: SyntaxProtocol, SyntaxHash // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeTargetLabel, - targetLabel, - unexpectedBetweenTargetLabelAndColon, - colon, - unexpectedBetweenColonAndDeclName, - declName, - unexpectedBetweenDeclNameAndTrailingComma, - trailingComma, - unexpectedAfterTrailingComma + Syntax(unexpectedBeforeTargetLabel), + Syntax(targetLabel), + Syntax(unexpectedBetweenTargetLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndDeclName), + Syntax(declName), + Syntax(unexpectedBetweenDeclNameAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeTargetLabel?.raw, @@ -2029,17 +2029,17 @@ public struct StringLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeOpeningPounds, - openingPounds, - unexpectedBetweenOpeningPoundsAndOpeningQuote, - openingQuote, - unexpectedBetweenOpeningQuoteAndSegments, - segments, - unexpectedBetweenSegmentsAndClosingQuote, - closingQuote, - unexpectedBetweenClosingQuoteAndClosingPounds, - closingPounds, - unexpectedAfterClosingPounds + Syntax(unexpectedBeforeOpeningPounds), + Syntax(openingPounds), + Syntax(unexpectedBetweenOpeningPoundsAndOpeningQuote), + Syntax(openingQuote), + Syntax(unexpectedBetweenOpeningQuoteAndSegments), + Syntax(segments), + Syntax(unexpectedBetweenSegmentsAndClosingQuote), + Syntax(closingQuote), + Syntax(unexpectedBetweenClosingQuoteAndClosingPounds), + Syntax(closingPounds), + Syntax(unexpectedAfterClosingPounds) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeOpeningPounds?.raw, @@ -2276,7 +2276,7 @@ public struct StringSegmentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforeContent, content, unexpectedAfterContent))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeContent), Syntax(content), Syntax(unexpectedAfterContent)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforeContent?.raw, content.raw, unexpectedAfterContent?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.stringSegment, @@ -2441,23 +2441,23 @@ public struct StructDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyn // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAttributes, - attributes, - unexpectedBetweenAttributesAndModifiers, - modifiers, - unexpectedBetweenModifiersAndStructKeyword, - structKeyword, - unexpectedBetweenStructKeywordAndName, - name, - unexpectedBetweenNameAndGenericParameterClause, - genericParameterClause, - unexpectedBetweenGenericParameterClauseAndInheritanceClause, - inheritanceClause, - unexpectedBetweenInheritanceClauseAndGenericWhereClause, - genericWhereClause, - unexpectedBetweenGenericWhereClauseAndMemberBlock, - memberBlock, - unexpectedAfterMemberBlock + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndStructKeyword), + Syntax(structKeyword), + Syntax(unexpectedBetweenStructKeywordAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndGenericParameterClause), + Syntax(genericParameterClause), + Syntax(unexpectedBetweenGenericParameterClauseAndInheritanceClause), + Syntax(inheritanceClause), + Syntax(unexpectedBetweenInheritanceClauseAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedBetweenGenericWhereClauseAndMemberBlock), + Syntax(memberBlock), + Syntax(unexpectedAfterMemberBlock) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, @@ -2798,19 +2798,19 @@ public struct SubscriptCallExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeCalledExpression, - calledExpression, - unexpectedBetweenCalledExpressionAndLeftSquare, - leftSquare, - unexpectedBetweenLeftSquareAndArguments, - arguments, - unexpectedBetweenArgumentsAndRightSquare, - rightSquare, - unexpectedBetweenRightSquareAndTrailingClosure, - trailingClosure, - unexpectedBetweenTrailingClosureAndAdditionalTrailingClosures, - additionalTrailingClosures, - unexpectedAfterAdditionalTrailingClosures + Syntax(unexpectedBeforeCalledExpression), + Syntax(calledExpression), + Syntax(unexpectedBetweenCalledExpressionAndLeftSquare), + Syntax(leftSquare), + Syntax(unexpectedBetweenLeftSquareAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndRightSquare), + Syntax(rightSquare), + Syntax(unexpectedBetweenRightSquareAndTrailingClosure), + Syntax(trailingClosure), + Syntax(unexpectedBetweenTrailingClosureAndAdditionalTrailingClosures), + Syntax(additionalTrailingClosures), + Syntax(unexpectedAfterAdditionalTrailingClosures) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeCalledExpression?.raw, @@ -3101,23 +3101,23 @@ public struct SubscriptDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAttributes, - attributes, - unexpectedBetweenAttributesAndModifiers, - modifiers, - unexpectedBetweenModifiersAndSubscriptKeyword, - subscriptKeyword, - unexpectedBetweenSubscriptKeywordAndGenericParameterClause, - genericParameterClause, - unexpectedBetweenGenericParameterClauseAndParameterClause, - parameterClause, - unexpectedBetweenParameterClauseAndReturnClause, - returnClause, - unexpectedBetweenReturnClauseAndGenericWhereClause, - genericWhereClause, - unexpectedBetweenGenericWhereClauseAndAccessorBlock, - accessorBlock, - unexpectedAfterAccessorBlock + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndSubscriptKeyword), + Syntax(subscriptKeyword), + Syntax(unexpectedBetweenSubscriptKeywordAndGenericParameterClause), + Syntax(genericParameterClause), + Syntax(unexpectedBetweenGenericParameterClauseAndParameterClause), + Syntax(parameterClause), + Syntax(unexpectedBetweenParameterClauseAndReturnClause), + Syntax(returnClause), + Syntax(unexpectedBetweenReturnClauseAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedBetweenGenericWhereClauseAndAccessorBlock), + Syntax(accessorBlock), + Syntax(unexpectedAfterAccessorBlock) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, @@ -3431,7 +3431,7 @@ public struct SuperExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforeSuperKeyword, superKeyword, unexpectedAfterSuperKeyword))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeSuperKeyword), Syntax(superKeyword), Syntax(unexpectedAfterSuperKeyword)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforeSuperKeyword?.raw, superKeyword.raw, unexpectedAfterSuperKeyword?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.superExpr, @@ -3512,11 +3512,11 @@ public struct SuppressedTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeWithoutTilde, - withoutTilde, - unexpectedBetweenWithoutTildeAndType, - type, - unexpectedAfterType + Syntax(unexpectedBeforeWithoutTilde), + Syntax(withoutTilde), + Syntax(unexpectedBetweenWithoutTildeAndType), + Syntax(type), + Syntax(unexpectedAfterType) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeWithoutTilde?.raw, @@ -3641,13 +3641,13 @@ public struct SwitchCaseItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforePattern, - pattern, - unexpectedBetweenPatternAndWhereClause, - whereClause, - unexpectedBetweenWhereClauseAndTrailingComma, - trailingComma, - unexpectedAfterTrailingComma + Syntax(unexpectedBeforePattern), + Syntax(pattern), + Syntax(unexpectedBetweenPatternAndWhereClause), + Syntax(whereClause), + Syntax(unexpectedBetweenWhereClauseAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforePattern?.raw, @@ -3796,13 +3796,13 @@ public struct SwitchCaseLabelSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeCaseKeyword, - caseKeyword, - unexpectedBetweenCaseKeywordAndCaseItems, - caseItems, - unexpectedBetweenCaseItemsAndColon, - colon, - unexpectedAfterColon + Syntax(unexpectedBeforeCaseKeyword), + Syntax(caseKeyword), + Syntax(unexpectedBetweenCaseKeywordAndCaseItems), + Syntax(caseItems), + Syntax(unexpectedBetweenCaseItemsAndColon), + Syntax(colon), + Syntax(unexpectedAfterColon) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeCaseKeyword?.raw, @@ -4064,13 +4064,13 @@ public struct SwitchCaseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodeP // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAttribute, - attribute, - unexpectedBetweenAttributeAndLabel, - label, - unexpectedBetweenLabelAndStatements, - statements, - unexpectedAfterStatements + Syntax(unexpectedBeforeAttribute), + Syntax(attribute), + Syntax(unexpectedBetweenAttributeAndLabel), + Syntax(label), + Syntax(unexpectedBetweenLabelAndStatements), + Syntax(statements), + Syntax(unexpectedAfterStatements) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAttribute?.raw, @@ -4241,11 +4241,11 @@ public struct SwitchDefaultLabelSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeDefaultKeyword, - defaultKeyword, - unexpectedBetweenDefaultKeywordAndColon, - colon, - unexpectedAfterColon + Syntax(unexpectedBeforeDefaultKeyword), + Syntax(defaultKeyword), + Syntax(unexpectedBetweenDefaultKeywordAndColon), + Syntax(colon), + Syntax(unexpectedAfterColon) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeDefaultKeyword?.raw, @@ -4393,17 +4393,17 @@ public struct SwitchExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyn // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeSwitchKeyword, - switchKeyword, - unexpectedBetweenSwitchKeywordAndSubject, - subject, - unexpectedBetweenSubjectAndLeftBrace, - leftBrace, - unexpectedBetweenLeftBraceAndCases, - cases, - unexpectedBetweenCasesAndRightBrace, - rightBrace, - unexpectedAfterRightBrace + Syntax(unexpectedBeforeSwitchKeyword), + Syntax(switchKeyword), + Syntax(unexpectedBetweenSwitchKeywordAndSubject), + Syntax(subject), + Syntax(unexpectedBetweenSubjectAndLeftBrace), + Syntax(leftBrace), + Syntax(unexpectedBetweenLeftBraceAndCases), + Syntax(cases), + Syntax(unexpectedBetweenCasesAndRightBrace), + Syntax(rightBrace), + Syntax(unexpectedAfterRightBrace) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeSwitchKeyword?.raw, diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesTUVWXYZ.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesTUVWXYZ.swift index 92c3e44d306..4cd778f5b21 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesTUVWXYZ.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesTUVWXYZ.swift @@ -64,17 +64,17 @@ public struct TernaryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeCondition, - condition, - unexpectedBetweenConditionAndQuestionMark, - questionMark, - unexpectedBetweenQuestionMarkAndThenExpression, - thenExpression, - unexpectedBetweenThenExpressionAndColon, - colon, - unexpectedBetweenColonAndElseExpression, - elseExpression, - unexpectedAfterElseExpression + Syntax(unexpectedBeforeCondition), + Syntax(condition), + Syntax(unexpectedBetweenConditionAndQuestionMark), + Syntax(questionMark), + Syntax(unexpectedBetweenQuestionMarkAndThenExpression), + Syntax(thenExpression), + Syntax(unexpectedBetweenThenExpressionAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndElseExpression), + Syntax(elseExpression), + Syntax(unexpectedAfterElseExpression) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeCondition?.raw, @@ -280,11 +280,11 @@ public struct ThenStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynta // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeThenKeyword, - thenKeyword, - unexpectedBetweenThenKeywordAndExpression, - expression, - unexpectedAfterExpression + Syntax(unexpectedBeforeThenKeyword), + Syntax(thenKeyword), + Syntax(unexpectedBetweenThenKeywordAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeThenKeyword?.raw, @@ -402,11 +402,11 @@ public struct ThrowStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeThrowKeyword, - throwKeyword, - unexpectedBetweenThrowKeywordAndExpression, - expression, - unexpectedAfterExpression + Syntax(unexpectedBeforeThrowKeyword), + Syntax(throwKeyword), + Syntax(unexpectedBetweenThrowKeywordAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeThrowKeyword?.raw, @@ -541,15 +541,15 @@ public struct ThrowsClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeThrowsSpecifier, - throwsSpecifier, - unexpectedBetweenThrowsSpecifierAndLeftParen, - leftParen, - unexpectedBetweenLeftParenAndType, - type, - unexpectedBetweenTypeAndRightParen, - rightParen, - unexpectedAfterRightParen + Syntax(unexpectedBeforeThrowsSpecifier), + Syntax(throwsSpecifier), + Syntax(unexpectedBetweenThrowsSpecifierAndLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndType), + Syntax(type), + Syntax(unexpectedBetweenTypeAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeThrowsSpecifier?.raw, @@ -749,13 +749,13 @@ public struct TryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntax // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeTryKeyword, - tryKeyword, - unexpectedBetweenTryKeywordAndQuestionOrExclamationMark, - questionOrExclamationMark, - unexpectedBetweenQuestionOrExclamationMarkAndExpression, - expression, - unexpectedAfterExpression + Syntax(unexpectedBeforeTryKeyword), + Syntax(tryKeyword), + Syntax(unexpectedBetweenTryKeywordAndQuestionOrExclamationMark), + Syntax(questionOrExclamationMark), + Syntax(unexpectedBetweenQuestionOrExclamationMarkAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeTryKeyword?.raw, @@ -905,13 +905,13 @@ public struct TupleExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeftParen, - leftParen, - unexpectedBetweenLeftParenAndElements, - elements, - unexpectedBetweenElementsAndRightParen, - rightParen, - unexpectedAfterRightParen + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndElements), + Syntax(elements), + Syntax(unexpectedBetweenElementsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftParen?.raw, @@ -1099,15 +1099,15 @@ public struct TuplePatternElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLabel, - label, - unexpectedBetweenLabelAndColon, - colon, - unexpectedBetweenColonAndPattern, - pattern, - unexpectedBetweenPatternAndTrailingComma, - trailingComma, - unexpectedAfterTrailingComma + Syntax(unexpectedBeforeLabel), + Syntax(label), + Syntax(unexpectedBetweenLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndPattern), + Syntax(pattern), + Syntax(unexpectedBetweenPatternAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLabel?.raw, @@ -1302,13 +1302,13 @@ public struct TuplePatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _LeafPa // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeftParen, - leftParen, - unexpectedBetweenLeftParenAndElements, - elements, - unexpectedBetweenElementsAndRightParen, - rightParen, - unexpectedAfterRightParen + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndElements), + Syntax(elements), + Syntax(unexpectedBetweenElementsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftParen?.raw, @@ -1503,21 +1503,21 @@ public struct TupleTypeElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeInoutKeyword, - inoutKeyword, - unexpectedBetweenInoutKeywordAndFirstName, - firstName, - unexpectedBetweenFirstNameAndSecondName, - secondName, - unexpectedBetweenSecondNameAndColon, - colon, - unexpectedBetweenColonAndType, - type, - unexpectedBetweenTypeAndEllipsis, - ellipsis, - unexpectedBetweenEllipsisAndTrailingComma, - trailingComma, - unexpectedAfterTrailingComma + Syntax(unexpectedBeforeInoutKeyword), + Syntax(inoutKeyword), + Syntax(unexpectedBetweenInoutKeywordAndFirstName), + Syntax(firstName), + Syntax(unexpectedBetweenFirstNameAndSecondName), + Syntax(secondName), + Syntax(unexpectedBetweenSecondNameAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndType), + Syntax(type), + Syntax(unexpectedBetweenTypeAndEllipsis), + Syntax(ellipsis), + Syntax(unexpectedBetweenEllipsisAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeInoutKeyword?.raw, @@ -1777,13 +1777,13 @@ public struct TupleTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSynt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeftParen, - leftParen, - unexpectedBetweenLeftParenAndElements, - elements, - unexpectedBetweenElementsAndRightParen, - rightParen, - unexpectedAfterRightParen + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndElements), + Syntax(elements), + Syntax(unexpectedBetweenElementsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftParen?.raw, @@ -1972,21 +1972,21 @@ public struct TypeAliasDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAttributes, - attributes, - unexpectedBetweenAttributesAndModifiers, - modifiers, - unexpectedBetweenModifiersAndTypealiasKeyword, - typealiasKeyword, - unexpectedBetweenTypealiasKeywordAndName, - name, - unexpectedBetweenNameAndGenericParameterClause, - genericParameterClause, - unexpectedBetweenGenericParameterClauseAndInitializer, - initializer, - unexpectedBetweenInitializerAndGenericWhereClause, - genericWhereClause, - unexpectedAfterGenericWhereClause + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndTypealiasKeyword), + Syntax(typealiasKeyword), + Syntax(unexpectedBetweenTypealiasKeywordAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndGenericParameterClause), + Syntax(genericParameterClause), + Syntax(unexpectedBetweenGenericParameterClauseAndInitializer), + Syntax(initializer), + Syntax(unexpectedBetweenInitializerAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedAfterGenericWhereClause) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, @@ -2291,11 +2291,11 @@ public struct TypeAnnotationSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeColon, - colon, - unexpectedBetweenColonAndType, - type, - unexpectedAfterType + Syntax(unexpectedBeforeColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndType), + Syntax(type), + Syntax(unexpectedAfterType) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeColon?.raw, @@ -2422,11 +2422,11 @@ public struct TypeEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashable, _LeafS // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAsyncSpecifier, - asyncSpecifier, - unexpectedBetweenAsyncSpecifierAndThrowsClause, - throwsClause, - unexpectedAfterThrowsClause + Syntax(unexpectedBeforeAsyncSpecifier), + Syntax(asyncSpecifier), + Syntax(unexpectedBetweenAsyncSpecifierAndThrowsClause), + Syntax(throwsClause), + Syntax(unexpectedAfterThrowsClause) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAsyncSpecifier?.raw, @@ -2541,7 +2541,7 @@ public struct TypeExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynta ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforeType, type, unexpectedAfterType))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeType), Syntax(type), Syntax(unexpectedAfterType)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforeType?.raw, type.raw, unexpectedAfterType?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.typeExpr, @@ -2624,11 +2624,11 @@ public struct TypeInitializerClauseSyntax: SyntaxProtocol, SyntaxHashable, _Leaf // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeEqual, - equal, - unexpectedBetweenEqualAndValue, - value, - unexpectedAfterValue + Syntax(unexpectedBeforeEqual), + Syntax(equal), + Syntax(unexpectedBetweenEqualAndValue), + Syntax(value), + Syntax(unexpectedAfterValue) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeEqual?.raw, @@ -2755,13 +2755,13 @@ public struct UnavailableFromAsyncAttributeArgumentsSyntax: SyntaxProtocol, Synt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeMessageLabel, - messageLabel, - unexpectedBetweenMessageLabelAndColon, - colon, - unexpectedBetweenColonAndMessage, - message, - unexpectedAfterMessage + Syntax(unexpectedBeforeMessageLabel), + Syntax(messageLabel), + Syntax(unexpectedBetweenMessageLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndMessage), + Syntax(message), + Syntax(unexpectedAfterMessage) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeMessageLabel?.raw, @@ -2915,13 +2915,13 @@ public struct UnderscorePrivateAttributeArgumentsSyntax: SyntaxProtocol, SyntaxH // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeSourceFileLabel, - sourceFileLabel, - unexpectedBetweenSourceFileLabelAndColon, - colon, - unexpectedBetweenColonAndFilename, - filename, - unexpectedAfterFilename + Syntax(unexpectedBeforeSourceFileLabel), + Syntax(sourceFileLabel), + Syntax(unexpectedBetweenSourceFileLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndFilename), + Syntax(filename), + Syntax(unexpectedAfterFilename) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeSourceFileLabel?.raw, @@ -3071,11 +3071,11 @@ public struct UnresolvedAsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAsKeyword, - asKeyword, - unexpectedBetweenAsKeywordAndQuestionOrExclamationMark, - questionOrExclamationMark, - unexpectedAfterQuestionOrExclamationMark + Syntax(unexpectedBeforeAsKeyword), + Syntax(asKeyword), + Syntax(unexpectedBetweenAsKeywordAndQuestionOrExclamationMark), + Syntax(questionOrExclamationMark), + Syntax(unexpectedAfterQuestionOrExclamationMark) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAsKeyword?.raw, @@ -3199,7 +3199,7 @@ public struct UnresolvedIsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforeIsKeyword, isKeyword, unexpectedAfterIsKeyword))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeIsKeyword), Syntax(isKeyword), Syntax(unexpectedAfterIsKeyword)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforeIsKeyword?.raw, isKeyword.raw, unexpectedAfterIsKeyword?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.unresolvedIsExpr, @@ -3289,13 +3289,13 @@ public struct UnresolvedTernaryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _ // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeQuestionMark, - questionMark, - unexpectedBetweenQuestionMarkAndThenExpression, - thenExpression, - unexpectedBetweenThenExpressionAndColon, - colon, - unexpectedAfterColon + Syntax(unexpectedBeforeQuestionMark), + Syntax(questionMark), + Syntax(unexpectedBetweenQuestionMarkAndThenExpression), + Syntax(thenExpression), + Syntax(unexpectedBetweenThenExpressionAndColon), + Syntax(colon), + Syntax(unexpectedAfterColon) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeQuestionMark?.raw, @@ -3440,11 +3440,11 @@ public struct ValueBindingPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeBindingSpecifier, - bindingSpecifier, - unexpectedBetweenBindingSpecifierAndPattern, - pattern, - unexpectedAfterPattern + Syntax(unexpectedBeforeBindingSpecifier), + Syntax(bindingSpecifier), + Syntax(unexpectedBetweenBindingSpecifierAndPattern), + Syntax(pattern), + Syntax(unexpectedAfterPattern) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeBindingSpecifier?.raw, @@ -3583,15 +3583,15 @@ public struct VariableDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeAttributes, - attributes, - unexpectedBetweenAttributesAndModifiers, - modifiers, - unexpectedBetweenModifiersAndBindingSpecifier, - bindingSpecifier, - unexpectedBetweenBindingSpecifierAndBindings, - bindings, - unexpectedAfterBindings + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndBindingSpecifier), + Syntax(bindingSpecifier), + Syntax(unexpectedBetweenBindingSpecifierAndBindings), + Syntax(bindings), + Syntax(unexpectedAfterBindings) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, @@ -3866,11 +3866,11 @@ public struct VersionComponentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforePeriod, - period, - unexpectedBetweenPeriodAndNumber, - number, - unexpectedAfterNumber + Syntax(unexpectedBeforePeriod), + Syntax(period), + Syntax(unexpectedBetweenPeriodAndNumber), + Syntax(number), + Syntax(unexpectedAfterNumber) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforePeriod?.raw, @@ -4005,11 +4005,11 @@ public struct VersionTupleSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeMajor, - major, - unexpectedBetweenMajorAndComponents, - components, - unexpectedAfterComponents + Syntax(unexpectedBeforeMajor), + Syntax(major), + Syntax(unexpectedBetweenMajorAndComponents), + Syntax(components), + Syntax(unexpectedAfterComponents) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeMajor?.raw, @@ -4163,11 +4163,11 @@ public struct WhereClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeWhereKeyword, - whereKeyword, - unexpectedBetweenWhereKeywordAndCondition, - condition, - unexpectedAfterCondition + Syntax(unexpectedBeforeWhereKeyword), + Syntax(whereKeyword), + Syntax(unexpectedBetweenWhereKeywordAndCondition), + Syntax(condition), + Syntax(unexpectedAfterCondition) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeWhereKeyword?.raw, @@ -4288,13 +4288,13 @@ public struct WhileStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeWhileKeyword, - whileKeyword, - unexpectedBetweenWhileKeywordAndConditions, - conditions, - unexpectedBetweenConditionsAndBody, - body, - unexpectedAfterBody + Syntax(unexpectedBeforeWhileKeyword), + Syntax(whileKeyword), + Syntax(unexpectedBetweenWhileKeywordAndConditions), + Syntax(conditions), + Syntax(unexpectedBetweenConditionsAndBody), + Syntax(body), + Syntax(unexpectedAfterBody) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeWhileKeyword?.raw, @@ -4472,7 +4472,7 @@ public struct WildcardPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _Lea ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (unexpectedBeforeWildcard, wildcard, unexpectedAfterWildcard))) { (arena, _) in + self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeWildcard), Syntax(wildcard), Syntax(unexpectedAfterWildcard)))) { (arena, _) in let layout: [RawSyntax?] = [unexpectedBeforeWildcard?.raw, wildcard.raw, unexpectedAfterWildcard?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.wildcardPattern, @@ -4635,11 +4635,11 @@ public struct YieldStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeYieldKeyword, - yieldKeyword, - unexpectedBetweenYieldKeywordAndYieldedExpressions, - yieldedExpressions, - unexpectedAfterYieldedExpressions + Syntax(unexpectedBeforeYieldKeyword), + Syntax(yieldKeyword), + Syntax(unexpectedBetweenYieldKeywordAndYieldedExpressions), + Syntax(yieldedExpressions), + Syntax(unexpectedAfterYieldedExpressions) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeYieldKeyword?.raw, @@ -4761,11 +4761,11 @@ public struct YieldedExpressionSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeExpression, - expression, - unexpectedBetweenExpressionAndComma, - comma, - unexpectedAfterComma + Syntax(unexpectedBeforeExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndComma), + Syntax(comma), + Syntax(unexpectedAfterComma) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeExpression?.raw, @@ -4890,13 +4890,13 @@ public struct YieldedExpressionsClauseSyntax: SyntaxProtocol, SyntaxHashable, _L // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeLeftParen, - leftParen, - unexpectedBetweenLeftParenAndElements, - elements, - unexpectedBetweenElementsAndRightParen, - rightParen, - unexpectedAfterRightParen + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndElements), + Syntax(elements), + Syntax(unexpectedBetweenElementsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftParen?.raw, From 283f408d0434eaeeddfa282da334fd215f7def6d Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Thu, 1 Aug 2024 14:36:59 -0700 Subject: [PATCH 6/9] Remove children from `withExtendedLifetime` --- .../swiftsyntax/SyntaxNodesFile.swift | 11 +- .../generated/syntaxNodes/SyntaxNodesAB.swift | 224 ++----------- .../generated/syntaxNodes/SyntaxNodesC.swift | 264 ++-------------- .../generated/syntaxNodes/SyntaxNodesD.swift | 226 ++------------ .../generated/syntaxNodes/SyntaxNodesEF.swift | 266 ++-------------- .../syntaxNodes/SyntaxNodesGHI.swift | 246 ++------------- .../syntaxNodes/SyntaxNodesJKLMN.swift | 280 ++--------------- .../generated/syntaxNodes/SyntaxNodesOP.swift | 294 ++---------------- .../syntaxNodes/SyntaxNodesQRS.swift | 242 ++------------ .../syntaxNodes/SyntaxNodesTUVWXYZ.swift | 278 ++--------------- 10 files changed, 234 insertions(+), 2097 deletions(-) diff --git a/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxNodesFile.swift b/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxNodesFile.swift index 6b6b6583f2b..4e51ecaac8c 100644 --- a/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxNodesFile.swift +++ b/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxNodesFile.swift @@ -60,18 +60,11 @@ func syntaxNode(nodesStartingWith: [Character]) -> SourceFileSyntax { \(node.generateInitializerDeclHeader()) """ ) { - let parameters = TupleExprSyntax { - for child in node.children { - LabeledExprSyntax(expression: ExprSyntax("Syntax(\(child.varOrCaseName.backtickedIfNeeded))")) - } - } - let closureSignature = ClosureSignatureSyntax( parameterClause: .parameterClause( ClosureParameterClauseSyntax( parameters: ClosureParameterListSyntax { - ClosureParameterSyntax(firstName: .identifier("arena")) - ClosureParameterSyntax(firstName: .wildcardToken()) + ClosureParameterSyntax(firstName: "arena") } ) ) @@ -94,7 +87,7 @@ func syntaxNode(nodesStartingWith: [Character]) -> SourceFileSyntax { calledExpression: ExprSyntax("withExtendedLifetime"), leftParen: .leftParenToken(), arguments: LabeledExprListSyntax { - LabeledExprSyntax(expression: ExprSyntax("(SyntaxArena(), \(parameters))")) + LabeledExprSyntax(expression: ExprSyntax("SyntaxArena()")) }, rightParen: .rightParenToken(), trailingClosure: ClosureExprSyntax(signature: closureSignature) { diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesAB.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesAB.swift index b8ac4f45f09..064956b730b 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesAB.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesAB.swift @@ -135,15 +135,7 @@ public struct AccessorBlockSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeftBrace), - Syntax(leftBrace), - Syntax(unexpectedBetweenLeftBraceAndAccessors), - Syntax(accessors), - Syntax(unexpectedBetweenAccessorsAndRightBrace), - Syntax(rightBrace), - Syntax(unexpectedAfterRightBrace) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftBrace?.raw, leftBrace.raw, @@ -306,21 +298,7 @@ public struct AccessorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndModifier), - Syntax(modifier), - Syntax(unexpectedBetweenModifierAndAccessorSpecifier), - Syntax(accessorSpecifier), - Syntax(unexpectedBetweenAccessorSpecifierAndParameters), - Syntax(parameters), - Syntax(unexpectedBetweenParametersAndEffectSpecifiers), - Syntax(effectSpecifiers), - Syntax(unexpectedBetweenEffectSpecifiersAndBody), - Syntax(body), - Syntax(unexpectedAfterBody) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, attributes.raw, @@ -578,13 +556,7 @@ public struct AccessorEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashable, _L ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAsyncSpecifier), - Syntax(asyncSpecifier), - Syntax(unexpectedBetweenAsyncSpecifierAndThrowsClause), - Syntax(throwsClause), - Syntax(unexpectedAfterThrowsClause) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAsyncSpecifier?.raw, asyncSpecifier?.raw, @@ -710,15 +682,7 @@ public struct AccessorParametersSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndName), - Syntax(name), - Syntax(unexpectedBetweenNameAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftParen?.raw, leftParen.raw, @@ -887,25 +851,7 @@ public struct ActorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndModifiers), - Syntax(modifiers), - Syntax(unexpectedBetweenModifiersAndActorKeyword), - Syntax(actorKeyword), - Syntax(unexpectedBetweenActorKeywordAndName), - Syntax(name), - Syntax(unexpectedBetweenNameAndGenericParameterClause), - Syntax(genericParameterClause), - Syntax(unexpectedBetweenGenericParameterClauseAndInheritanceClause), - Syntax(inheritanceClause), - Syntax(unexpectedBetweenInheritanceClauseAndGenericWhereClause), - Syntax(genericWhereClause), - Syntax(unexpectedBetweenGenericWhereClauseAndMemberBlock), - Syntax(memberBlock), - Syntax(unexpectedAfterMemberBlock) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, attributes.raw, @@ -1235,13 +1181,7 @@ public struct ArrayElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeExpression), - Syntax(expression), - Syntax(unexpectedBetweenExpressionAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeExpression?.raw, expression.raw, @@ -1362,15 +1302,7 @@ public struct ArrayExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeftSquare), - Syntax(leftSquare), - Syntax(unexpectedBetweenLeftSquareAndElements), - Syntax(elements), - Syntax(unexpectedBetweenElementsAndRightSquare), - Syntax(rightSquare), - Syntax(unexpectedAfterRightSquare) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftSquare?.raw, leftSquare.raw, @@ -1543,15 +1475,7 @@ public struct ArrayTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeftSquare), - Syntax(leftSquare), - Syntax(unexpectedBetweenLeftSquareAndElement), - Syntax(element), - Syntax(unexpectedBetweenElementAndRightSquare), - Syntax(rightSquare), - Syntax(unexpectedAfterRightSquare) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftSquare?.raw, leftSquare.raw, @@ -1704,13 +1628,7 @@ public struct ArrowExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeEffectSpecifiers), - Syntax(effectSpecifiers), - Syntax(unexpectedBetweenEffectSpecifiersAndArrow), - Syntax(arrow), - Syntax(unexpectedAfterArrow) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeEffectSpecifiers?.raw, effectSpecifiers?.raw, @@ -1847,17 +1765,7 @@ public struct AsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeExpression), - Syntax(expression), - Syntax(unexpectedBetweenExpressionAndAsKeyword), - Syntax(asKeyword), - Syntax(unexpectedBetweenAsKeywordAndQuestionOrExclamationMark), - Syntax(questionOrExclamationMark), - Syntax(unexpectedBetweenQuestionOrExclamationMarkAndType), - Syntax(type), - Syntax(unexpectedAfterType) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeExpression?.raw, expression.raw, @@ -2023,7 +1931,7 @@ public struct AssignmentExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExp ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeEqual), Syntax(equal), Syntax(unexpectedAfterEqual)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforeEqual?.raw, equal.raw, unexpectedAfterEqual?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.assignmentExpr, @@ -2151,23 +2059,7 @@ public struct AssociatedTypeDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndModifiers), - Syntax(modifiers), - Syntax(unexpectedBetweenModifiersAndAssociatedtypeKeyword), - Syntax(associatedtypeKeyword), - Syntax(unexpectedBetweenAssociatedtypeKeywordAndName), - Syntax(name), - Syntax(unexpectedBetweenNameAndInheritanceClause), - Syntax(inheritanceClause), - Syntax(unexpectedBetweenInheritanceClauseAndInitializer), - Syntax(initializer), - Syntax(unexpectedBetweenInitializerAndGenericWhereClause), - Syntax(genericWhereClause), - Syntax(unexpectedAfterGenericWhereClause) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, attributes.raw, @@ -3187,19 +3079,7 @@ public struct AttributeSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodePr ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAtSign), - Syntax(atSign), - Syntax(unexpectedBetweenAtSignAndAttributeName), - Syntax(attributeName), - Syntax(unexpectedBetweenAttributeNameAndLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndArguments), - Syntax(arguments), - Syntax(unexpectedBetweenArgumentsAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAtSign?.raw, atSign.raw, @@ -3410,15 +3290,7 @@ public struct AttributedTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeSpecifiers), - Syntax(specifiers), - Syntax(unexpectedBetweenSpecifiersAndAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndBaseType), - Syntax(baseType), - Syntax(unexpectedAfterBaseType) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeSpecifiers?.raw, specifiers.raw, @@ -3735,13 +3607,7 @@ public struct AvailabilityArgumentSyntax: SyntaxProtocol, SyntaxHashable, _LeafS ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeArgument), - Syntax(argument), - Syntax(unexpectedBetweenArgumentAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeArgument?.raw, argument.raw, @@ -3870,17 +3736,7 @@ public struct AvailabilityConditionSyntax: SyntaxProtocol, SyntaxHashable, _Leaf ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAvailabilityKeyword), - Syntax(availabilityKeyword), - Syntax(unexpectedBetweenAvailabilityKeywordAndLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndAvailabilityArguments), - Syntax(availabilityArguments), - Syntax(unexpectedBetweenAvailabilityArgumentsAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAvailabilityKeyword?.raw, availabilityKeyword.raw, @@ -4173,15 +4029,7 @@ public struct AvailabilityLabeledArgumentSyntax: SyntaxProtocol, SyntaxHashable, ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLabel), - Syntax(label), - Syntax(unexpectedBetweenLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndValue), - Syntax(value), - Syntax(unexpectedAfterValue) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLabel?.raw, label.raw, @@ -4334,13 +4182,7 @@ public struct AwaitExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAwaitKeyword), - Syntax(awaitKeyword), - Syntax(unexpectedBetweenAwaitKeywordAndExpression), - Syntax(expression), - Syntax(unexpectedAfterExpression) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAwaitKeyword?.raw, awaitKeyword.raw, @@ -4468,15 +4310,7 @@ public struct BackDeployedAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashab ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeBeforeLabel), - Syntax(beforeLabel), - Syntax(unexpectedBetweenBeforeLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndPlatforms), - Syntax(platforms), - Syntax(unexpectedAfterPlatforms) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeBeforeLabel?.raw, beforeLabel.raw, @@ -4654,7 +4488,7 @@ public struct BinaryOperatorExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeOperator), Syntax(`operator`), Syntax(unexpectedAfterOperator)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforeOperator?.raw, `operator`.raw, unexpectedAfterOperator?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.binaryOperatorExpr, @@ -4731,7 +4565,7 @@ public struct BooleanLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeLiteral), Syntax(literal), Syntax(unexpectedAfterLiteral)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforeLiteral?.raw, literal.raw, unexpectedAfterLiteral?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.booleanLiteralExpr, @@ -4813,13 +4647,7 @@ public struct BorrowExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyn ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeBorrowKeyword), - Syntax(borrowKeyword), - Syntax(unexpectedBetweenBorrowKeywordAndExpression), - Syntax(expression), - Syntax(unexpectedAfterExpression) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeBorrowKeyword?.raw, borrowKeyword.raw, @@ -4935,13 +4763,7 @@ public struct BreakStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeBreakKeyword), - Syntax(breakKeyword), - Syntax(unexpectedBetweenBreakKeywordAndLabel), - Syntax(label), - Syntax(unexpectedAfterLabel) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeBreakKeyword?.raw, breakKeyword.raw, diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesC.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesC.swift index f74376046bf..5916ccef018 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesC.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesC.swift @@ -52,19 +52,7 @@ public struct _CanImportExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExp ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeCanImportKeyword), - Syntax(canImportKeyword), - Syntax(unexpectedBetweenCanImportKeywordAndLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndImportPath), - Syntax(importPath), - Syntax(unexpectedBetweenImportPathAndVersionInfo), - Syntax(versionInfo), - Syntax(unexpectedBetweenVersionInfoAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeCanImportKeyword?.raw, canImportKeyword.raw, @@ -271,17 +259,7 @@ public struct _CanImportVersionInfoSyntax: ExprSyntaxProtocol, SyntaxHashable, _ ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeComma), - Syntax(comma), - Syntax(unexpectedBetweenCommaAndLabel), - Syntax(label), - Syntax(unexpectedBetweenLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndVersion), - Syntax(version), - Syntax(unexpectedAfterVersion) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeComma?.raw, comma.raw, @@ -460,15 +438,7 @@ public struct CatchClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeCatchKeyword), - Syntax(catchKeyword), - Syntax(unexpectedBetweenCatchKeywordAndCatchItems), - Syntax(catchItems), - Syntax(unexpectedBetweenCatchItemsAndBody), - Syntax(body), - Syntax(unexpectedAfterBody) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeCatchKeyword?.raw, catchKeyword.raw, @@ -642,15 +612,7 @@ public struct CatchItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodePr ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforePattern), - Syntax(pattern), - Syntax(unexpectedBetweenPatternAndWhereClause), - Syntax(whereClause), - Syntax(unexpectedBetweenWhereClauseAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforePattern?.raw, pattern?.raw, @@ -840,25 +802,7 @@ public struct ClassDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndModifiers), - Syntax(modifiers), - Syntax(unexpectedBetweenModifiersAndClassKeyword), - Syntax(classKeyword), - Syntax(unexpectedBetweenClassKeywordAndName), - Syntax(name), - Syntax(unexpectedBetweenNameAndGenericParameterClause), - Syntax(genericParameterClause), - Syntax(unexpectedBetweenGenericParameterClauseAndInheritanceClause), - Syntax(inheritanceClause), - Syntax(unexpectedBetweenInheritanceClauseAndGenericWhereClause), - Syntax(genericWhereClause), - Syntax(unexpectedBetweenGenericWhereClauseAndMemberBlock), - Syntax(memberBlock), - Syntax(unexpectedAfterMemberBlock) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, attributes.raw, @@ -1182,7 +1126,7 @@ public struct ClassRestrictionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _L ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeClassKeyword), Syntax(classKeyword), Syntax(unexpectedAfterClassKeyword)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforeClassKeyword?.raw, classKeyword.raw, unexpectedAfterClassKeyword?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.classRestrictionType, @@ -1269,15 +1213,7 @@ public struct ClosureCaptureClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafS ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeftSquare), - Syntax(leftSquare), - Syntax(unexpectedBetweenLeftSquareAndItems), - Syntax(items), - Syntax(unexpectedBetweenItemsAndRightSquare), - Syntax(rightSquare), - Syntax(unexpectedAfterRightSquare) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftSquare?.raw, leftSquare.raw, @@ -1457,17 +1393,7 @@ public struct ClosureCaptureSpecifierSyntax: SyntaxProtocol, SyntaxHashable, _Le ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeSpecifier), - Syntax(specifier), - Syntax(unexpectedBetweenSpecifierAndLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndDetail), - Syntax(detail), - Syntax(unexpectedBetweenDetailAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeSpecifier?.raw, specifier.raw, @@ -1657,19 +1583,7 @@ public struct ClosureCaptureSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeSpecifier), - Syntax(specifier), - Syntax(unexpectedBetweenSpecifierAndName), - Syntax(name), - Syntax(unexpectedBetweenNameAndEqual), - Syntax(equal), - Syntax(unexpectedBetweenEqualAndExpression), - Syntax(expression), - Syntax(unexpectedBetweenExpressionAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeSpecifier?.raw, specifier?.raw, @@ -1877,17 +1791,7 @@ public struct ClosureExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeftBrace), - Syntax(leftBrace), - Syntax(unexpectedBetweenLeftBraceAndSignature), - Syntax(signature), - Syntax(unexpectedBetweenSignatureAndStatements), - Syntax(statements), - Syntax(unexpectedBetweenStatementsAndRightBrace), - Syntax(rightBrace), - Syntax(unexpectedAfterRightBrace) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftBrace?.raw, leftBrace.raw, @@ -2091,15 +1995,7 @@ public struct ClosureParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Lea ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndParameters), - Syntax(parameters), - Syntax(unexpectedBetweenParametersAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftParen?.raw, leftParen.raw, @@ -2302,25 +2198,7 @@ public struct ClosureParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndModifiers), - Syntax(modifiers), - Syntax(unexpectedBetweenModifiersAndFirstName), - Syntax(firstName), - Syntax(unexpectedBetweenFirstNameAndSecondName), - Syntax(secondName), - Syntax(unexpectedBetweenSecondNameAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndType), - Syntax(type), - Syntax(unexpectedBetweenTypeAndEllipsis), - Syntax(ellipsis), - Syntax(unexpectedBetweenEllipsisAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, attributes.raw, @@ -2665,13 +2543,7 @@ public struct ClosureShorthandParameterSyntax: SyntaxProtocol, SyntaxHashable, _ ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeName), - Syntax(name), - Syntax(unexpectedBetweenNameAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeName?.raw, name.raw, @@ -2890,21 +2762,7 @@ public struct ClosureSignatureSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndCapture), - Syntax(capture), - Syntax(unexpectedBetweenCaptureAndParameterClause), - Syntax(parameterClause), - Syntax(unexpectedBetweenParameterClauseAndEffectSpecifiers), - Syntax(effectSpecifiers), - Syntax(unexpectedBetweenEffectSpecifiersAndReturnClause), - Syntax(returnClause), - Syntax(unexpectedBetweenReturnClauseAndInKeyword), - Syntax(inKeyword), - Syntax(unexpectedAfterInKeyword) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, attributes.raw, @@ -3266,13 +3124,7 @@ public struct CodeBlockItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeItem), - Syntax(item), - Syntax(unexpectedBetweenItemAndSemicolon), - Syntax(semicolon), - Syntax(unexpectedAfterSemicolon) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeItem?.raw, item.raw, @@ -3412,15 +3264,7 @@ public struct CodeBlockSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodePr ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeftBrace), - Syntax(leftBrace), - Syntax(unexpectedBetweenLeftBraceAndStatements), - Syntax(statements), - Syntax(unexpectedBetweenStatementsAndRightBrace), - Syntax(rightBrace), - Syntax(unexpectedAfterRightBrace) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftBrace?.raw, leftBrace.raw, @@ -3598,13 +3442,7 @@ public struct CompositionTypeElementSyntax: SyntaxProtocol, SyntaxHashable, _Lea ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeType), - Syntax(type), - Syntax(unexpectedBetweenTypeAndAmpersand), - Syntax(ampersand), - Syntax(unexpectedAfterAmpersand) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeType?.raw, type.raw, @@ -3714,7 +3552,7 @@ public struct CompositionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTy ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeElements), Syntax(elements), Syntax(unexpectedAfterElements)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforeElements?.raw, elements.raw, unexpectedAfterElements?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.compositionType, @@ -3975,13 +3813,7 @@ public struct ConditionElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeCondition), - Syntax(condition), - Syntax(unexpectedBetweenConditionAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeCondition?.raw, condition.raw, @@ -4104,15 +3936,7 @@ public struct ConformanceRequirementSyntax: SyntaxProtocol, SyntaxHashable, _Lea ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeftType), - Syntax(leftType), - Syntax(unexpectedBetweenLeftTypeAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndRightType), - Syntax(rightType), - Syntax(unexpectedAfterRightType) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftType?.raw, leftType.raw, @@ -4252,13 +4076,7 @@ public struct ConsumeExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeConsumeKeyword), - Syntax(consumeKeyword), - Syntax(unexpectedBetweenConsumeKeywordAndExpression), - Syntax(expression), - Syntax(unexpectedAfterExpression) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeConsumeKeyword?.raw, consumeKeyword.raw, @@ -4376,13 +4194,7 @@ public struct ContinueStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtS ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeContinueKeyword), - Syntax(continueKeyword), - Syntax(unexpectedBetweenContinueKeywordAndLabel), - Syntax(label), - Syntax(unexpectedAfterLabel) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeContinueKeyword?.raw, continueKeyword.raw, @@ -4517,19 +4329,7 @@ public struct ConventionAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeConventionLabel), - Syntax(conventionLabel), - Syntax(unexpectedBetweenConventionLabelAndComma), - Syntax(comma), - Syntax(unexpectedBetweenCommaAndCTypeLabel), - Syntax(cTypeLabel), - Syntax(unexpectedBetweenCTypeLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndCTypeString), - Syntax(cTypeString), - Syntax(unexpectedAfterCTypeString) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeConventionLabel?.raw, conventionLabel.raw, @@ -4740,15 +4540,7 @@ public struct ConventionWitnessMethodAttributeArgumentsSyntax: SyntaxProtocol, S ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeWitnessMethodLabel), - Syntax(witnessMethodLabel), - Syntax(unexpectedBetweenWitnessMethodLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndProtocolName), - Syntax(protocolName), - Syntax(unexpectedAfterProtocolName) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeWitnessMethodLabel?.raw, witnessMethodLabel.raw, @@ -4900,13 +4692,7 @@ public struct CopyExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynta ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeCopyKeyword), - Syntax(copyKeyword), - Syntax(unexpectedBetweenCopyKeywordAndExpression), - Syntax(expression), - Syntax(unexpectedAfterExpression) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeCopyKeyword?.raw, copyKeyword.raw, diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift index bbd7eca81bb..0b5d35fcff5 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift @@ -50,15 +50,7 @@ public struct DeclModifierDetailSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndDetail), - Syntax(detail), - Syntax(unexpectedBetweenDetailAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftParen?.raw, leftParen.raw, @@ -209,13 +201,7 @@ public struct DeclModifierSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeName), - Syntax(name), - Syntax(unexpectedBetweenNameAndDetail), - Syntax(detail), - Syntax(unexpectedAfterDetail) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeName?.raw, name.raw, @@ -371,13 +357,7 @@ public struct DeclNameArgumentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeName), - Syntax(name), - Syntax(unexpectedBetweenNameAndColon), - Syntax(colon), - Syntax(unexpectedAfterColon) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeName?.raw, name.raw, @@ -500,15 +480,7 @@ public struct DeclNameArgumentsSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndArguments), - Syntax(arguments), - Syntax(unexpectedBetweenArgumentsAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftParen?.raw, leftParen.raw, @@ -686,13 +658,7 @@ public struct DeclReferenceExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeBaseName), - Syntax(baseName), - Syntax(unexpectedBetweenBaseNameAndArgumentNames), - Syntax(argumentNames), - Syntax(unexpectedAfterArgumentNames) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeBaseName?.raw, baseName.raw, @@ -817,13 +783,7 @@ public struct DeferStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeDeferKeyword), - Syntax(deferKeyword), - Syntax(unexpectedBetweenDeferKeywordAndBody), - Syntax(body), - Syntax(unexpectedAfterBody) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeDeferKeyword?.raw, deferKeyword.raw, @@ -961,19 +921,7 @@ public struct DeinitializerDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Leaf ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndModifiers), - Syntax(modifiers), - Syntax(unexpectedBetweenModifiersAndDeinitKeyword), - Syntax(deinitKeyword), - Syntax(unexpectedBetweenDeinitKeywordAndEffectSpecifiers), - Syntax(effectSpecifiers), - Syntax(unexpectedBetweenEffectSpecifiersAndBody), - Syntax(body), - Syntax(unexpectedAfterBody) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, attributes.raw, @@ -1222,7 +1170,7 @@ public struct DeinitializerEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashabl ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeAsyncSpecifier), Syntax(asyncSpecifier), Syntax(unexpectedAfterAsyncSpecifier)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforeAsyncSpecifier?.raw, asyncSpecifier?.raw, unexpectedAfterAsyncSpecifier?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.deinitializerEffectSpecifiers, @@ -1330,23 +1278,7 @@ public struct DerivativeAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeOfLabel), - Syntax(ofLabel), - Syntax(unexpectedBetweenOfLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndOriginalDeclName), - Syntax(originalDeclName), - Syntax(unexpectedBetweenOriginalDeclNameAndPeriod), - Syntax(period), - Syntax(unexpectedBetweenPeriodAndAccessorSpecifier), - Syntax(accessorSpecifier), - Syntax(unexpectedBetweenAccessorSpecifierAndComma), - Syntax(comma), - Syntax(unexpectedBetweenCommaAndArguments), - Syntax(arguments), - Syntax(unexpectedAfterArguments) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeOfLabel?.raw, ofLabel.raw, @@ -1609,13 +1541,7 @@ public struct DesignatedTypeSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeadingComma), - Syntax(leadingComma), - Syntax(unexpectedBetweenLeadingCommaAndName), - Syntax(name), - Syntax(unexpectedAfterName) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeadingComma?.raw, leadingComma.raw, @@ -1743,17 +1669,7 @@ public struct DictionaryElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeKey), - Syntax(key), - Syntax(unexpectedBetweenKeyAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndValue), - Syntax(value), - Syntax(unexpectedBetweenValueAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeKey?.raw, key.raw, @@ -2007,15 +1923,7 @@ public struct DictionaryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExp ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeftSquare), - Syntax(leftSquare), - Syntax(unexpectedBetweenLeftSquareAndContent), - Syntax(content), - Syntax(unexpectedBetweenContentAndRightSquare), - Syntax(rightSquare), - Syntax(unexpectedAfterRightSquare) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftSquare?.raw, leftSquare.raw, @@ -2167,19 +2075,7 @@ public struct DictionaryTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeftSquare), - Syntax(leftSquare), - Syntax(unexpectedBetweenLeftSquareAndKey), - Syntax(key), - Syntax(unexpectedBetweenKeyAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndValue), - Syntax(value), - Syntax(unexpectedBetweenValueAndRightSquare), - Syntax(rightSquare), - Syntax(unexpectedAfterRightSquare) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftSquare?.raw, leftSquare.raw, @@ -2380,13 +2276,7 @@ public struct DifferentiabilityArgumentSyntax: SyntaxProtocol, SyntaxHashable, _ ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeArgument), - Syntax(argument), - Syntax(unexpectedBetweenArgumentAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeArgument?.raw, argument.raw, @@ -2518,15 +2408,7 @@ public struct DifferentiabilityArgumentsSyntax: SyntaxProtocol, SyntaxHashable, ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndArguments), - Syntax(arguments), - Syntax(unexpectedBetweenArgumentsAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftParen?.raw, leftParen.raw, @@ -2791,15 +2673,7 @@ public struct DifferentiabilityWithRespectToArgumentSyntax: SyntaxProtocol, Synt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeWrtLabel), - Syntax(wrtLabel), - Syntax(unexpectedBetweenWrtLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndArguments), - Syntax(arguments), - Syntax(unexpectedAfterArguments) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeWrtLabel?.raw, wrtLabel.raw, @@ -2966,19 +2840,7 @@ public struct DifferentiableAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHash ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeKindSpecifier), - Syntax(kindSpecifier), - Syntax(unexpectedBetweenKindSpecifierAndKindSpecifierComma), - Syntax(kindSpecifierComma), - Syntax(unexpectedBetweenKindSpecifierCommaAndArguments), - Syntax(arguments), - Syntax(unexpectedBetweenArgumentsAndArgumentsComma), - Syntax(argumentsComma), - Syntax(unexpectedBetweenArgumentsCommaAndGenericWhereClause), - Syntax(genericWhereClause), - Syntax(unexpectedAfterGenericWhereClause) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeKindSpecifier?.raw, kindSpecifier?.raw, @@ -3193,7 +3055,7 @@ public struct DiscardAssignmentExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _ ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeWildcard), Syntax(wildcard), Syntax(unexpectedAfterWildcard)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforeWildcard?.raw, wildcard.raw, unexpectedAfterWildcard?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.discardAssignmentExpr, @@ -3273,13 +3135,7 @@ public struct DiscardStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSy ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeDiscardKeyword), - Syntax(discardKeyword), - Syntax(unexpectedBetweenDiscardKeywordAndExpression), - Syntax(expression), - Syntax(unexpectedAfterExpression) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeDiscardKeyword?.raw, discardKeyword.raw, @@ -3425,15 +3281,7 @@ public struct DoExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeDoKeyword), - Syntax(doKeyword), - Syntax(unexpectedBetweenDoKeywordAndBody), - Syntax(body), - Syntax(unexpectedBetweenBodyAndCatchClauses), - Syntax(catchClauses), - Syntax(unexpectedAfterCatchClauses) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeDoKeyword?.raw, doKeyword.raw, @@ -3607,17 +3455,7 @@ public struct DoStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntaxN ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeDoKeyword), - Syntax(doKeyword), - Syntax(unexpectedBetweenDoKeywordAndThrowsClause), - Syntax(throwsClause), - Syntax(unexpectedBetweenThrowsClauseAndBody), - Syntax(body), - Syntax(unexpectedBetweenBodyAndCatchClauses), - Syntax(catchClauses), - Syntax(unexpectedAfterCatchClauses) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeDoKeyword?.raw, doKeyword.raw, @@ -3902,17 +3740,7 @@ public struct DocumentationAttributeArgumentSyntax: SyntaxProtocol, SyntaxHashab ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLabel), - Syntax(label), - Syntax(unexpectedBetweenLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndValue), - Syntax(value), - Syntax(unexpectedBetweenValueAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLabel?.raw, label.raw, @@ -4095,15 +3923,7 @@ public struct DynamicReplacementAttributeArgumentsSyntax: SyntaxProtocol, Syntax ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeForLabel), - Syntax(forLabel), - Syntax(unexpectedBetweenForLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndDeclName), - Syntax(declName), - Syntax(unexpectedAfterDeclName) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeForLabel?.raw, forLabel.raw, diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesEF.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesEF.swift index c1e47c8aa2a..0b535f2fbf7 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesEF.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesEF.swift @@ -53,15 +53,7 @@ public struct EditorPlaceholderDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _ ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndModifiers), - Syntax(modifiers), - Syntax(unexpectedBetweenModifiersAndPlaceholder), - Syntax(placeholder), - Syntax(unexpectedAfterPlaceholder) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, attributes.raw, @@ -258,7 +250,7 @@ public struct EditorPlaceholderExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _ ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforePlaceholder?.raw, placeholder.raw, unexpectedAfterPlaceholder?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.editorPlaceholderExpr, @@ -350,17 +342,7 @@ public struct EnumCaseDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndModifiers), - Syntax(modifiers), - Syntax(unexpectedBetweenModifiersAndCaseKeyword), - Syntax(caseKeyword), - Syntax(unexpectedBetweenCaseKeywordAndElements), - Syntax(elements), - Syntax(unexpectedAfterElements) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, attributes.raw, @@ -626,17 +608,7 @@ public struct EnumCaseElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeName), - Syntax(name), - Syntax(unexpectedBetweenNameAndParameterClause), - Syntax(parameterClause), - Syntax(unexpectedBetweenParameterClauseAndRawValue), - Syntax(rawValue), - Syntax(unexpectedBetweenRawValueAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeName?.raw, name.raw, @@ -819,15 +791,7 @@ public struct EnumCaseParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Le ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndParameters), - Syntax(parameters), - Syntax(unexpectedBetweenParametersAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftParen?.raw, leftParen.raw, @@ -1025,23 +989,7 @@ public struct EnumCaseParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeModifiers), - Syntax(modifiers), - Syntax(unexpectedBetweenModifiersAndFirstName), - Syntax(firstName), - Syntax(unexpectedBetweenFirstNameAndSecondName), - Syntax(secondName), - Syntax(unexpectedBetweenSecondNameAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndType), - Syntax(type), - Syntax(unexpectedBetweenTypeAndDefaultValue), - Syntax(defaultValue), - Syntax(unexpectedBetweenDefaultValueAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeModifiers?.raw, modifiers.raw, @@ -1351,25 +1299,7 @@ public struct EnumDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynta ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndModifiers), - Syntax(modifiers), - Syntax(unexpectedBetweenModifiersAndEnumKeyword), - Syntax(enumKeyword), - Syntax(unexpectedBetweenEnumKeywordAndName), - Syntax(name), - Syntax(unexpectedBetweenNameAndGenericParameterClause), - Syntax(genericParameterClause), - Syntax(unexpectedBetweenGenericParameterClauseAndInheritanceClause), - Syntax(inheritanceClause), - Syntax(unexpectedBetweenInheritanceClauseAndGenericWhereClause), - Syntax(genericWhereClause), - Syntax(unexpectedBetweenGenericWhereClauseAndMemberBlock), - Syntax(memberBlock), - Syntax(unexpectedAfterMemberBlock) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, attributes.raw, @@ -1705,15 +1635,7 @@ public struct ExposeAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable, _L ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLanguage), - Syntax(language), - Syntax(unexpectedBetweenLanguageAndComma), - Syntax(comma), - Syntax(unexpectedBetweenCommaAndCxxName), - Syntax(cxxName), - Syntax(unexpectedAfterCxxName) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLanguage?.raw, language.raw, @@ -1864,7 +1786,7 @@ public struct ExpressionPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _L ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeExpression), Syntax(expression), Syntax(unexpectedAfterExpression)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforeExpression?.raw, expression.raw, unexpectedAfterExpression?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.expressionPattern, @@ -1958,19 +1880,7 @@ public struct ExpressionSegmentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeBackslash), - Syntax(backslash), - Syntax(unexpectedBetweenBackslashAndPounds), - Syntax(pounds), - Syntax(unexpectedBetweenPoundsAndLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndExpressions), - Syntax(expressions), - Syntax(unexpectedBetweenExpressionsAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeBackslash?.raw, backslash.raw, @@ -2191,7 +2101,7 @@ public struct ExpressionStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStm ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeExpression), Syntax(expression), Syntax(unexpectedAfterExpression)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforeExpression?.raw, expression.raw, unexpectedAfterExpression?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.expressionStmt, @@ -2302,23 +2212,7 @@ public struct ExtensionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndModifiers), - Syntax(modifiers), - Syntax(unexpectedBetweenModifiersAndExtensionKeyword), - Syntax(extensionKeyword), - Syntax(unexpectedBetweenExtensionKeywordAndExtendedType), - Syntax(extendedType), - Syntax(unexpectedBetweenExtendedTypeAndInheritanceClause), - Syntax(inheritanceClause), - Syntax(unexpectedBetweenInheritanceClauseAndGenericWhereClause), - Syntax(genericWhereClause), - Syntax(unexpectedBetweenGenericWhereClauseAndMemberBlock), - Syntax(memberBlock), - Syntax(unexpectedAfterMemberBlock) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, attributes.raw, @@ -2621,7 +2515,7 @@ public struct FallThroughStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafSt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeFallthroughKeyword), Syntax(fallthroughKeyword), Syntax(unexpectedAfterFallthroughKeyword)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforeFallthroughKeyword?.raw, fallthroughKeyword.raw, unexpectedAfterFallthroughKeyword?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.fallThroughStmt, @@ -2698,7 +2592,7 @@ public struct FloatLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeLiteral), Syntax(literal), Syntax(unexpectedAfterLiteral)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforeLiteral?.raw, literal.raw, unexpectedAfterLiteral?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.floatLiteralExpr, @@ -2802,29 +2696,7 @@ public struct ForStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntax ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeForKeyword), - Syntax(forKeyword), - Syntax(unexpectedBetweenForKeywordAndTryKeyword), - Syntax(tryKeyword), - Syntax(unexpectedBetweenTryKeywordAndAwaitKeyword), - Syntax(awaitKeyword), - Syntax(unexpectedBetweenAwaitKeywordAndCaseKeyword), - Syntax(caseKeyword), - Syntax(unexpectedBetweenCaseKeywordAndPattern), - Syntax(pattern), - Syntax(unexpectedBetweenPatternAndTypeAnnotation), - Syntax(typeAnnotation), - Syntax(unexpectedBetweenTypeAnnotationAndInKeyword), - Syntax(inKeyword), - Syntax(unexpectedBetweenInKeywordAndSequence), - Syntax(sequence), - Syntax(unexpectedBetweenSequenceAndWhereClause), - Syntax(whereClause), - Syntax(unexpectedBetweenWhereClauseAndBody), - Syntax(body), - Syntax(unexpectedAfterBody) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeForKeyword?.raw, forKeyword.raw, @@ -3144,13 +3016,7 @@ public struct ForceUnwrapExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafEx ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeExpression), - Syntax(expression), - Syntax(unexpectedBetweenExpressionAndExclamationMark), - Syntax(exclamationMark), - Syntax(unexpectedAfterExclamationMark) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeExpression?.raw, expression.raw, @@ -3278,21 +3144,7 @@ public struct FunctionCallExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeCalledExpression), - Syntax(calledExpression), - Syntax(unexpectedBetweenCalledExpressionAndLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndArguments), - Syntax(arguments), - Syntax(unexpectedBetweenArgumentsAndRightParen), - Syntax(rightParen), - Syntax(unexpectedBetweenRightParenAndTrailingClosure), - Syntax(trailingClosure), - Syntax(unexpectedBetweenTrailingClosureAndAdditionalTrailingClosures), - Syntax(additionalTrailingClosures), - Syntax(unexpectedAfterAdditionalTrailingClosures) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeCalledExpression?.raw, calledExpression.raw, @@ -3607,25 +3459,7 @@ public struct FunctionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndModifiers), - Syntax(modifiers), - Syntax(unexpectedBetweenModifiersAndFuncKeyword), - Syntax(funcKeyword), - Syntax(unexpectedBetweenFuncKeywordAndName), - Syntax(name), - Syntax(unexpectedBetweenNameAndGenericParameterClause), - Syntax(genericParameterClause), - Syntax(unexpectedBetweenGenericParameterClauseAndSignature), - Syntax(signature), - Syntax(unexpectedBetweenSignatureAndGenericWhereClause), - Syntax(genericWhereClause), - Syntax(unexpectedBetweenGenericWhereClauseAndBody), - Syntax(body), - Syntax(unexpectedAfterBody) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, attributes.raw, @@ -3962,13 +3796,7 @@ public struct FunctionEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashable, _L ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAsyncSpecifier), - Syntax(asyncSpecifier), - Syntax(unexpectedBetweenAsyncSpecifierAndThrowsClause), - Syntax(throwsClause), - Syntax(unexpectedAfterThrowsClause) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAsyncSpecifier?.raw, asyncSpecifier?.raw, @@ -4097,15 +3925,7 @@ public struct FunctionParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Le ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndParameters), - Syntax(parameters), - Syntax(unexpectedBetweenParametersAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftParen?.raw, leftParen.raw, @@ -4311,27 +4131,7 @@ public struct FunctionParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndModifiers), - Syntax(modifiers), - Syntax(unexpectedBetweenModifiersAndFirstName), - Syntax(firstName), - Syntax(unexpectedBetweenFirstNameAndSecondName), - Syntax(secondName), - Syntax(unexpectedBetweenSecondNameAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndType), - Syntax(type), - Syntax(unexpectedBetweenTypeAndEllipsis), - Syntax(ellipsis), - Syntax(unexpectedBetweenEllipsisAndDefaultValue), - Syntax(defaultValue), - Syntax(unexpectedBetweenDefaultValueAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, attributes.raw, @@ -4713,15 +4513,7 @@ public struct FunctionSignatureSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeParameterClause), - Syntax(parameterClause), - Syntax(unexpectedBetweenParameterClauseAndEffectSpecifiers), - Syntax(effectSpecifiers), - Syntax(unexpectedBetweenEffectSpecifiersAndReturnClause), - Syntax(returnClause), - Syntax(unexpectedAfterReturnClause) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeParameterClause?.raw, parameterClause.raw, @@ -4870,19 +4662,7 @@ public struct FunctionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeS ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndParameters), - Syntax(parameters), - Syntax(unexpectedBetweenParametersAndRightParen), - Syntax(rightParen), - Syntax(unexpectedBetweenRightParenAndEffectSpecifiers), - Syntax(effectSpecifiers), - Syntax(unexpectedBetweenEffectSpecifiersAndReturnClause), - Syntax(returnClause), - Syntax(unexpectedAfterReturnClause) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftParen?.raw, leftParen.raw, diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesGHI.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesGHI.swift index dc5a8d24fe1..269ffd87e7a 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesGHI.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesGHI.swift @@ -55,15 +55,7 @@ public struct GenericArgumentClauseSyntax: SyntaxProtocol, SyntaxHashable, _Leaf ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeftAngle), - Syntax(leftAngle), - Syntax(unexpectedBetweenLeftAngleAndArguments), - Syntax(arguments), - Syntax(unexpectedBetweenArgumentsAndRightAngle), - Syntax(rightAngle), - Syntax(unexpectedAfterRightAngle) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftAngle?.raw, leftAngle.raw, @@ -237,13 +229,7 @@ public struct GenericArgumentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeArgument), - Syntax(argument), - Syntax(unexpectedBetweenArgumentAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeArgument?.raw, argument.raw, @@ -384,17 +370,7 @@ public struct GenericParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Lea ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeftAngle), - Syntax(leftAngle), - Syntax(unexpectedBetweenLeftAngleAndParameters), - Syntax(parameters), - Syntax(unexpectedBetweenParametersAndGenericWhereClause), - Syntax(genericWhereClause), - Syntax(unexpectedBetweenGenericWhereClauseAndRightAngle), - Syntax(rightAngle), - Syntax(unexpectedAfterRightAngle) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftAngle?.raw, leftAngle.raw, @@ -610,21 +586,7 @@ public struct GenericParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndEachKeyword), - Syntax(eachKeyword), - Syntax(unexpectedBetweenEachKeywordAndName), - Syntax(name), - Syntax(unexpectedBetweenNameAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndInheritedType), - Syntax(inheritedType), - Syntax(unexpectedBetweenInheritedTypeAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, attributes.raw, @@ -991,13 +953,7 @@ public struct GenericRequirementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeRequirement), - Syntax(requirement), - Syntax(unexpectedBetweenRequirementAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeRequirement?.raw, requirement.raw, @@ -1113,13 +1069,7 @@ public struct GenericSpecializationExprSyntax: ExprSyntaxProtocol, SyntaxHashabl ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeExpression), - Syntax(expression), - Syntax(unexpectedBetweenExpressionAndGenericArgumentClause), - Syntax(genericArgumentClause), - Syntax(unexpectedAfterGenericArgumentClause) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeExpression?.raw, expression.raw, @@ -1254,13 +1204,7 @@ public struct GenericWhereClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeWhereKeyword), - Syntax(whereKeyword), - Syntax(unexpectedBetweenWhereKeywordAndRequirements), - Syntax(requirements), - Syntax(unexpectedAfterRequirements) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeWhereKeyword?.raw, whereKeyword.raw, @@ -1412,17 +1356,7 @@ public struct GuardStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeGuardKeyword), - Syntax(guardKeyword), - Syntax(unexpectedBetweenGuardKeywordAndConditions), - Syntax(conditions), - Syntax(unexpectedBetweenConditionsAndElseKeyword), - Syntax(elseKeyword), - Syntax(unexpectedBetweenElseKeywordAndBody), - Syntax(body), - Syntax(unexpectedAfterBody) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeGuardKeyword?.raw, guardKeyword.raw, @@ -1624,7 +1558,7 @@ public struct IdentifierPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _L ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeIdentifier), Syntax(identifier), Syntax(unexpectedAfterIdentifier)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforeIdentifier?.raw, identifier.raw, unexpectedAfterIdentifier?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.identifierPattern, @@ -1709,13 +1643,7 @@ public struct IdentifierTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeName), - Syntax(name), - Syntax(unexpectedBetweenNameAndGenericArgumentClause), - Syntax(genericArgumentClause), - Syntax(unexpectedAfterGenericArgumentClause) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeName?.raw, name.raw, @@ -2029,15 +1957,7 @@ public struct IfConfigClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforePoundKeyword), - Syntax(poundKeyword), - Syntax(unexpectedBetweenPoundKeywordAndCondition), - Syntax(condition), - Syntax(unexpectedBetweenConditionAndElements), - Syntax(elements), - Syntax(unexpectedAfterElements) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforePoundKeyword?.raw, poundKeyword.raw, @@ -2186,13 +2106,7 @@ public struct IfConfigDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeClauses), - Syntax(clauses), - Syntax(unexpectedBetweenClausesAndPoundEndif), - Syntax(poundEndif), - Syntax(unexpectedAfterPoundEndif) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeClauses?.raw, clauses.raw, @@ -2430,19 +2344,7 @@ public struct IfExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeIfKeyword), - Syntax(ifKeyword), - Syntax(unexpectedBetweenIfKeywordAndConditions), - Syntax(conditions), - Syntax(unexpectedBetweenConditionsAndBody), - Syntax(body), - Syntax(unexpectedBetweenBodyAndElseKeyword), - Syntax(elseKeyword), - Syntax(unexpectedBetweenElseKeywordAndElseBody), - Syntax(elseBody), - Syntax(unexpectedAfterElseBody) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeIfKeyword?.raw, ifKeyword.raw, @@ -2672,15 +2574,7 @@ public struct ImplementsAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeType), - Syntax(type), - Syntax(unexpectedBetweenTypeAndComma), - Syntax(comma), - Syntax(unexpectedBetweenCommaAndDeclName), - Syntax(declName), - Syntax(unexpectedAfterDeclName) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeType?.raw, type.raw, @@ -2824,13 +2718,7 @@ public struct ImplicitlyUnwrappedOptionalTypeSyntax: TypeSyntaxProtocol, SyntaxH ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeWrappedType), - Syntax(wrappedType), - Syntax(unexpectedBetweenWrappedTypeAndExclamationMark), - Syntax(exclamationMark), - Syntax(unexpectedAfterExclamationMark) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeWrappedType?.raw, wrappedType.raw, @@ -2968,19 +2856,7 @@ public struct ImportDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyn ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndModifiers), - Syntax(modifiers), - Syntax(unexpectedBetweenModifiersAndImportKeyword), - Syntax(importKeyword), - Syntax(unexpectedBetweenImportKeywordAndImportKindSpecifier), - Syntax(importKindSpecifier), - Syntax(unexpectedBetweenImportKindSpecifierAndPath), - Syntax(path), - Syntax(unexpectedAfterPath) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, attributes.raw, @@ -3274,13 +3150,7 @@ public struct ImportPathComponentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeName), - Syntax(name), - Syntax(unexpectedBetweenNameAndTrailingPeriod), - Syntax(trailingPeriod), - Syntax(unexpectedAfterTrailingPeriod) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeName?.raw, name.raw, @@ -3405,13 +3275,7 @@ public struct InOutExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAmpersand), - Syntax(ampersand), - Syntax(unexpectedBetweenAmpersandAndExpression), - Syntax(expression), - Syntax(unexpectedAfterExpression) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAmpersand?.raw, ampersand.raw, @@ -3536,15 +3400,7 @@ public struct InfixOperatorExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeftOperand), - Syntax(leftOperand), - Syntax(unexpectedBetweenLeftOperandAndOperator), - Syntax(`operator`), - Syntax(unexpectedBetweenOperatorAndRightOperand), - Syntax(rightOperand), - Syntax(unexpectedAfterRightOperand) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftOperand?.raw, leftOperand.raw, @@ -3691,13 +3547,7 @@ public struct InheritanceClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndInheritedTypes), - Syntax(inheritedTypes), - Syntax(unexpectedAfterInheritedTypes) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeColon?.raw, colon.raw, @@ -3844,13 +3694,7 @@ public struct InheritedTypeSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeType), - Syntax(type), - Syntax(unexpectedBetweenTypeAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeType?.raw, type.raw, @@ -3976,13 +3820,7 @@ public struct InitializerClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeEqual), - Syntax(equal), - Syntax(unexpectedBetweenEqualAndValue), - Syntax(value), - Syntax(unexpectedAfterValue) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeEqual?.raw, equal.raw, @@ -4135,25 +3973,7 @@ public struct InitializerDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDe ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndModifiers), - Syntax(modifiers), - Syntax(unexpectedBetweenModifiersAndInitKeyword), - Syntax(initKeyword), - Syntax(unexpectedBetweenInitKeywordAndOptionalMark), - Syntax(optionalMark), - Syntax(unexpectedBetweenOptionalMarkAndGenericParameterClause), - Syntax(genericParameterClause), - Syntax(unexpectedBetweenGenericParameterClauseAndSignature), - Syntax(signature), - Syntax(unexpectedBetweenSignatureAndGenericWhereClause), - Syntax(genericWhereClause), - Syntax(unexpectedBetweenGenericWhereClauseAndBody), - Syntax(body), - Syntax(unexpectedAfterBody) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, attributes.raw, @@ -4479,7 +4299,7 @@ public struct IntegerLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeLiteral), Syntax(literal), Syntax(unexpectedAfterLiteral)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforeLiteral?.raw, literal.raw, unexpectedAfterLiteral?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.integerLiteralExpr, @@ -4576,15 +4396,7 @@ public struct IsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeExpression), - Syntax(expression), - Syntax(unexpectedBetweenExpressionAndIsKeyword), - Syntax(isKeyword), - Syntax(unexpectedBetweenIsKeywordAndType), - Syntax(type), - Syntax(unexpectedAfterType) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeExpression?.raw, expression.raw, @@ -4728,13 +4540,7 @@ public struct IsTypePatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _LeafP ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeIsKeyword), - Syntax(isKeyword), - Syntax(unexpectedBetweenIsKeywordAndType), - Syntax(type), - Syntax(unexpectedAfterType) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeIsKeyword?.raw, isKeyword.raw, diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesJKLMN.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesJKLMN.swift index 9931795347a..8fbafefd831 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesJKLMN.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesJKLMN.swift @@ -164,13 +164,7 @@ public struct KeyPathComponentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforePeriod), - Syntax(period), - Syntax(unexpectedBetweenPeriodAndComponent), - Syntax(component), - Syntax(unexpectedAfterComponent) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforePeriod?.raw, period?.raw, @@ -297,15 +291,7 @@ public struct KeyPathExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeBackslash), - Syntax(backslash), - Syntax(unexpectedBetweenBackslashAndRoot), - Syntax(root), - Syntax(unexpectedBetweenRootAndComponents), - Syntax(components), - Syntax(unexpectedAfterComponents) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeBackslash?.raw, backslash.raw, @@ -475,7 +461,7 @@ public struct KeyPathOptionalComponentSyntax: SyntaxProtocol, SyntaxHashable, _L ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeQuestionOrExclamationMark), Syntax(questionOrExclamationMark), Syntax(unexpectedAfterQuestionOrExclamationMark)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforeQuestionOrExclamationMark?.raw, questionOrExclamationMark.raw, unexpectedAfterQuestionOrExclamationMark?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.keyPathOptionalComponent, @@ -563,13 +549,7 @@ public struct KeyPathPropertyComponentSyntax: SyntaxProtocol, SyntaxHashable, _L ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeDeclName), - Syntax(declName), - Syntax(unexpectedBetweenDeclNameAndGenericArgumentClause), - Syntax(genericArgumentClause), - Syntax(unexpectedAfterGenericArgumentClause) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeDeclName?.raw, declName.raw, @@ -691,15 +671,7 @@ public struct KeyPathSubscriptComponentSyntax: SyntaxProtocol, SyntaxHashable, _ ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeftSquare), - Syntax(leftSquare), - Syntax(unexpectedBetweenLeftSquareAndArguments), - Syntax(arguments), - Syntax(unexpectedBetweenArgumentsAndRightSquare), - Syntax(rightSquare), - Syntax(unexpectedAfterRightSquare) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftSquare?.raw, leftSquare.raw, @@ -885,17 +857,7 @@ public struct LabeledExprSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLabel), - Syntax(label), - Syntax(unexpectedBetweenLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndExpression), - Syntax(expression), - Syntax(unexpectedBetweenExpressionAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLabel?.raw, label?.raw, @@ -1083,17 +1045,7 @@ public struct LabeledSpecializeArgumentSyntax: SyntaxProtocol, SyntaxHashable, _ ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLabel), - Syntax(label), - Syntax(unexpectedBetweenLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndValue), - Syntax(value), - Syntax(unexpectedBetweenValueAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLabel?.raw, label.raw, @@ -1279,15 +1231,7 @@ public struct LabeledStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSy ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLabel), - Syntax(label), - Syntax(unexpectedBetweenLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndStatement), - Syntax(statement), - Syntax(unexpectedAfterStatement) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLabel?.raw, label.raw, @@ -1452,25 +1396,7 @@ public struct LayoutRequirementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeType), - Syntax(type), - Syntax(unexpectedBetweenTypeAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndLayoutSpecifier), - Syntax(layoutSpecifier), - Syntax(unexpectedBetweenLayoutSpecifierAndLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndSize), - Syntax(size), - Syntax(unexpectedBetweenSizeAndComma), - Syntax(comma), - Syntax(unexpectedBetweenCommaAndAlignment), - Syntax(alignment), - Syntax(unexpectedBetweenAlignmentAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeType?.raw, type.raw, @@ -1768,13 +1694,7 @@ public struct LifetimeSpecifierArgumentSyntax: SyntaxProtocol, SyntaxHashable, _ ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeParameter), - Syntax(parameter), - Syntax(unexpectedBetweenParameterAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeParameter?.raw, parameter.raw, @@ -1923,19 +1843,7 @@ public struct LifetimeTypeSpecifierSyntax: SyntaxProtocol, SyntaxHashable, _Leaf ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeDependsOnKeyword), - Syntax(dependsOnKeyword), - Syntax(unexpectedBetweenDependsOnKeywordAndLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndScopedKeyword), - Syntax(scopedKeyword), - Syntax(unexpectedBetweenScopedKeywordAndArguments), - Syntax(arguments), - Syntax(unexpectedBetweenArgumentsAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeDependsOnKeyword?.raw, dependsOnKeyword.raw, @@ -2183,25 +2091,7 @@ public struct MacroDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndModifiers), - Syntax(modifiers), - Syntax(unexpectedBetweenModifiersAndMacroKeyword), - Syntax(macroKeyword), - Syntax(unexpectedBetweenMacroKeywordAndName), - Syntax(name), - Syntax(unexpectedBetweenNameAndGenericParameterClause), - Syntax(genericParameterClause), - Syntax(unexpectedBetweenGenericParameterClauseAndSignature), - Syntax(signature), - Syntax(unexpectedBetweenSignatureAndDefinition), - Syntax(definition), - Syntax(unexpectedBetweenDefinitionAndGenericWhereClause), - Syntax(genericWhereClause), - Syntax(unexpectedAfterGenericWhereClause) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, attributes.raw, @@ -2547,29 +2437,7 @@ public struct MacroExpansionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndModifiers), - Syntax(modifiers), - Syntax(unexpectedBetweenModifiersAndPound), - Syntax(pound), - Syntax(unexpectedBetweenPoundAndMacroName), - Syntax(macroName), - Syntax(unexpectedBetweenMacroNameAndGenericArgumentClause), - Syntax(genericArgumentClause), - Syntax(unexpectedBetweenGenericArgumentClauseAndLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndArguments), - Syntax(arguments), - Syntax(unexpectedBetweenArgumentsAndRightParen), - Syntax(rightParen), - Syntax(unexpectedBetweenRightParenAndTrailingClosure), - Syntax(trailingClosure), - Syntax(unexpectedBetweenTrailingClosureAndAdditionalTrailingClosures), - Syntax(additionalTrailingClosures), - Syntax(unexpectedAfterAdditionalTrailingClosures) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, attributes.raw, @@ -3017,25 +2885,7 @@ public struct MacroExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforePound), - Syntax(pound), - Syntax(unexpectedBetweenPoundAndMacroName), - Syntax(macroName), - Syntax(unexpectedBetweenMacroNameAndGenericArgumentClause), - Syntax(genericArgumentClause), - Syntax(unexpectedBetweenGenericArgumentClauseAndLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndArguments), - Syntax(arguments), - Syntax(unexpectedBetweenArgumentsAndRightParen), - Syntax(rightParen), - Syntax(unexpectedBetweenRightParenAndTrailingClosure), - Syntax(trailingClosure), - Syntax(unexpectedBetweenTrailingClosureAndAdditionalTrailingClosures), - Syntax(additionalTrailingClosures), - Syntax(unexpectedAfterAdditionalTrailingClosures) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforePound?.raw, pound.raw, @@ -3370,17 +3220,7 @@ public struct MatchingPatternConditionSyntax: SyntaxProtocol, SyntaxHashable, _L ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeCaseKeyword), - Syntax(caseKeyword), - Syntax(unexpectedBetweenCaseKeywordAndPattern), - Syntax(pattern), - Syntax(unexpectedBetweenPatternAndTypeAnnotation), - Syntax(typeAnnotation), - Syntax(unexpectedBetweenTypeAnnotationAndInitializer), - Syntax(initializer), - Syntax(unexpectedAfterInitializer) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeCaseKeyword?.raw, caseKeyword.raw, @@ -3551,15 +3391,7 @@ public struct MemberAccessExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeBase), - Syntax(base), - Syntax(unexpectedBetweenBaseAndPeriod), - Syntax(period), - Syntax(unexpectedBetweenPeriodAndDeclName), - Syntax(declName), - Syntax(unexpectedAfterDeclName) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeBase?.raw, base?.raw, @@ -3709,13 +3541,7 @@ public struct MemberBlockItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeDecl), - Syntax(decl), - Syntax(unexpectedBetweenDeclAndSemicolon), - Syntax(semicolon), - Syntax(unexpectedAfterSemicolon) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeDecl?.raw, decl.raw, @@ -3846,15 +3672,7 @@ public struct MemberBlockSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeftBrace), - Syntax(leftBrace), - Syntax(unexpectedBetweenLeftBraceAndMembers), - Syntax(members), - Syntax(unexpectedBetweenMembersAndRightBrace), - Syntax(rightBrace), - Syntax(unexpectedAfterRightBrace) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftBrace?.raw, leftBrace.raw, @@ -4030,17 +3848,7 @@ public struct MemberTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSyn ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeBaseType), - Syntax(baseType), - Syntax(unexpectedBetweenBaseTypeAndPeriod), - Syntax(period), - Syntax(unexpectedBetweenPeriodAndName), - Syntax(name), - Syntax(unexpectedBetweenNameAndGenericArgumentClause), - Syntax(genericArgumentClause), - Syntax(unexpectedAfterGenericArgumentClause) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeBaseType?.raw, baseType.raw, @@ -4212,15 +4020,7 @@ public struct MetatypeTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeS ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeBaseType), - Syntax(baseType), - Syntax(unexpectedBetweenBaseTypeAndPeriod), - Syntax(period), - Syntax(unexpectedBetweenPeriodAndMetatypeSpecifier), - Syntax(metatypeSpecifier), - Syntax(unexpectedAfterMetatypeSpecifier) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeBaseType?.raw, baseType.raw, @@ -4373,15 +4173,7 @@ public struct MissingDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSy ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndModifiers), - Syntax(modifiers), - Syntax(unexpectedBetweenModifiersAndPlaceholder), - Syntax(placeholder), - Syntax(unexpectedAfterPlaceholder) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, attributes.raw, @@ -4581,7 +4373,7 @@ public struct MissingExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforePlaceholder?.raw, placeholder.raw, unexpectedAfterPlaceholder?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.missingExpr, @@ -4665,7 +4457,7 @@ public struct MissingPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _Leaf ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforePlaceholder?.raw, placeholder.raw, unexpectedAfterPlaceholder?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.missingPattern, @@ -4749,7 +4541,7 @@ public struct MissingStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSy ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforePlaceholder?.raw, placeholder.raw, unexpectedAfterPlaceholder?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.missingStmt, @@ -4833,7 +4625,7 @@ public struct MissingSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodeProt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforePlaceholder?.raw, placeholder.raw, unexpectedAfterPlaceholder?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.missing, @@ -4917,7 +4709,7 @@ public struct MissingTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSy ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforePlaceholder?.raw, placeholder.raw, unexpectedAfterPlaceholder?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.missingType, @@ -5008,15 +4800,7 @@ public struct MultipleTrailingClosureElementSyntax: SyntaxProtocol, SyntaxHashab ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLabel), - Syntax(label), - Syntax(unexpectedBetweenLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndClosure), - Syntax(closure), - Syntax(unexpectedAfterClosure) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLabel?.raw, label.raw, @@ -5162,13 +4946,7 @@ public struct NamedOpaqueReturnTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _ ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeGenericParameterClause), - Syntax(genericParameterClause), - Syntax(unexpectedBetweenGenericParameterClauseAndType), - Syntax(type), - Syntax(unexpectedAfterType) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeGenericParameterClause?.raw, genericParameterClause.raw, @@ -5279,7 +5057,7 @@ public struct NilLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExp ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeNilKeyword), Syntax(nilKeyword), Syntax(unexpectedAfterNilKeyword)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforeNilKeyword?.raw, nilKeyword.raw, unexpectedAfterNilKeyword?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.nilLiteralExpr, diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesOP.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesOP.swift index 9e68c3febf1..601c933c0ec 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesOP.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesOP.swift @@ -51,13 +51,7 @@ public struct ObjCSelectorPieceSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeName), - Syntax(name), - Syntax(unexpectedBetweenNameAndColon), - Syntax(colon), - Syntax(unexpectedAfterColon) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeName?.raw, name?.raw, @@ -187,15 +181,7 @@ public struct OpaqueReturnTypeOfAttributeArgumentsSyntax: SyntaxProtocol, Syntax ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeMangledName), - Syntax(mangledName), - Syntax(unexpectedBetweenMangledNameAndComma), - Syntax(comma), - Syntax(unexpectedBetweenCommaAndOrdinal), - Syntax(ordinal), - Syntax(unexpectedAfterOrdinal) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeMangledName?.raw, mangledName.raw, @@ -351,17 +337,7 @@ public struct OperatorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeFixitySpecifier), - Syntax(fixitySpecifier), - Syntax(unexpectedBetweenFixitySpecifierAndOperatorKeyword), - Syntax(operatorKeyword), - Syntax(unexpectedBetweenOperatorKeywordAndName), - Syntax(name), - Syntax(unexpectedBetweenNameAndOperatorPrecedenceAndTypes), - Syntax(operatorPrecedenceAndTypes), - Syntax(unexpectedAfterOperatorPrecedenceAndTypes) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeFixitySpecifier?.raw, fixitySpecifier.raw, @@ -551,15 +527,7 @@ public struct OperatorPrecedenceAndTypesSyntax: SyntaxProtocol, SyntaxHashable, ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndPrecedenceGroup), - Syntax(precedenceGroup), - Syntax(unexpectedBetweenPrecedenceGroupAndDesignatedTypes), - Syntax(designatedTypes), - Syntax(unexpectedAfterDesignatedTypes) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeColon?.raw, colon.raw, @@ -742,17 +710,7 @@ public struct OptionalBindingConditionSyntax: SyntaxProtocol, SyntaxHashable, _L ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeBindingSpecifier), - Syntax(bindingSpecifier), - Syntax(unexpectedBetweenBindingSpecifierAndPattern), - Syntax(pattern), - Syntax(unexpectedBetweenPatternAndTypeAnnotation), - Syntax(typeAnnotation), - Syntax(unexpectedBetweenTypeAnnotationAndInitializer), - Syntax(initializer), - Syntax(unexpectedAfterInitializer) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeBindingSpecifier?.raw, bindingSpecifier.raw, @@ -922,13 +880,7 @@ public struct OptionalChainingExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _L ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeExpression), - Syntax(expression), - Syntax(unexpectedBetweenExpressionAndQuestionMark), - Syntax(questionMark), - Syntax(unexpectedAfterQuestionMark) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeExpression?.raw, expression.raw, @@ -1044,13 +996,7 @@ public struct OptionalTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeS ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeWrappedType), - Syntax(wrappedType), - Syntax(unexpectedBetweenWrappedTypeAndQuestionMark), - Syntax(questionMark), - Syntax(unexpectedAfterQuestionMark) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeWrappedType?.raw, wrappedType.raw, @@ -1181,19 +1127,7 @@ public struct OriginallyDefinedInAttributeArgumentsSyntax: SyntaxProtocol, Synta ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeModuleLabel), - Syntax(moduleLabel), - Syntax(unexpectedBetweenModuleLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndModuleName), - Syntax(moduleName), - Syntax(unexpectedBetweenModuleNameAndComma), - Syntax(comma), - Syntax(unexpectedBetweenCommaAndPlatforms), - Syntax(platforms), - Syntax(unexpectedAfterPlatforms) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeModuleLabel?.raw, moduleLabel.raw, @@ -1416,13 +1350,7 @@ public struct PackElementExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafEx ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeEachKeyword), - Syntax(eachKeyword), - Syntax(unexpectedBetweenEachKeywordAndPack), - Syntax(pack), - Syntax(unexpectedAfterPack) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeEachKeyword?.raw, eachKeyword.raw, @@ -1538,13 +1466,7 @@ public struct PackElementTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTy ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeEachKeyword), - Syntax(eachKeyword), - Syntax(unexpectedBetweenEachKeywordAndPack), - Syntax(pack), - Syntax(unexpectedAfterPack) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeEachKeyword?.raw, eachKeyword.raw, @@ -1662,13 +1584,7 @@ public struct PackExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeRepeatKeyword), - Syntax(repeatKeyword), - Syntax(unexpectedBetweenRepeatKeywordAndRepetitionPattern), - Syntax(repetitionPattern), - Syntax(unexpectedAfterRepetitionPattern) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeRepeatKeyword?.raw, repeatKeyword.raw, @@ -1784,13 +1700,7 @@ public struct PackExpansionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _Leaf ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeRepeatKeyword), - Syntax(repeatKeyword), - Syntax(unexpectedBetweenRepeatKeywordAndRepetitionPattern), - Syntax(repetitionPattern), - Syntax(unexpectedAfterRepetitionPattern) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeRepeatKeyword?.raw, repeatKeyword.raw, @@ -1925,19 +1835,7 @@ public struct PatternBindingSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforePattern), - Syntax(pattern), - Syntax(unexpectedBetweenPatternAndTypeAnnotation), - Syntax(typeAnnotation), - Syntax(unexpectedBetweenTypeAnnotationAndInitializer), - Syntax(initializer), - Syntax(unexpectedBetweenInitializerAndAccessorBlock), - Syntax(accessorBlock), - Syntax(unexpectedBetweenAccessorBlockAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforePattern?.raw, pattern.raw, @@ -2138,7 +2036,7 @@ public struct PatternExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforePattern), Syntax(pattern), Syntax(unexpectedAfterPattern)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforePattern?.raw, pattern.raw, unexpectedAfterPattern?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.patternExpr, @@ -2223,13 +2121,7 @@ public struct PlatformVersionItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforePlatformVersion), - Syntax(platformVersion), - Syntax(unexpectedBetweenPlatformVersionAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforePlatformVersion?.raw, platformVersion.raw, @@ -2357,13 +2249,7 @@ public struct PlatformVersionSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforePlatform), - Syntax(platform), - Syntax(unexpectedBetweenPlatformAndVersion), - Syntax(version), - Syntax(unexpectedAfterVersion) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforePlatform?.raw, platform.raw, @@ -2486,13 +2372,7 @@ public struct PostfixIfConfigExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Le ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeBase), - Syntax(base), - Syntax(unexpectedBetweenBaseAndConfig), - Syntax(config), - Syntax(unexpectedAfterConfig) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeBase?.raw, base?.raw, @@ -2605,13 +2485,7 @@ public struct PostfixOperatorExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Le ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeExpression), - Syntax(expression), - Syntax(unexpectedBetweenExpressionAndOperator), - Syntax(`operator`), - Syntax(unexpectedAfterOperator) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeExpression?.raw, expression.raw, @@ -2746,23 +2620,7 @@ public struct PoundSourceLocationArgumentsSyntax: SyntaxProtocol, SyntaxHashable ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeFileLabel), - Syntax(fileLabel), - Syntax(unexpectedBetweenFileLabelAndFileColon), - Syntax(fileColon), - Syntax(unexpectedBetweenFileColonAndFileName), - Syntax(fileName), - Syntax(unexpectedBetweenFileNameAndComma), - Syntax(comma), - Syntax(unexpectedBetweenCommaAndLineLabel), - Syntax(lineLabel), - Syntax(unexpectedBetweenLineLabelAndLineColon), - Syntax(lineColon), - Syntax(unexpectedBetweenLineColonAndLineNumber), - Syntax(lineNumber), - Syntax(unexpectedAfterLineNumber) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeFileLabel?.raw, fileLabel.raw, @@ -3019,17 +2877,7 @@ public struct PoundSourceLocationSyntax: DeclSyntaxProtocol, SyntaxHashable, _Le ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforePoundSourceLocation), - Syntax(poundSourceLocation), - Syntax(unexpectedBetweenPoundSourceLocationAndLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndArguments), - Syntax(arguments), - Syntax(unexpectedBetweenArgumentsAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforePoundSourceLocation?.raw, poundSourceLocation.raw, @@ -3209,15 +3057,7 @@ public struct PrecedenceGroupAssignmentSyntax: SyntaxProtocol, SyntaxHashable, _ ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAssignmentLabel), - Syntax(assignmentLabel), - Syntax(unexpectedBetweenAssignmentLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndValue), - Syntax(value), - Syntax(unexpectedAfterValue) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAssignmentLabel?.raw, assignmentLabel.raw, @@ -3377,15 +3217,7 @@ public struct PrecedenceGroupAssociativitySyntax: SyntaxProtocol, SyntaxHashable ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAssociativityLabel), - Syntax(associativityLabel), - Syntax(unexpectedBetweenAssociativityLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndValue), - Syntax(value), - Syntax(unexpectedAfterValue) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAssociativityLabel?.raw, associativityLabel.raw, @@ -3557,23 +3389,7 @@ public struct PrecedenceGroupDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Le ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndModifiers), - Syntax(modifiers), - Syntax(unexpectedBetweenModifiersAndPrecedencegroupKeyword), - Syntax(precedencegroupKeyword), - Syntax(unexpectedBetweenPrecedencegroupKeywordAndName), - Syntax(name), - Syntax(unexpectedBetweenNameAndLeftBrace), - Syntax(leftBrace), - Syntax(unexpectedBetweenLeftBraceAndGroupAttributes), - Syntax(groupAttributes), - Syntax(unexpectedBetweenGroupAttributesAndRightBrace), - Syntax(rightBrace), - Syntax(unexpectedAfterRightBrace) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, attributes.raw, @@ -3908,13 +3724,7 @@ public struct PrecedenceGroupNameSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeName), - Syntax(name), - Syntax(unexpectedBetweenNameAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeName?.raw, name.raw, @@ -4044,15 +3854,7 @@ public struct PrecedenceGroupRelationSyntax: SyntaxProtocol, SyntaxHashable, _Le ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeHigherThanOrLowerThanLabel), - Syntax(higherThanOrLowerThanLabel), - Syntax(unexpectedBetweenHigherThanOrLowerThanLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndPrecedenceGroups), - Syntax(precedenceGroups), - Syntax(unexpectedAfterPrecedenceGroups) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeHigherThanOrLowerThanLabel?.raw, higherThanOrLowerThanLabel.raw, @@ -4239,13 +4041,7 @@ public struct PrefixOperatorExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeOperator), - Syntax(`operator`), - Syntax(unexpectedBetweenOperatorAndExpression), - Syntax(expression), - Syntax(unexpectedAfterExpression) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeOperator?.raw, `operator`.raw, @@ -4368,15 +4164,7 @@ public struct PrimaryAssociatedTypeClauseSyntax: SyntaxProtocol, SyntaxHashable, ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeftAngle), - Syntax(leftAngle), - Syntax(unexpectedBetweenLeftAngleAndPrimaryAssociatedTypes), - Syntax(primaryAssociatedTypes), - Syntax(unexpectedBetweenPrimaryAssociatedTypesAndRightAngle), - Syntax(rightAngle), - Syntax(unexpectedAfterRightAngle) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftAngle?.raw, leftAngle.raw, @@ -4550,13 +4338,7 @@ public struct PrimaryAssociatedTypeSyntax: SyntaxProtocol, SyntaxHashable, _Leaf ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeName), - Syntax(name), - Syntax(unexpectedBetweenNameAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeName?.raw, name.raw, @@ -4711,25 +4493,7 @@ public struct ProtocolDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndModifiers), - Syntax(modifiers), - Syntax(unexpectedBetweenModifiersAndProtocolKeyword), - Syntax(protocolKeyword), - Syntax(unexpectedBetweenProtocolKeywordAndName), - Syntax(name), - Syntax(unexpectedBetweenNameAndPrimaryAssociatedTypeClause), - Syntax(primaryAssociatedTypeClause), - Syntax(unexpectedBetweenPrimaryAssociatedTypeClauseAndInheritanceClause), - Syntax(inheritanceClause), - Syntax(unexpectedBetweenInheritanceClauseAndGenericWhereClause), - Syntax(genericWhereClause), - Syntax(unexpectedBetweenGenericWhereClauseAndMemberBlock), - Syntax(memberBlock), - Syntax(unexpectedAfterMemberBlock) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, attributes.raw, diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift index c4c3bbf6a28..a4b18723a4f 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift @@ -52,19 +52,7 @@ public struct RegexLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeOpeningPounds), - Syntax(openingPounds), - Syntax(unexpectedBetweenOpeningPoundsAndOpeningSlash), - Syntax(openingSlash), - Syntax(unexpectedBetweenOpeningSlashAndRegex), - Syntax(regex), - Syntax(unexpectedBetweenRegexAndClosingSlash), - Syntax(closingSlash), - Syntax(unexpectedBetweenClosingSlashAndClosingPounds), - Syntax(closingPounds), - Syntax(unexpectedAfterClosingPounds) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeOpeningPounds?.raw, openingPounds?.raw, @@ -270,17 +258,7 @@ public struct RepeatStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyn ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeRepeatKeyword), - Syntax(repeatKeyword), - Syntax(unexpectedBetweenRepeatKeywordAndBody), - Syntax(body), - Syntax(unexpectedBetweenBodyAndWhileKeyword), - Syntax(whileKeyword), - Syntax(unexpectedBetweenWhileKeywordAndCondition), - Syntax(condition), - Syntax(unexpectedAfterCondition) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeRepeatKeyword?.raw, repeatKeyword.raw, @@ -456,13 +434,7 @@ public struct ReturnClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeArrow), - Syntax(arrow), - Syntax(unexpectedBetweenArrowAndType), - Syntax(type), - Syntax(unexpectedAfterType) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeArrow?.raw, arrow.raw, @@ -581,13 +553,7 @@ public struct ReturnStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyn ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeReturnKeyword), - Syntax(returnKeyword), - Syntax(unexpectedBetweenReturnKeywordAndExpression), - Syntax(expression), - Syntax(unexpectedAfterExpression) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeReturnKeyword?.raw, returnKeyword.raw, @@ -710,15 +676,7 @@ public struct SameTypeRequirementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeftType), - Syntax(leftType), - Syntax(unexpectedBetweenLeftTypeAndEqual), - Syntax(equal), - Syntax(unexpectedBetweenEqualAndRightType), - Syntax(rightType), - Syntax(unexpectedAfterRightType) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftType?.raw, leftType.raw, @@ -866,7 +824,7 @@ public struct SequenceExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprS ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeElements), Syntax(elements), Syntax(unexpectedAfterElements)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforeElements?.raw, elements.raw, unexpectedAfterElements?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.sequenceExpr, @@ -983,15 +941,7 @@ public struct SimpleStringLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeOpeningQuote), - Syntax(openingQuote), - Syntax(unexpectedBetweenOpeningQuoteAndSegments), - Syntax(segments), - Syntax(unexpectedBetweenSegmentsAndClosingQuote), - Syntax(closingQuote), - Syntax(unexpectedAfterClosingQuote) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeOpeningQuote?.raw, openingQuote.raw, @@ -1174,7 +1124,7 @@ public struct SimpleTypeSpecifierSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeSpecifier), Syntax(specifier), Syntax(unexpectedAfterSpecifier)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforeSpecifier?.raw, specifier.raw, unexpectedAfterSpecifier?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.simpleTypeSpecifier, @@ -1264,13 +1214,7 @@ public struct SomeOrAnyTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafType ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeSomeOrAnySpecifier), - Syntax(someOrAnySpecifier), - Syntax(unexpectedBetweenSomeOrAnySpecifierAndConstraint), - Syntax(constraint), - Syntax(unexpectedAfterConstraint) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeSomeOrAnySpecifier?.raw, someOrAnySpecifier.raw, @@ -1392,15 +1336,7 @@ public struct SourceFileSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodeP ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeShebang), - Syntax(shebang), - Syntax(unexpectedBetweenShebangAndStatements), - Syntax(statements), - Syntax(unexpectedBetweenStatementsAndEndOfFileToken), - Syntax(endOfFileToken), - Syntax(unexpectedAfterEndOfFileToken) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeShebang?.raw, shebang?.raw, @@ -1586,17 +1522,7 @@ public struct SpecializeAvailabilityArgumentSyntax: SyntaxProtocol, SyntaxHashab ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAvailabilityLabel), - Syntax(availabilityLabel), - Syntax(unexpectedBetweenAvailabilityLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndAvailabilityArguments), - Syntax(availabilityArguments), - Syntax(unexpectedBetweenAvailabilityArgumentsAndSemicolon), - Syntax(semicolon), - Syntax(unexpectedAfterSemicolon) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAvailabilityLabel?.raw, availabilityLabel.raw, @@ -1813,17 +1739,7 @@ public struct SpecializeTargetFunctionArgumentSyntax: SyntaxProtocol, SyntaxHash ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeTargetLabel), - Syntax(targetLabel), - Syntax(unexpectedBetweenTargetLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndDeclName), - Syntax(declName), - Syntax(unexpectedBetweenDeclNameAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeTargetLabel?.raw, targetLabel.raw, @@ -2028,19 +1944,7 @@ public struct StringLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeOpeningPounds), - Syntax(openingPounds), - Syntax(unexpectedBetweenOpeningPoundsAndOpeningQuote), - Syntax(openingQuote), - Syntax(unexpectedBetweenOpeningQuoteAndSegments), - Syntax(segments), - Syntax(unexpectedBetweenSegmentsAndClosingQuote), - Syntax(closingQuote), - Syntax(unexpectedBetweenClosingQuoteAndClosingPounds), - Syntax(closingPounds), - Syntax(unexpectedAfterClosingPounds) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeOpeningPounds?.raw, openingPounds?.raw, @@ -2276,7 +2180,7 @@ public struct StringSegmentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeContent), Syntax(content), Syntax(unexpectedAfterContent)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforeContent?.raw, content.raw, unexpectedAfterContent?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.stringSegment, @@ -2440,25 +2344,7 @@ public struct StructDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyn ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndModifiers), - Syntax(modifiers), - Syntax(unexpectedBetweenModifiersAndStructKeyword), - Syntax(structKeyword), - Syntax(unexpectedBetweenStructKeywordAndName), - Syntax(name), - Syntax(unexpectedBetweenNameAndGenericParameterClause), - Syntax(genericParameterClause), - Syntax(unexpectedBetweenGenericParameterClauseAndInheritanceClause), - Syntax(inheritanceClause), - Syntax(unexpectedBetweenInheritanceClauseAndGenericWhereClause), - Syntax(genericWhereClause), - Syntax(unexpectedBetweenGenericWhereClauseAndMemberBlock), - Syntax(memberBlock), - Syntax(unexpectedAfterMemberBlock) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, attributes.raw, @@ -2797,21 +2683,7 @@ public struct SubscriptCallExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeCalledExpression), - Syntax(calledExpression), - Syntax(unexpectedBetweenCalledExpressionAndLeftSquare), - Syntax(leftSquare), - Syntax(unexpectedBetweenLeftSquareAndArguments), - Syntax(arguments), - Syntax(unexpectedBetweenArgumentsAndRightSquare), - Syntax(rightSquare), - Syntax(unexpectedBetweenRightSquareAndTrailingClosure), - Syntax(trailingClosure), - Syntax(unexpectedBetweenTrailingClosureAndAdditionalTrailingClosures), - Syntax(additionalTrailingClosures), - Syntax(unexpectedAfterAdditionalTrailingClosures) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeCalledExpression?.raw, calledExpression.raw, @@ -3100,25 +2972,7 @@ public struct SubscriptDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndModifiers), - Syntax(modifiers), - Syntax(unexpectedBetweenModifiersAndSubscriptKeyword), - Syntax(subscriptKeyword), - Syntax(unexpectedBetweenSubscriptKeywordAndGenericParameterClause), - Syntax(genericParameterClause), - Syntax(unexpectedBetweenGenericParameterClauseAndParameterClause), - Syntax(parameterClause), - Syntax(unexpectedBetweenParameterClauseAndReturnClause), - Syntax(returnClause), - Syntax(unexpectedBetweenReturnClauseAndGenericWhereClause), - Syntax(genericWhereClause), - Syntax(unexpectedBetweenGenericWhereClauseAndAccessorBlock), - Syntax(accessorBlock), - Syntax(unexpectedAfterAccessorBlock) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, attributes.raw, @@ -3431,7 +3285,7 @@ public struct SuperExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeSuperKeyword), Syntax(superKeyword), Syntax(unexpectedAfterSuperKeyword)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforeSuperKeyword?.raw, superKeyword.raw, unexpectedAfterSuperKeyword?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.superExpr, @@ -3511,13 +3365,7 @@ public struct SuppressedTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeWithoutTilde), - Syntax(withoutTilde), - Syntax(unexpectedBetweenWithoutTildeAndType), - Syntax(type), - Syntax(unexpectedAfterType) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeWithoutTilde?.raw, withoutTilde.raw, @@ -3640,15 +3488,7 @@ public struct SwitchCaseItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforePattern), - Syntax(pattern), - Syntax(unexpectedBetweenPatternAndWhereClause), - Syntax(whereClause), - Syntax(unexpectedBetweenWhereClauseAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforePattern?.raw, pattern.raw, @@ -3795,15 +3635,7 @@ public struct SwitchCaseLabelSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeCaseKeyword), - Syntax(caseKeyword), - Syntax(unexpectedBetweenCaseKeywordAndCaseItems), - Syntax(caseItems), - Syntax(unexpectedBetweenCaseItemsAndColon), - Syntax(colon), - Syntax(unexpectedAfterColon) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeCaseKeyword?.raw, caseKeyword.raw, @@ -4063,15 +3895,7 @@ public struct SwitchCaseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodeP ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAttribute), - Syntax(attribute), - Syntax(unexpectedBetweenAttributeAndLabel), - Syntax(label), - Syntax(unexpectedBetweenLabelAndStatements), - Syntax(statements), - Syntax(unexpectedAfterStatements) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAttribute?.raw, attribute?.raw, @@ -4240,13 +4064,7 @@ public struct SwitchDefaultLabelSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeDefaultKeyword), - Syntax(defaultKeyword), - Syntax(unexpectedBetweenDefaultKeywordAndColon), - Syntax(colon), - Syntax(unexpectedAfterColon) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeDefaultKeyword?.raw, defaultKeyword.raw, @@ -4392,19 +4210,7 @@ public struct SwitchExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyn ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeSwitchKeyword), - Syntax(switchKeyword), - Syntax(unexpectedBetweenSwitchKeywordAndSubject), - Syntax(subject), - Syntax(unexpectedBetweenSubjectAndLeftBrace), - Syntax(leftBrace), - Syntax(unexpectedBetweenLeftBraceAndCases), - Syntax(cases), - Syntax(unexpectedBetweenCasesAndRightBrace), - Syntax(rightBrace), - Syntax(unexpectedAfterRightBrace) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeSwitchKeyword?.raw, switchKeyword.raw, diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesTUVWXYZ.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesTUVWXYZ.swift index 4cd778f5b21..2cd621d113b 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesTUVWXYZ.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesTUVWXYZ.swift @@ -63,19 +63,7 @@ public struct TernaryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeCondition), - Syntax(condition), - Syntax(unexpectedBetweenConditionAndQuestionMark), - Syntax(questionMark), - Syntax(unexpectedBetweenQuestionMarkAndThenExpression), - Syntax(thenExpression), - Syntax(unexpectedBetweenThenExpressionAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndElseExpression), - Syntax(elseExpression), - Syntax(unexpectedAfterElseExpression) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeCondition?.raw, condition.raw, @@ -279,13 +267,7 @@ public struct ThenStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynta ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeThenKeyword), - Syntax(thenKeyword), - Syntax(unexpectedBetweenThenKeywordAndExpression), - Syntax(expression), - Syntax(unexpectedAfterExpression) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeThenKeyword?.raw, thenKeyword.raw, @@ -401,13 +383,7 @@ public struct ThrowStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeThrowKeyword), - Syntax(throwKeyword), - Syntax(unexpectedBetweenThrowKeywordAndExpression), - Syntax(expression), - Syntax(unexpectedAfterExpression) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeThrowKeyword?.raw, throwKeyword.raw, @@ -540,17 +516,7 @@ public struct ThrowsClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeThrowsSpecifier), - Syntax(throwsSpecifier), - Syntax(unexpectedBetweenThrowsSpecifierAndLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndType), - Syntax(type), - Syntax(unexpectedBetweenTypeAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeThrowsSpecifier?.raw, throwsSpecifier.raw, @@ -748,15 +714,7 @@ public struct TryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntax ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeTryKeyword), - Syntax(tryKeyword), - Syntax(unexpectedBetweenTryKeywordAndQuestionOrExclamationMark), - Syntax(questionOrExclamationMark), - Syntax(unexpectedBetweenQuestionOrExclamationMarkAndExpression), - Syntax(expression), - Syntax(unexpectedAfterExpression) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeTryKeyword?.raw, tryKeyword.raw, @@ -904,15 +862,7 @@ public struct TupleExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndElements), - Syntax(elements), - Syntax(unexpectedBetweenElementsAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftParen?.raw, leftParen.raw, @@ -1098,17 +1048,7 @@ public struct TuplePatternElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLabel), - Syntax(label), - Syntax(unexpectedBetweenLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndPattern), - Syntax(pattern), - Syntax(unexpectedBetweenPatternAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLabel?.raw, label?.raw, @@ -1301,15 +1241,7 @@ public struct TuplePatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _LeafPa ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndElements), - Syntax(elements), - Syntax(unexpectedBetweenElementsAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftParen?.raw, leftParen.raw, @@ -1502,23 +1434,7 @@ public struct TupleTypeElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeInoutKeyword), - Syntax(inoutKeyword), - Syntax(unexpectedBetweenInoutKeywordAndFirstName), - Syntax(firstName), - Syntax(unexpectedBetweenFirstNameAndSecondName), - Syntax(secondName), - Syntax(unexpectedBetweenSecondNameAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndType), - Syntax(type), - Syntax(unexpectedBetweenTypeAndEllipsis), - Syntax(ellipsis), - Syntax(unexpectedBetweenEllipsisAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeInoutKeyword?.raw, inoutKeyword?.raw, @@ -1776,15 +1692,7 @@ public struct TupleTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndElements), - Syntax(elements), - Syntax(unexpectedBetweenElementsAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftParen?.raw, leftParen.raw, @@ -1971,23 +1879,7 @@ public struct TypeAliasDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndModifiers), - Syntax(modifiers), - Syntax(unexpectedBetweenModifiersAndTypealiasKeyword), - Syntax(typealiasKeyword), - Syntax(unexpectedBetweenTypealiasKeywordAndName), - Syntax(name), - Syntax(unexpectedBetweenNameAndGenericParameterClause), - Syntax(genericParameterClause), - Syntax(unexpectedBetweenGenericParameterClauseAndInitializer), - Syntax(initializer), - Syntax(unexpectedBetweenInitializerAndGenericWhereClause), - Syntax(genericWhereClause), - Syntax(unexpectedAfterGenericWhereClause) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, attributes.raw, @@ -2290,13 +2182,7 @@ public struct TypeAnnotationSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndType), - Syntax(type), - Syntax(unexpectedAfterType) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeColon?.raw, colon.raw, @@ -2421,13 +2307,7 @@ public struct TypeEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashable, _LeafS ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAsyncSpecifier), - Syntax(asyncSpecifier), - Syntax(unexpectedBetweenAsyncSpecifierAndThrowsClause), - Syntax(throwsClause), - Syntax(unexpectedAfterThrowsClause) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAsyncSpecifier?.raw, asyncSpecifier?.raw, @@ -2541,7 +2421,7 @@ public struct TypeExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynta ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeType), Syntax(type), Syntax(unexpectedAfterType)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforeType?.raw, type.raw, unexpectedAfterType?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.typeExpr, @@ -2623,13 +2503,7 @@ public struct TypeInitializerClauseSyntax: SyntaxProtocol, SyntaxHashable, _Leaf ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeEqual), - Syntax(equal), - Syntax(unexpectedBetweenEqualAndValue), - Syntax(value), - Syntax(unexpectedAfterValue) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeEqual?.raw, equal.raw, @@ -2754,15 +2628,7 @@ public struct UnavailableFromAsyncAttributeArgumentsSyntax: SyntaxProtocol, Synt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeMessageLabel), - Syntax(messageLabel), - Syntax(unexpectedBetweenMessageLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndMessage), - Syntax(message), - Syntax(unexpectedAfterMessage) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeMessageLabel?.raw, messageLabel.raw, @@ -2914,15 +2780,7 @@ public struct UnderscorePrivateAttributeArgumentsSyntax: SyntaxProtocol, SyntaxH ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeSourceFileLabel), - Syntax(sourceFileLabel), - Syntax(unexpectedBetweenSourceFileLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndFilename), - Syntax(filename), - Syntax(unexpectedAfterFilename) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeSourceFileLabel?.raw, sourceFileLabel.raw, @@ -3070,13 +2928,7 @@ public struct UnresolvedAsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAsKeyword), - Syntax(asKeyword), - Syntax(unexpectedBetweenAsKeywordAndQuestionOrExclamationMark), - Syntax(questionOrExclamationMark), - Syntax(unexpectedAfterQuestionOrExclamationMark) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAsKeyword?.raw, asKeyword.raw, @@ -3199,7 +3051,7 @@ public struct UnresolvedIsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeIsKeyword), Syntax(isKeyword), Syntax(unexpectedAfterIsKeyword)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforeIsKeyword?.raw, isKeyword.raw, unexpectedAfterIsKeyword?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.unresolvedIsExpr, @@ -3288,15 +3140,7 @@ public struct UnresolvedTernaryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _ ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeQuestionMark), - Syntax(questionMark), - Syntax(unexpectedBetweenQuestionMarkAndThenExpression), - Syntax(thenExpression), - Syntax(unexpectedBetweenThenExpressionAndColon), - Syntax(colon), - Syntax(unexpectedAfterColon) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeQuestionMark?.raw, questionMark.raw, @@ -3439,13 +3283,7 @@ public struct ValueBindingPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeBindingSpecifier), - Syntax(bindingSpecifier), - Syntax(unexpectedBetweenBindingSpecifierAndPattern), - Syntax(pattern), - Syntax(unexpectedAfterPattern) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeBindingSpecifier?.raw, bindingSpecifier.raw, @@ -3582,17 +3420,7 @@ public struct VariableDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndModifiers), - Syntax(modifiers), - Syntax(unexpectedBetweenModifiersAndBindingSpecifier), - Syntax(bindingSpecifier), - Syntax(unexpectedBetweenBindingSpecifierAndBindings), - Syntax(bindings), - Syntax(unexpectedAfterBindings) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeAttributes?.raw, attributes.raw, @@ -3865,13 +3693,7 @@ public struct VersionComponentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforePeriod), - Syntax(period), - Syntax(unexpectedBetweenPeriodAndNumber), - Syntax(number), - Syntax(unexpectedAfterNumber) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforePeriod?.raw, period.raw, @@ -4004,13 +3826,7 @@ public struct VersionTupleSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeMajor), - Syntax(major), - Syntax(unexpectedBetweenMajorAndComponents), - Syntax(components), - Syntax(unexpectedAfterComponents) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeMajor?.raw, major.raw, @@ -4162,13 +3978,7 @@ public struct WhereClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeWhereKeyword), - Syntax(whereKeyword), - Syntax(unexpectedBetweenWhereKeywordAndCondition), - Syntax(condition), - Syntax(unexpectedAfterCondition) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeWhereKeyword?.raw, whereKeyword.raw, @@ -4287,15 +4097,7 @@ public struct WhileStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeWhileKeyword), - Syntax(whileKeyword), - Syntax(unexpectedBetweenWhileKeywordAndConditions), - Syntax(conditions), - Syntax(unexpectedBetweenConditionsAndBody), - Syntax(body), - Syntax(unexpectedAfterBody) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeWhileKeyword?.raw, whileKeyword.raw, @@ -4472,7 +4274,7 @@ public struct WildcardPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _Lea ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), (Syntax(unexpectedBeforeWildcard), Syntax(wildcard), Syntax(unexpectedAfterWildcard)))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [unexpectedBeforeWildcard?.raw, wildcard.raw, unexpectedAfterWildcard?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.wildcardPattern, @@ -4634,13 +4436,7 @@ public struct YieldStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeYieldKeyword), - Syntax(yieldKeyword), - Syntax(unexpectedBetweenYieldKeywordAndYieldedExpressions), - Syntax(yieldedExpressions), - Syntax(unexpectedAfterYieldedExpressions) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeYieldKeyword?.raw, yieldKeyword.raw, @@ -4760,13 +4556,7 @@ public struct YieldedExpressionSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeExpression), - Syntax(expression), - Syntax(unexpectedBetweenExpressionAndComma), - Syntax(comma), - Syntax(unexpectedAfterComma) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeExpression?.raw, expression.raw, @@ -4889,15 +4679,7 @@ public struct YieldedExpressionsClauseSyntax: SyntaxProtocol, SyntaxHashable, _L ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. - self = withExtendedLifetime((SyntaxArena(), ( - Syntax(unexpectedBeforeLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndElements), - Syntax(elements), - Syntax(unexpectedBetweenElementsAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ))) { (arena, _) in + self = withExtendedLifetime(SyntaxArena()) { (arena) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftParen?.raw, leftParen.raw, From 794086490f74afb874f614fe5c045077193dc65c Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Thu, 1 Aug 2024 14:37:11 -0700 Subject: [PATCH 7/9] Pass SyntaxData to RawSyntax initializer --- .../swiftsyntax/SyntaxNodesFile.swift | 42 +- Sources/SwiftSyntax/Raw/RawSyntax.swift | 10 +- Sources/SwiftSyntax/SyntaxCollection.swift | 2 +- .../generated/syntaxNodes/SyntaxNodesAB.swift | 637 +++++--------- .../generated/syntaxNodes/SyntaxNodesC.swift | 749 ++++++---------- .../generated/syntaxNodes/SyntaxNodesD.swift | 651 +++++--------- .../generated/syntaxNodes/SyntaxNodesEF.swift | 717 +++++---------- .../syntaxNodes/SyntaxNodesGHI.swift | 714 ++++++--------- .../syntaxNodes/SyntaxNodesJKLMN.swift | 773 ++++++---------- .../generated/syntaxNodes/SyntaxNodesOP.swift | 833 ++++++------------ .../syntaxNodes/SyntaxNodesQRS.swift | 690 +++++---------- .../syntaxNodes/SyntaxNodesTUVWXYZ.swift | 804 ++++++----------- 12 files changed, 2261 insertions(+), 4361 deletions(-) diff --git a/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxNodesFile.swift b/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxNodesFile.swift index 4e51ecaac8c..eda6ae8c9b5 100644 --- a/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxNodesFile.swift +++ b/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxNodesFile.swift @@ -69,19 +69,18 @@ func syntaxNode(nodesStartingWith: [Character]) -> SourceFileSyntax { ) ) ) - let layoutList = ArrayExprSyntax { - for child in node.children { - ArrayElementSyntax( - expression: MemberAccessExprSyntax( - base: child.buildableType.optionalChained( - expr: ExprSyntax("\(child.varOrCaseName.backtickedIfNeeded)") - ), - period: .periodToken(), - name: "raw" - ) - ) - } - } + VariableDeclSyntax( + .let, + name: "nodes", + type: TypeAnnotationSyntax(type: TypeSyntax("[Syntax?]")), + initializer: InitializerClauseSyntax( + value: ArrayExprSyntax { + for child in node.children { + ArrayElementSyntax(expression: ExprSyntax("Syntax(\(child.varOrCaseName.backtickedIfNeeded))")) + } + } + ) + ) let initializer = FunctionCallExprSyntax( calledExpression: ExprSyntax("withExtendedLifetime"), @@ -94,12 +93,11 @@ func syntaxNode(nodesStartingWith: [Character]) -> SourceFileSyntax { if node.children.isEmpty { DeclSyntax("let raw = RawSyntax.makeEmptyLayout(kind: SyntaxKind.\(node.varOrCaseName), arena: arena)") } else { - DeclSyntax("let layout: [RawSyntax?] = \(layoutList)") DeclSyntax( """ let raw = RawSyntax.makeLayout( kind: SyntaxKind.\(node.varOrCaseName), - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -122,18 +120,6 @@ func syntaxNode(nodesStartingWith: [Character]) -> SourceFileSyntax { rightOperand: initializer ) - VariableDeclSyntax( - .let, - name: "nodes", - type: TypeAnnotationSyntax(type: TypeSyntax("[Syntax?]")), - initializer: InitializerClauseSyntax( - value: ArrayExprSyntax { - for child in node.children { - ArrayElementSyntax(expression: ExprSyntax("Syntax(\(child.varOrCaseName.backtickedIfNeeded))")) - } - } - ) - ) ExprSyntax("Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes))") } @@ -195,7 +181,7 @@ func syntaxNode(nodesStartingWith: [Character]) -> SourceFileSyntax { collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.\(childNode.varOrCaseName), - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild(at: \(raw: index), with: collection, rawNodeArena: arena, allocationArena: arena) diff --git a/Sources/SwiftSyntax/Raw/RawSyntax.swift b/Sources/SwiftSyntax/Raw/RawSyntax.swift index b0f51cd55a2..be1f396fc73 100644 --- a/Sources/SwiftSyntax/Raw/RawSyntax.swift +++ b/Sources/SwiftSyntax/Raw/RawSyntax.swift @@ -817,13 +817,13 @@ extension RawSyntax { static func makeLayout( kind: SyntaxKind, - from collection: some Collection, + from collection: some Collection, arena: __shared SyntaxArena, leadingTrivia: Trivia? = nil, trailingTrivia: Trivia? = nil ) -> RawSyntax { if leadingTrivia != nil || trailingTrivia != nil { - var layout = Array(collection) + var layout = collection.map { $0?.raw } if let leadingTrivia = leadingTrivia, // Find the index of the first non-empty node so we can attach the trivia to it. let idx = layout.firstIndex(where: { $0 != nil && ($0!.isToken || $0!.totalNodes > 1) }) @@ -842,11 +842,13 @@ extension RawSyntax { arena: arena ) } - return .makeLayout(kind: kind, from: layout, arena: arena) + return .makeLayout(kind: kind, uninitializedCount: collection.count, arena: arena) { + _ = $0.initialize(from: layout) + } } return .makeLayout(kind: kind, uninitializedCount: collection.count, arena: arena) { - _ = $0.initialize(from: collection) + _ = $0.initialize(from: collection.lazy.map { $0?.raw }) } } } diff --git a/Sources/SwiftSyntax/SyntaxCollection.swift b/Sources/SwiftSyntax/SyntaxCollection.swift index 7a72a90fc70..e5733ff8df4 100644 --- a/Sources/SwiftSyntax/SyntaxCollection.swift +++ b/Sources/SwiftSyntax/SyntaxCollection.swift @@ -45,7 +45,7 @@ extension SyntaxCollection { let raw = withExtendedLifetime(children) { RawSyntax.makeLayout( kind: Self.syntaxKind, - from: children.map { $0.raw }, + from: children.map { Syntax($0) }, arena: arena ) } diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesAB.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesAB.swift index 064956b730b..5c72cddb108 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesAB.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesAB.swift @@ -133,21 +133,21 @@ public struct AccessorBlockSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftBrace), + Syntax(leftBrace), + Syntax(unexpectedBetweenLeftBraceAndAccessors), + Syntax(accessors), + Syntax(unexpectedBetweenAccessorsAndRightBrace), + Syntax(rightBrace), + Syntax(unexpectedAfterRightBrace) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeftBrace?.raw, - leftBrace.raw, - unexpectedBetweenLeftBraceAndAccessors?.raw, - accessors.raw, - unexpectedBetweenAccessorsAndRightBrace?.raw, - rightBrace.raw, - unexpectedAfterRightBrace?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.accessorBlock, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -155,15 +155,6 @@ public struct AccessorBlockSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLeftBrace), - Syntax(leftBrace), - Syntax(unexpectedBetweenLeftBraceAndAccessors), - Syntax(accessors), - Syntax(unexpectedBetweenAccessorsAndRightBrace), - Syntax(rightBrace), - Syntax(unexpectedAfterRightBrace) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -296,34 +287,6 @@ public struct AccessorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAttributes?.raw, - attributes.raw, - unexpectedBetweenAttributesAndModifier?.raw, - modifier?.raw, - unexpectedBetweenModifierAndAccessorSpecifier?.raw, - accessorSpecifier.raw, - unexpectedBetweenAccessorSpecifierAndParameters?.raw, - parameters?.raw, - unexpectedBetweenParametersAndEffectSpecifiers?.raw, - effectSpecifiers?.raw, - unexpectedBetweenEffectSpecifiersAndBody?.raw, - body?.raw, - unexpectedAfterBody?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.accessorDecl, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeAttributes), Syntax(attributes), @@ -339,6 +302,19 @@ public struct AccessorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS Syntax(body), Syntax(unexpectedAfterBody) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.accessorDecl, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -375,7 +351,7 @@ public struct AccessorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -554,19 +530,19 @@ public struct AccessorEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashable, _L trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAsyncSpecifier), + Syntax(asyncSpecifier), + Syntax(unexpectedBetweenAsyncSpecifierAndThrowsClause), + Syntax(throwsClause), + Syntax(unexpectedAfterThrowsClause) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAsyncSpecifier?.raw, - asyncSpecifier?.raw, - unexpectedBetweenAsyncSpecifierAndThrowsClause?.raw, - throwsClause?.raw, - unexpectedAfterThrowsClause?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.accessorEffectSpecifiers, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -574,13 +550,6 @@ public struct AccessorEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashable, _L ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeAsyncSpecifier), - Syntax(asyncSpecifier), - Syntax(unexpectedBetweenAsyncSpecifierAndThrowsClause), - Syntax(throwsClause), - Syntax(unexpectedAfterThrowsClause) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -680,21 +649,21 @@ public struct AccessorParametersSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeftParen?.raw, - leftParen.raw, - unexpectedBetweenLeftParenAndName?.raw, - name.raw, - unexpectedBetweenNameAndRightParen?.raw, - rightParen.raw, - unexpectedAfterRightParen?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.accessorParameters, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -702,15 +671,6 @@ public struct AccessorParametersSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndName), - Syntax(name), - Syntax(unexpectedBetweenNameAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -849,38 +809,6 @@ public struct ActorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAttributes?.raw, - attributes.raw, - unexpectedBetweenAttributesAndModifiers?.raw, - modifiers.raw, - unexpectedBetweenModifiersAndActorKeyword?.raw, - actorKeyword.raw, - unexpectedBetweenActorKeywordAndName?.raw, - name.raw, - unexpectedBetweenNameAndGenericParameterClause?.raw, - genericParameterClause?.raw, - unexpectedBetweenGenericParameterClauseAndInheritanceClause?.raw, - inheritanceClause?.raw, - unexpectedBetweenInheritanceClauseAndGenericWhereClause?.raw, - genericWhereClause?.raw, - unexpectedBetweenGenericWhereClauseAndMemberBlock?.raw, - memberBlock.raw, - unexpectedAfterMemberBlock?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.actorDecl, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeAttributes), Syntax(attributes), @@ -900,6 +828,19 @@ public struct ActorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt Syntax(memberBlock), Syntax(unexpectedAfterMemberBlock) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.actorDecl, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -936,7 +877,7 @@ public struct ActorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -982,7 +923,7 @@ public struct ActorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -1179,19 +1120,19 @@ public struct ArrayElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeExpression?.raw, - expression.raw, - unexpectedBetweenExpressionAndTrailingComma?.raw, - trailingComma?.raw, - unexpectedAfterTrailingComma?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.arrayElement, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1199,13 +1140,6 @@ public struct ArrayElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeExpression), - Syntax(expression), - Syntax(unexpectedBetweenExpressionAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1300,21 +1234,21 @@ public struct ArrayExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftSquare), + Syntax(leftSquare), + Syntax(unexpectedBetweenLeftSquareAndElements), + Syntax(elements), + Syntax(unexpectedBetweenElementsAndRightSquare), + Syntax(rightSquare), + Syntax(unexpectedAfterRightSquare) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeftSquare?.raw, - leftSquare.raw, - unexpectedBetweenLeftSquareAndElements?.raw, - elements.raw, - unexpectedBetweenElementsAndRightSquare?.raw, - rightSquare.raw, - unexpectedAfterRightSquare?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.arrayExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1322,15 +1256,6 @@ public struct ArrayExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLeftSquare), - Syntax(leftSquare), - Syntax(unexpectedBetweenLeftSquareAndElements), - Syntax(elements), - Syntax(unexpectedBetweenElementsAndRightSquare), - Syntax(rightSquare), - Syntax(unexpectedAfterRightSquare) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1388,7 +1313,7 @@ public struct ArrayExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.arrayElementList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -1473,21 +1398,21 @@ public struct ArrayTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSynt trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftSquare), + Syntax(leftSquare), + Syntax(unexpectedBetweenLeftSquareAndElement), + Syntax(element), + Syntax(unexpectedBetweenElementAndRightSquare), + Syntax(rightSquare), + Syntax(unexpectedAfterRightSquare) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeftSquare?.raw, - leftSquare.raw, - unexpectedBetweenLeftSquareAndElement?.raw, - element.raw, - unexpectedBetweenElementAndRightSquare?.raw, - rightSquare.raw, - unexpectedAfterRightSquare?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.arrayType, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1495,15 +1420,6 @@ public struct ArrayTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLeftSquare), - Syntax(leftSquare), - Syntax(unexpectedBetweenLeftSquareAndElement), - Syntax(element), - Syntax(unexpectedBetweenElementAndRightSquare), - Syntax(rightSquare), - Syntax(unexpectedAfterRightSquare) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1626,19 +1542,19 @@ public struct ArrowExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeEffectSpecifiers), + Syntax(effectSpecifiers), + Syntax(unexpectedBetweenEffectSpecifiersAndArrow), + Syntax(arrow), + Syntax(unexpectedAfterArrow) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeEffectSpecifiers?.raw, - effectSpecifiers?.raw, - unexpectedBetweenEffectSpecifiersAndArrow?.raw, - arrow.raw, - unexpectedAfterArrow?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.arrowExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1646,13 +1562,6 @@ public struct ArrowExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeEffectSpecifiers), - Syntax(effectSpecifiers), - Syntax(unexpectedBetweenEffectSpecifiersAndArrow), - Syntax(arrow), - Syntax(unexpectedAfterArrow) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1763,23 +1672,23 @@ public struct AsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndAsKeyword), + Syntax(asKeyword), + Syntax(unexpectedBetweenAsKeywordAndQuestionOrExclamationMark), + Syntax(questionOrExclamationMark), + Syntax(unexpectedBetweenQuestionOrExclamationMarkAndType), + Syntax(type), + Syntax(unexpectedAfterType) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeExpression?.raw, - expression.raw, - unexpectedBetweenExpressionAndAsKeyword?.raw, - asKeyword.raw, - unexpectedBetweenAsKeywordAndQuestionOrExclamationMark?.raw, - questionOrExclamationMark?.raw, - unexpectedBetweenQuestionOrExclamationMarkAndType?.raw, - type.raw, - unexpectedAfterType?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.asExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1787,17 +1696,6 @@ public struct AsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeExpression), - Syntax(expression), - Syntax(unexpectedBetweenExpressionAndAsKeyword), - Syntax(asKeyword), - Syntax(unexpectedBetweenAsKeywordAndQuestionOrExclamationMark), - Syntax(questionOrExclamationMark), - Syntax(unexpectedBetweenQuestionOrExclamationMarkAndType), - Syntax(type), - Syntax(unexpectedAfterType) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1929,13 +1827,13 @@ public struct AssignmentExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExp trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforeEqual), Syntax(equal), Syntax(unexpectedAfterEqual)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforeEqual?.raw, equal.raw, unexpectedAfterEqual?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.assignmentExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1943,7 +1841,6 @@ public struct AssignmentExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExp ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforeEqual), Syntax(equal), Syntax(unexpectedAfterEqual)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2057,36 +1954,6 @@ public struct AssociatedTypeDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAttributes?.raw, - attributes.raw, - unexpectedBetweenAttributesAndModifiers?.raw, - modifiers.raw, - unexpectedBetweenModifiersAndAssociatedtypeKeyword?.raw, - associatedtypeKeyword.raw, - unexpectedBetweenAssociatedtypeKeywordAndName?.raw, - name.raw, - unexpectedBetweenNameAndInheritanceClause?.raw, - inheritanceClause?.raw, - unexpectedBetweenInheritanceClauseAndInitializer?.raw, - initializer?.raw, - unexpectedBetweenInitializerAndGenericWhereClause?.raw, - genericWhereClause?.raw, - unexpectedAfterGenericWhereClause?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.associatedTypeDecl, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeAttributes), Syntax(attributes), @@ -2104,6 +1971,19 @@ public struct AssociatedTypeDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea Syntax(genericWhereClause), Syntax(unexpectedAfterGenericWhereClause) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.associatedTypeDecl, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2141,7 +2021,7 @@ public struct AssociatedTypeDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -2187,7 +2067,7 @@ public struct AssociatedTypeDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -3077,32 +2957,6 @@ public struct AttributeSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodePr trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAtSign?.raw, - atSign.raw, - unexpectedBetweenAtSignAndAttributeName?.raw, - attributeName.raw, - unexpectedBetweenAttributeNameAndLeftParen?.raw, - leftParen?.raw, - unexpectedBetweenLeftParenAndArguments?.raw, - arguments?.raw, - unexpectedBetweenArgumentsAndRightParen?.raw, - rightParen?.raw, - unexpectedAfterRightParen?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.attribute, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeAtSign), Syntax(atSign), @@ -3116,6 +2970,19 @@ public struct AttributeSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodePr Syntax(rightParen), Syntax(unexpectedAfterRightParen) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.attribute, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3288,21 +3155,21 @@ public struct AttributedTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeSpecifiers), + Syntax(specifiers), + Syntax(unexpectedBetweenSpecifiersAndAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndBaseType), + Syntax(baseType), + Syntax(unexpectedAfterBaseType) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeSpecifiers?.raw, - specifiers.raw, - unexpectedBetweenSpecifiersAndAttributes?.raw, - attributes.raw, - unexpectedBetweenAttributesAndBaseType?.raw, - baseType.raw, - unexpectedAfterBaseType?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.attributedType, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3310,15 +3177,6 @@ public struct AttributedTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeSpecifiers), - Syntax(specifiers), - Syntax(unexpectedBetweenSpecifiersAndAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndBaseType), - Syntax(baseType), - Syntax(unexpectedAfterBaseType) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3356,7 +3214,7 @@ public struct AttributedTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.typeSpecifierList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -3402,7 +3260,7 @@ public struct AttributedTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -3605,19 +3463,19 @@ public struct AvailabilityArgumentSyntax: SyntaxProtocol, SyntaxHashable, _LeafS trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeArgument), + Syntax(argument), + Syntax(unexpectedBetweenArgumentAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeArgument?.raw, - argument.raw, - unexpectedBetweenArgumentAndTrailingComma?.raw, - trailingComma?.raw, - unexpectedAfterTrailingComma?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.availabilityArgument, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3625,13 +3483,6 @@ public struct AvailabilityArgumentSyntax: SyntaxProtocol, SyntaxHashable, _LeafS ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeArgument), - Syntax(argument), - Syntax(unexpectedBetweenArgumentAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3734,23 +3585,23 @@ public struct AvailabilityConditionSyntax: SyntaxProtocol, SyntaxHashable, _Leaf trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAvailabilityKeyword), + Syntax(availabilityKeyword), + Syntax(unexpectedBetweenAvailabilityKeywordAndLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndAvailabilityArguments), + Syntax(availabilityArguments), + Syntax(unexpectedBetweenAvailabilityArgumentsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAvailabilityKeyword?.raw, - availabilityKeyword.raw, - unexpectedBetweenAvailabilityKeywordAndLeftParen?.raw, - leftParen.raw, - unexpectedBetweenLeftParenAndAvailabilityArguments?.raw, - availabilityArguments.raw, - unexpectedBetweenAvailabilityArgumentsAndRightParen?.raw, - rightParen.raw, - unexpectedAfterRightParen?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.availabilityCondition, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3758,17 +3609,6 @@ public struct AvailabilityConditionSyntax: SyntaxProtocol, SyntaxHashable, _Leaf ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeAvailabilityKeyword), - Syntax(availabilityKeyword), - Syntax(unexpectedBetweenAvailabilityKeywordAndLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndAvailabilityArguments), - Syntax(availabilityArguments), - Syntax(unexpectedBetweenAvailabilityArgumentsAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3849,7 +3689,7 @@ public struct AvailabilityConditionSyntax: SyntaxProtocol, SyntaxHashable, _Leaf collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.availabilityArgumentList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -4027,21 +3867,21 @@ public struct AvailabilityLabeledArgumentSyntax: SyntaxProtocol, SyntaxHashable, trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLabel), + Syntax(label), + Syntax(unexpectedBetweenLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndValue), + Syntax(value), + Syntax(unexpectedAfterValue) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLabel?.raw, - label.raw, - unexpectedBetweenLabelAndColon?.raw, - colon.raw, - unexpectedBetweenColonAndValue?.raw, - value.raw, - unexpectedAfterValue?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.availabilityLabeledArgument, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4049,15 +3889,6 @@ public struct AvailabilityLabeledArgumentSyntax: SyntaxProtocol, SyntaxHashable, ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLabel), - Syntax(label), - Syntax(unexpectedBetweenLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndValue), - Syntax(value), - Syntax(unexpectedAfterValue) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4180,19 +4011,19 @@ public struct AwaitExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAwaitKeyword), + Syntax(awaitKeyword), + Syntax(unexpectedBetweenAwaitKeywordAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAwaitKeyword?.raw, - awaitKeyword.raw, - unexpectedBetweenAwaitKeywordAndExpression?.raw, - expression.raw, - unexpectedAfterExpression?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.awaitExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4200,13 +4031,6 @@ public struct AwaitExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeAwaitKeyword), - Syntax(awaitKeyword), - Syntax(unexpectedBetweenAwaitKeywordAndExpression), - Syntax(expression), - Syntax(unexpectedAfterExpression) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4308,21 +4132,21 @@ public struct BackDeployedAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashab trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeBeforeLabel), + Syntax(beforeLabel), + Syntax(unexpectedBetweenBeforeLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndPlatforms), + Syntax(platforms), + Syntax(unexpectedAfterPlatforms) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeBeforeLabel?.raw, - beforeLabel.raw, - unexpectedBetweenBeforeLabelAndColon?.raw, - colon.raw, - unexpectedBetweenColonAndPlatforms?.raw, - platforms.raw, - unexpectedAfterPlatforms?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.backDeployedAttributeArguments, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4330,15 +4154,6 @@ public struct BackDeployedAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashab ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeBeforeLabel), - Syntax(beforeLabel), - Syntax(unexpectedBetweenBeforeLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndPlatforms), - Syntax(platforms), - Syntax(unexpectedAfterPlatforms) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4422,7 +4237,7 @@ public struct BackDeployedAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashab collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.platformVersionItemList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -4486,13 +4301,13 @@ public struct BinaryOperatorExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforeOperator), Syntax(`operator`), Syntax(unexpectedAfterOperator)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforeOperator?.raw, `operator`.raw, unexpectedAfterOperator?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.binaryOperatorExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4500,7 +4315,6 @@ public struct BinaryOperatorExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforeOperator), Syntax(`operator`), Syntax(unexpectedAfterOperator)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4563,13 +4377,13 @@ public struct BooleanLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforeLiteral), Syntax(literal), Syntax(unexpectedAfterLiteral)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforeLiteral?.raw, literal.raw, unexpectedAfterLiteral?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.booleanLiteralExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4577,7 +4391,6 @@ public struct BooleanLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforeLiteral), Syntax(literal), Syntax(unexpectedAfterLiteral)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4645,19 +4458,19 @@ public struct BorrowExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyn trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeBorrowKeyword), + Syntax(borrowKeyword), + Syntax(unexpectedBetweenBorrowKeywordAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeBorrowKeyword?.raw, - borrowKeyword.raw, - unexpectedBetweenBorrowKeywordAndExpression?.raw, - expression.raw, - unexpectedAfterExpression?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.borrowExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4665,13 +4478,6 @@ public struct BorrowExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyn ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeBorrowKeyword), - Syntax(borrowKeyword), - Syntax(unexpectedBetweenBorrowKeywordAndExpression), - Syntax(expression), - Syntax(unexpectedAfterExpression) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4761,19 +4567,19 @@ public struct BreakStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeBreakKeyword), + Syntax(breakKeyword), + Syntax(unexpectedBetweenBreakKeywordAndLabel), + Syntax(label), + Syntax(unexpectedAfterLabel) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeBreakKeyword?.raw, - breakKeyword.raw, - unexpectedBetweenBreakKeywordAndLabel?.raw, - label?.raw, - unexpectedAfterLabel?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.breakStmt, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4781,13 +4587,6 @@ public struct BreakStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeBreakKeyword), - Syntax(breakKeyword), - Syntax(unexpectedBetweenBreakKeywordAndLabel), - Syntax(label), - Syntax(unexpectedAfterLabel) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesC.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesC.swift index 5916ccef018..5cc11527e69 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesC.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesC.swift @@ -50,32 +50,6 @@ public struct _CanImportExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExp trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeCanImportKeyword?.raw, - canImportKeyword.raw, - unexpectedBetweenCanImportKeywordAndLeftParen?.raw, - leftParen.raw, - unexpectedBetweenLeftParenAndImportPath?.raw, - importPath.raw, - unexpectedBetweenImportPathAndVersionInfo?.raw, - versionInfo?.raw, - unexpectedBetweenVersionInfoAndRightParen?.raw, - rightParen.raw, - unexpectedAfterRightParen?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind._canImportExpr, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeCanImportKeyword), Syntax(canImportKeyword), @@ -89,6 +63,19 @@ public struct _CanImportExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExp Syntax(rightParen), Syntax(unexpectedAfterRightParen) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind._canImportExpr, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -257,23 +244,23 @@ public struct _CanImportVersionInfoSyntax: ExprSyntaxProtocol, SyntaxHashable, _ trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeComma), + Syntax(comma), + Syntax(unexpectedBetweenCommaAndLabel), + Syntax(label), + Syntax(unexpectedBetweenLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndVersion), + Syntax(version), + Syntax(unexpectedAfterVersion) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeComma?.raw, - comma.raw, - unexpectedBetweenCommaAndLabel?.raw, - label.raw, - unexpectedBetweenLabelAndColon?.raw, - colon.raw, - unexpectedBetweenColonAndVersion?.raw, - version.raw, - unexpectedAfterVersion?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind._canImportVersionInfo, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -281,17 +268,6 @@ public struct _CanImportVersionInfoSyntax: ExprSyntaxProtocol, SyntaxHashable, _ ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeComma), - Syntax(comma), - Syntax(unexpectedBetweenCommaAndLabel), - Syntax(label), - Syntax(unexpectedBetweenLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndVersion), - Syntax(version), - Syntax(unexpectedAfterVersion) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -436,21 +412,21 @@ public struct CatchClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeCatchKeyword), + Syntax(catchKeyword), + Syntax(unexpectedBetweenCatchKeywordAndCatchItems), + Syntax(catchItems), + Syntax(unexpectedBetweenCatchItemsAndBody), + Syntax(body), + Syntax(unexpectedAfterBody) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeCatchKeyword?.raw, - catchKeyword.raw, - unexpectedBetweenCatchKeywordAndCatchItems?.raw, - catchItems.raw, - unexpectedBetweenCatchItemsAndBody?.raw, - body.raw, - unexpectedAfterBody?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.catchClause, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -458,15 +434,6 @@ public struct CatchClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeCatchKeyword), - Syntax(catchKeyword), - Syntax(unexpectedBetweenCatchKeywordAndCatchItems), - Syntax(catchItems), - Syntax(unexpectedBetweenCatchItemsAndBody), - Syntax(body), - Syntax(unexpectedAfterBody) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -524,7 +491,7 @@ public struct CatchClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.catchItemList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -610,21 +577,21 @@ public struct CatchItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodePr trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforePattern), + Syntax(pattern), + Syntax(unexpectedBetweenPatternAndWhereClause), + Syntax(whereClause), + Syntax(unexpectedBetweenWhereClauseAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforePattern?.raw, - pattern?.raw, - unexpectedBetweenPatternAndWhereClause?.raw, - whereClause?.raw, - unexpectedBetweenWhereClauseAndTrailingComma?.raw, - trailingComma?.raw, - unexpectedAfterTrailingComma?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.catchItem, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -632,15 +599,6 @@ public struct CatchItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodePr ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforePattern), - Syntax(pattern), - Syntax(unexpectedBetweenPatternAndWhereClause), - Syntax(whereClause), - Syntax(unexpectedBetweenWhereClauseAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -800,38 +758,6 @@ public struct ClassDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAttributes?.raw, - attributes.raw, - unexpectedBetweenAttributesAndModifiers?.raw, - modifiers.raw, - unexpectedBetweenModifiersAndClassKeyword?.raw, - classKeyword.raw, - unexpectedBetweenClassKeywordAndName?.raw, - name.raw, - unexpectedBetweenNameAndGenericParameterClause?.raw, - genericParameterClause?.raw, - unexpectedBetweenGenericParameterClauseAndInheritanceClause?.raw, - inheritanceClause?.raw, - unexpectedBetweenInheritanceClauseAndGenericWhereClause?.raw, - genericWhereClause?.raw, - unexpectedBetweenGenericWhereClauseAndMemberBlock?.raw, - memberBlock.raw, - unexpectedAfterMemberBlock?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.classDecl, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeAttributes), Syntax(attributes), @@ -851,6 +777,19 @@ public struct ClassDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt Syntax(memberBlock), Syntax(unexpectedAfterMemberBlock) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.classDecl, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -888,7 +827,7 @@ public struct ClassDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -934,7 +873,7 @@ public struct ClassDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -1124,13 +1063,13 @@ public struct ClassRestrictionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _L trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforeClassKeyword), Syntax(classKeyword), Syntax(unexpectedAfterClassKeyword)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforeClassKeyword?.raw, classKeyword.raw, unexpectedAfterClassKeyword?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.classRestrictionType, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1138,7 +1077,6 @@ public struct ClassRestrictionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _L ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforeClassKeyword), Syntax(classKeyword), Syntax(unexpectedAfterClassKeyword)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1211,21 +1149,21 @@ public struct ClosureCaptureClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafS trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftSquare), + Syntax(leftSquare), + Syntax(unexpectedBetweenLeftSquareAndItems), + Syntax(items), + Syntax(unexpectedBetweenItemsAndRightSquare), + Syntax(rightSquare), + Syntax(unexpectedAfterRightSquare) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeftSquare?.raw, - leftSquare.raw, - unexpectedBetweenLeftSquareAndItems?.raw, - items.raw, - unexpectedBetweenItemsAndRightSquare?.raw, - rightSquare.raw, - unexpectedAfterRightSquare?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.closureCaptureClause, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1233,15 +1171,6 @@ public struct ClosureCaptureClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafS ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLeftSquare), - Syntax(leftSquare), - Syntax(unexpectedBetweenLeftSquareAndItems), - Syntax(items), - Syntax(unexpectedBetweenItemsAndRightSquare), - Syntax(rightSquare), - Syntax(unexpectedAfterRightSquare) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1299,7 +1228,7 @@ public struct ClosureCaptureClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafS collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.closureCaptureList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -1391,23 +1320,23 @@ public struct ClosureCaptureSpecifierSyntax: SyntaxProtocol, SyntaxHashable, _Le trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeSpecifier), + Syntax(specifier), + Syntax(unexpectedBetweenSpecifierAndLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndDetail), + Syntax(detail), + Syntax(unexpectedBetweenDetailAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeSpecifier?.raw, - specifier.raw, - unexpectedBetweenSpecifierAndLeftParen?.raw, - leftParen?.raw, - unexpectedBetweenLeftParenAndDetail?.raw, - detail?.raw, - unexpectedBetweenDetailAndRightParen?.raw, - rightParen?.raw, - unexpectedAfterRightParen?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.closureCaptureSpecifier, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1415,17 +1344,6 @@ public struct ClosureCaptureSpecifierSyntax: SyntaxProtocol, SyntaxHashable, _Le ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeSpecifier), - Syntax(specifier), - Syntax(unexpectedBetweenSpecifierAndLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndDetail), - Syntax(detail), - Syntax(unexpectedBetweenDetailAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1581,32 +1499,6 @@ public struct ClosureCaptureSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeSpecifier?.raw, - specifier?.raw, - unexpectedBetweenSpecifierAndName?.raw, - name?.raw, - unexpectedBetweenNameAndEqual?.raw, - equal?.raw, - unexpectedBetweenEqualAndExpression?.raw, - expression.raw, - unexpectedBetweenExpressionAndTrailingComma?.raw, - trailingComma?.raw, - unexpectedAfterTrailingComma?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.closureCapture, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeSpecifier), Syntax(specifier), @@ -1620,6 +1512,19 @@ public struct ClosureCaptureSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN Syntax(trailingComma), Syntax(unexpectedAfterTrailingComma) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.closureCapture, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1789,23 +1694,23 @@ public struct ClosureExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftBrace), + Syntax(leftBrace), + Syntax(unexpectedBetweenLeftBraceAndSignature), + Syntax(signature), + Syntax(unexpectedBetweenSignatureAndStatements), + Syntax(statements), + Syntax(unexpectedBetweenStatementsAndRightBrace), + Syntax(rightBrace), + Syntax(unexpectedAfterRightBrace) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeftBrace?.raw, - leftBrace.raw, - unexpectedBetweenLeftBraceAndSignature?.raw, - signature?.raw, - unexpectedBetweenSignatureAndStatements?.raw, - statements.raw, - unexpectedBetweenStatementsAndRightBrace?.raw, - rightBrace.raw, - unexpectedAfterRightBrace?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.closureExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1813,17 +1718,6 @@ public struct ClosureExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLeftBrace), - Syntax(leftBrace), - Syntax(unexpectedBetweenLeftBraceAndSignature), - Syntax(signature), - Syntax(unexpectedBetweenSignatureAndStatements), - Syntax(statements), - Syntax(unexpectedBetweenStatementsAndRightBrace), - Syntax(rightBrace), - Syntax(unexpectedAfterRightBrace) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1899,7 +1793,7 @@ public struct ClosureExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.codeBlockItemList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -1993,21 +1887,21 @@ public struct ClosureParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Lea trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndParameters), + Syntax(parameters), + Syntax(unexpectedBetweenParametersAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeftParen?.raw, - leftParen.raw, - unexpectedBetweenLeftParenAndParameters?.raw, - parameters.raw, - unexpectedBetweenParametersAndRightParen?.raw, - rightParen.raw, - unexpectedAfterRightParen?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.closureParameterClause, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -2015,15 +1909,6 @@ public struct ClosureParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Lea ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndParameters), - Syntax(parameters), - Syntax(unexpectedBetweenParametersAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2084,7 +1969,7 @@ public struct ClosureParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Lea collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.closureParameterList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -2196,38 +2081,6 @@ public struct ClosureParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAttributes?.raw, - attributes.raw, - unexpectedBetweenAttributesAndModifiers?.raw, - modifiers.raw, - unexpectedBetweenModifiersAndFirstName?.raw, - firstName.raw, - unexpectedBetweenFirstNameAndSecondName?.raw, - secondName?.raw, - unexpectedBetweenSecondNameAndColon?.raw, - colon?.raw, - unexpectedBetweenColonAndType?.raw, - type?.raw, - unexpectedBetweenTypeAndEllipsis?.raw, - ellipsis?.raw, - unexpectedBetweenEllipsisAndTrailingComma?.raw, - trailingComma?.raw, - unexpectedAfterTrailingComma?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.closureParameter, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeAttributes), Syntax(attributes), @@ -2247,6 +2100,19 @@ public struct ClosureParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta Syntax(trailingComma), Syntax(unexpectedAfterTrailingComma) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.closureParameter, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2283,7 +2149,7 @@ public struct ClosureParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -2328,7 +2194,7 @@ public struct ClosureParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -2541,19 +2407,19 @@ public struct ClosureShorthandParameterSyntax: SyntaxProtocol, SyntaxHashable, _ trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeName), + Syntax(name), + Syntax(unexpectedBetweenNameAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeName?.raw, - name.raw, - unexpectedBetweenNameAndTrailingComma?.raw, - trailingComma?.raw, - unexpectedAfterTrailingComma?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.closureShorthandParameter, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -2561,13 +2427,6 @@ public struct ClosureShorthandParameterSyntax: SyntaxProtocol, SyntaxHashable, _ ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeName), - Syntax(name), - Syntax(unexpectedBetweenNameAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2760,34 +2619,6 @@ public struct ClosureSignatureSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAttributes?.raw, - attributes.raw, - unexpectedBetweenAttributesAndCapture?.raw, - capture?.raw, - unexpectedBetweenCaptureAndParameterClause?.raw, - parameterClause?.raw, - unexpectedBetweenParameterClauseAndEffectSpecifiers?.raw, - effectSpecifiers?.raw, - unexpectedBetweenEffectSpecifiersAndReturnClause?.raw, - returnClause?.raw, - unexpectedBetweenReturnClauseAndInKeyword?.raw, - inKeyword.raw, - unexpectedAfterInKeyword?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.closureSignature, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeAttributes), Syntax(attributes), @@ -2803,6 +2634,19 @@ public struct ClosureSignatureSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta Syntax(inKeyword), Syntax(unexpectedAfterInKeyword) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.closureSignature, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2839,7 +2683,7 @@ public struct ClosureSignatureSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -3122,19 +2966,19 @@ public struct CodeBlockItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeItem), + Syntax(item), + Syntax(unexpectedBetweenItemAndSemicolon), + Syntax(semicolon), + Syntax(unexpectedAfterSemicolon) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeItem?.raw, - item.raw, - unexpectedBetweenItemAndSemicolon?.raw, - semicolon?.raw, - unexpectedAfterSemicolon?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.codeBlockItem, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3142,13 +2986,6 @@ public struct CodeBlockItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeItem), - Syntax(item), - Syntax(unexpectedBetweenItemAndSemicolon), - Syntax(semicolon), - Syntax(unexpectedAfterSemicolon) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3262,21 +3099,21 @@ public struct CodeBlockSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodePr trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftBrace), + Syntax(leftBrace), + Syntax(unexpectedBetweenLeftBraceAndStatements), + Syntax(statements), + Syntax(unexpectedBetweenStatementsAndRightBrace), + Syntax(rightBrace), + Syntax(unexpectedAfterRightBrace) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeftBrace?.raw, - leftBrace.raw, - unexpectedBetweenLeftBraceAndStatements?.raw, - statements.raw, - unexpectedBetweenStatementsAndRightBrace?.raw, - rightBrace.raw, - unexpectedAfterRightBrace?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.codeBlock, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3284,15 +3121,6 @@ public struct CodeBlockSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodePr ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLeftBrace), - Syntax(leftBrace), - Syntax(unexpectedBetweenLeftBraceAndStatements), - Syntax(statements), - Syntax(unexpectedBetweenStatementsAndRightBrace), - Syntax(rightBrace), - Syntax(unexpectedAfterRightBrace) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3352,7 +3180,7 @@ public struct CodeBlockSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodePr collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.codeBlockItemList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -3440,19 +3268,19 @@ public struct CompositionTypeElementSyntax: SyntaxProtocol, SyntaxHashable, _Lea trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeType), + Syntax(type), + Syntax(unexpectedBetweenTypeAndAmpersand), + Syntax(ampersand), + Syntax(unexpectedAfterAmpersand) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeType?.raw, - type.raw, - unexpectedBetweenTypeAndAmpersand?.raw, - ampersand?.raw, - unexpectedAfterAmpersand?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.compositionTypeElement, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3460,13 +3288,6 @@ public struct CompositionTypeElementSyntax: SyntaxProtocol, SyntaxHashable, _Lea ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeType), - Syntax(type), - Syntax(unexpectedBetweenTypeAndAmpersand), - Syntax(ampersand), - Syntax(unexpectedAfterAmpersand) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3550,13 +3371,13 @@ public struct CompositionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTy trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforeElements), Syntax(elements), Syntax(unexpectedAfterElements)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforeElements?.raw, elements.raw, unexpectedAfterElements?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.compositionType, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3564,7 +3385,6 @@ public struct CompositionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforeElements), Syntax(elements), Syntax(unexpectedAfterElements)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3601,7 +3421,7 @@ public struct CompositionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTy collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.compositionTypeElementList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -3811,19 +3631,19 @@ public struct ConditionElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeCondition), + Syntax(condition), + Syntax(unexpectedBetweenConditionAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeCondition?.raw, - condition.raw, - unexpectedBetweenConditionAndTrailingComma?.raw, - trailingComma?.raw, - unexpectedAfterTrailingComma?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.conditionElement, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3831,13 +3651,6 @@ public struct ConditionElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeCondition), - Syntax(condition), - Syntax(unexpectedBetweenConditionAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3934,21 +3747,21 @@ public struct ConformanceRequirementSyntax: SyntaxProtocol, SyntaxHashable, _Lea trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftType), + Syntax(leftType), + Syntax(unexpectedBetweenLeftTypeAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndRightType), + Syntax(rightType), + Syntax(unexpectedAfterRightType) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeftType?.raw, - leftType.raw, - unexpectedBetweenLeftTypeAndColon?.raw, - colon.raw, - unexpectedBetweenColonAndRightType?.raw, - rightType.raw, - unexpectedAfterRightType?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.conformanceRequirement, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3956,15 +3769,6 @@ public struct ConformanceRequirementSyntax: SyntaxProtocol, SyntaxHashable, _Lea ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLeftType), - Syntax(leftType), - Syntax(unexpectedBetweenLeftTypeAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndRightType), - Syntax(rightType), - Syntax(unexpectedAfterRightType) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4074,19 +3878,19 @@ public struct ConsumeExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeConsumeKeyword), + Syntax(consumeKeyword), + Syntax(unexpectedBetweenConsumeKeywordAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeConsumeKeyword?.raw, - consumeKeyword.raw, - unexpectedBetweenConsumeKeywordAndExpression?.raw, - expression.raw, - unexpectedAfterExpression?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.consumeExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4094,13 +3898,6 @@ public struct ConsumeExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeConsumeKeyword), - Syntax(consumeKeyword), - Syntax(unexpectedBetweenConsumeKeywordAndExpression), - Syntax(expression), - Syntax(unexpectedAfterExpression) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4192,19 +3989,19 @@ public struct ContinueStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtS trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeContinueKeyword), + Syntax(continueKeyword), + Syntax(unexpectedBetweenContinueKeywordAndLabel), + Syntax(label), + Syntax(unexpectedAfterLabel) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeContinueKeyword?.raw, - continueKeyword.raw, - unexpectedBetweenContinueKeywordAndLabel?.raw, - label?.raw, - unexpectedAfterLabel?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.continueStmt, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4212,13 +4009,6 @@ public struct ContinueStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtS ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeContinueKeyword), - Syntax(continueKeyword), - Syntax(unexpectedBetweenContinueKeywordAndLabel), - Syntax(label), - Syntax(unexpectedAfterLabel) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4327,32 +4117,6 @@ public struct ConventionAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeConventionLabel?.raw, - conventionLabel.raw, - unexpectedBetweenConventionLabelAndComma?.raw, - comma?.raw, - unexpectedBetweenCommaAndCTypeLabel?.raw, - cTypeLabel?.raw, - unexpectedBetweenCTypeLabelAndColon?.raw, - colon?.raw, - unexpectedBetweenColonAndCTypeString?.raw, - cTypeString?.raw, - unexpectedAfterCTypeString?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.conventionAttributeArguments, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeConventionLabel), Syntax(conventionLabel), @@ -4366,6 +4130,19 @@ public struct ConventionAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable Syntax(cTypeString), Syntax(unexpectedAfterCTypeString) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.conventionAttributeArguments, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4538,21 +4315,21 @@ public struct ConventionWitnessMethodAttributeArgumentsSyntax: SyntaxProtocol, S trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeWitnessMethodLabel), + Syntax(witnessMethodLabel), + Syntax(unexpectedBetweenWitnessMethodLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndProtocolName), + Syntax(protocolName), + Syntax(unexpectedAfterProtocolName) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeWitnessMethodLabel?.raw, - witnessMethodLabel.raw, - unexpectedBetweenWitnessMethodLabelAndColon?.raw, - colon.raw, - unexpectedBetweenColonAndProtocolName?.raw, - protocolName.raw, - unexpectedAfterProtocolName?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.conventionWitnessMethodAttributeArguments, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4560,15 +4337,6 @@ public struct ConventionWitnessMethodAttributeArgumentsSyntax: SyntaxProtocol, S ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeWitnessMethodLabel), - Syntax(witnessMethodLabel), - Syntax(unexpectedBetweenWitnessMethodLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndProtocolName), - Syntax(protocolName), - Syntax(unexpectedAfterProtocolName) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4690,19 +4458,19 @@ public struct CopyExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynta trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeCopyKeyword), + Syntax(copyKeyword), + Syntax(unexpectedBetweenCopyKeywordAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeCopyKeyword?.raw, - copyKeyword.raw, - unexpectedBetweenCopyKeywordAndExpression?.raw, - expression.raw, - unexpectedAfterExpression?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.copyExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4710,13 +4478,6 @@ public struct CopyExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynta ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeCopyKeyword), - Syntax(copyKeyword), - Syntax(unexpectedBetweenCopyKeywordAndExpression), - Syntax(expression), - Syntax(unexpectedAfterExpression) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift index 0b5d35fcff5..9db82adfc02 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift @@ -48,21 +48,21 @@ public struct DeclModifierDetailSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndDetail), + Syntax(detail), + Syntax(unexpectedBetweenDetailAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeftParen?.raw, - leftParen.raw, - unexpectedBetweenLeftParenAndDetail?.raw, - detail.raw, - unexpectedBetweenDetailAndRightParen?.raw, - rightParen.raw, - unexpectedAfterRightParen?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.declModifierDetail, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -70,15 +70,6 @@ public struct DeclModifierDetailSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndDetail), - Syntax(detail), - Syntax(unexpectedBetweenDetailAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -199,19 +190,19 @@ public struct DeclModifierSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeName), + Syntax(name), + Syntax(unexpectedBetweenNameAndDetail), + Syntax(detail), + Syntax(unexpectedAfterDetail) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeName?.raw, - name.raw, - unexpectedBetweenNameAndDetail?.raw, - detail?.raw, - unexpectedAfterDetail?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.declModifier, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -219,13 +210,6 @@ public struct DeclModifierSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeName), - Syntax(name), - Syntax(unexpectedBetweenNameAndDetail), - Syntax(detail), - Syntax(unexpectedAfterDetail) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -355,19 +339,19 @@ public struct DeclNameArgumentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeName), + Syntax(name), + Syntax(unexpectedBetweenNameAndColon), + Syntax(colon), + Syntax(unexpectedAfterColon) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeName?.raw, - name.raw, - unexpectedBetweenNameAndColon?.raw, - colon.raw, - unexpectedAfterColon?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.declNameArgument, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -375,13 +359,6 @@ public struct DeclNameArgumentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeName), - Syntax(name), - Syntax(unexpectedBetweenNameAndColon), - Syntax(colon), - Syntax(unexpectedAfterColon) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -478,21 +455,21 @@ public struct DeclNameArgumentsSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeftParen?.raw, - leftParen.raw, - unexpectedBetweenLeftParenAndArguments?.raw, - arguments.raw, - unexpectedBetweenArgumentsAndRightParen?.raw, - rightParen.raw, - unexpectedAfterRightParen?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.declNameArguments, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -500,15 +477,6 @@ public struct DeclNameArgumentsSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndArguments), - Syntax(arguments), - Syntax(unexpectedBetweenArgumentsAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -566,7 +534,7 @@ public struct DeclNameArgumentsSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.declNameArgumentList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -656,19 +624,19 @@ public struct DeclReferenceExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeBaseName), + Syntax(baseName), + Syntax(unexpectedBetweenBaseNameAndArgumentNames), + Syntax(argumentNames), + Syntax(unexpectedAfterArgumentNames) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeBaseName?.raw, - baseName.raw, - unexpectedBetweenBaseNameAndArgumentNames?.raw, - argumentNames?.raw, - unexpectedAfterArgumentNames?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.declReferenceExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -676,13 +644,6 @@ public struct DeclReferenceExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeBaseName), - Syntax(baseName), - Syntax(unexpectedBetweenBaseNameAndArgumentNames), - Syntax(argumentNames), - Syntax(unexpectedAfterArgumentNames) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -781,19 +742,19 @@ public struct DeferStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeDeferKeyword), + Syntax(deferKeyword), + Syntax(unexpectedBetweenDeferKeywordAndBody), + Syntax(body), + Syntax(unexpectedAfterBody) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeDeferKeyword?.raw, - deferKeyword.raw, - unexpectedBetweenDeferKeywordAndBody?.raw, - body.raw, - unexpectedAfterBody?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.deferStmt, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -801,13 +762,6 @@ public struct DeferStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeDeferKeyword), - Syntax(deferKeyword), - Syntax(unexpectedBetweenDeferKeywordAndBody), - Syntax(body), - Syntax(unexpectedAfterBody) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -919,32 +873,6 @@ public struct DeinitializerDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Leaf trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAttributes?.raw, - attributes.raw, - unexpectedBetweenAttributesAndModifiers?.raw, - modifiers.raw, - unexpectedBetweenModifiersAndDeinitKeyword?.raw, - deinitKeyword.raw, - unexpectedBetweenDeinitKeywordAndEffectSpecifiers?.raw, - effectSpecifiers?.raw, - unexpectedBetweenEffectSpecifiersAndBody?.raw, - body?.raw, - unexpectedAfterBody?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.deinitializerDecl, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeAttributes), Syntax(attributes), @@ -958,6 +886,19 @@ public struct DeinitializerDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Leaf Syntax(body), Syntax(unexpectedAfterBody) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.deinitializerDecl, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -995,7 +936,7 @@ public struct DeinitializerDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Leaf collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -1041,7 +982,7 @@ public struct DeinitializerDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Leaf collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -1168,13 +1109,13 @@ public struct DeinitializerEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashabl trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforeAsyncSpecifier), Syntax(asyncSpecifier), Syntax(unexpectedAfterAsyncSpecifier)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforeAsyncSpecifier?.raw, asyncSpecifier?.raw, unexpectedAfterAsyncSpecifier?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.deinitializerEffectSpecifiers, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1182,7 +1123,6 @@ public struct DeinitializerEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashabl ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforeAsyncSpecifier), Syntax(asyncSpecifier), Syntax(unexpectedAfterAsyncSpecifier)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1276,36 +1216,6 @@ public struct DerivativeAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeOfLabel?.raw, - ofLabel.raw, - unexpectedBetweenOfLabelAndColon?.raw, - colon.raw, - unexpectedBetweenColonAndOriginalDeclName?.raw, - originalDeclName.raw, - unexpectedBetweenOriginalDeclNameAndPeriod?.raw, - period?.raw, - unexpectedBetweenPeriodAndAccessorSpecifier?.raw, - accessorSpecifier?.raw, - unexpectedBetweenAccessorSpecifierAndComma?.raw, - comma?.raw, - unexpectedBetweenCommaAndArguments?.raw, - arguments?.raw, - unexpectedAfterArguments?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.derivativeAttributeArguments, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeOfLabel), Syntax(ofLabel), @@ -1323,6 +1233,19 @@ public struct DerivativeAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable Syntax(arguments), Syntax(unexpectedAfterArguments) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.derivativeAttributeArguments, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1539,19 +1462,19 @@ public struct DesignatedTypeSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeadingComma), + Syntax(leadingComma), + Syntax(unexpectedBetweenLeadingCommaAndName), + Syntax(name), + Syntax(unexpectedAfterName) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeadingComma?.raw, - leadingComma.raw, - unexpectedBetweenLeadingCommaAndName?.raw, - name.raw, - unexpectedAfterName?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.designatedType, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1559,13 +1482,6 @@ public struct DesignatedTypeSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLeadingComma), - Syntax(leadingComma), - Syntax(unexpectedBetweenLeadingCommaAndName), - Syntax(name), - Syntax(unexpectedAfterName) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1667,23 +1583,23 @@ public struct DictionaryElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeKey), + Syntax(key), + Syntax(unexpectedBetweenKeyAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndValue), + Syntax(value), + Syntax(unexpectedBetweenValueAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeKey?.raw, - key.raw, - unexpectedBetweenKeyAndColon?.raw, - colon.raw, - unexpectedBetweenColonAndValue?.raw, - value.raw, - unexpectedBetweenValueAndTrailingComma?.raw, - trailingComma?.raw, - unexpectedAfterTrailingComma?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.dictionaryElement, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1691,17 +1607,6 @@ public struct DictionaryElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeKey), - Syntax(key), - Syntax(unexpectedBetweenKeyAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndValue), - Syntax(value), - Syntax(unexpectedBetweenValueAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1921,21 +1826,21 @@ public struct DictionaryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExp trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftSquare), + Syntax(leftSquare), + Syntax(unexpectedBetweenLeftSquareAndContent), + Syntax(content), + Syntax(unexpectedBetweenContentAndRightSquare), + Syntax(rightSquare), + Syntax(unexpectedAfterRightSquare) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeftSquare?.raw, - leftSquare.raw, - unexpectedBetweenLeftSquareAndContent?.raw, - content.raw, - unexpectedBetweenContentAndRightSquare?.raw, - rightSquare.raw, - unexpectedAfterRightSquare?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.dictionaryExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1943,15 +1848,6 @@ public struct DictionaryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExp ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLeftSquare), - Syntax(leftSquare), - Syntax(unexpectedBetweenLeftSquareAndContent), - Syntax(content), - Syntax(unexpectedBetweenContentAndRightSquare), - Syntax(rightSquare), - Syntax(unexpectedAfterRightSquare) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2073,32 +1969,6 @@ public struct DictionaryTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeftSquare?.raw, - leftSquare.raw, - unexpectedBetweenLeftSquareAndKey?.raw, - key.raw, - unexpectedBetweenKeyAndColon?.raw, - colon.raw, - unexpectedBetweenColonAndValue?.raw, - value.raw, - unexpectedBetweenValueAndRightSquare?.raw, - rightSquare.raw, - unexpectedAfterRightSquare?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.dictionaryType, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeLeftSquare), Syntax(leftSquare), @@ -2112,6 +1982,19 @@ public struct DictionaryTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp Syntax(rightSquare), Syntax(unexpectedAfterRightSquare) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.dictionaryType, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2274,19 +2157,19 @@ public struct DifferentiabilityArgumentSyntax: SyntaxProtocol, SyntaxHashable, _ trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeArgument), + Syntax(argument), + Syntax(unexpectedBetweenArgumentAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeArgument?.raw, - argument.raw, - unexpectedBetweenArgumentAndTrailingComma?.raw, - trailingComma?.raw, - unexpectedAfterTrailingComma?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.differentiabilityArgument, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -2294,13 +2177,6 @@ public struct DifferentiabilityArgumentSyntax: SyntaxProtocol, SyntaxHashable, _ ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeArgument), - Syntax(argument), - Syntax(unexpectedBetweenArgumentAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2406,21 +2282,21 @@ public struct DifferentiabilityArgumentsSyntax: SyntaxProtocol, SyntaxHashable, trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeftParen?.raw, - leftParen.raw, - unexpectedBetweenLeftParenAndArguments?.raw, - arguments.raw, - unexpectedBetweenArgumentsAndRightParen?.raw, - rightParen.raw, - unexpectedAfterRightParen?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.differentiabilityArguments, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -2428,15 +2304,6 @@ public struct DifferentiabilityArgumentsSyntax: SyntaxProtocol, SyntaxHashable, ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndArguments), - Syntax(arguments), - Syntax(unexpectedBetweenArgumentsAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2495,7 +2362,7 @@ public struct DifferentiabilityArgumentsSyntax: SyntaxProtocol, SyntaxHashable, collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.differentiabilityArgumentList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -2671,21 +2538,21 @@ public struct DifferentiabilityWithRespectToArgumentSyntax: SyntaxProtocol, Synt trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeWrtLabel), + Syntax(wrtLabel), + Syntax(unexpectedBetweenWrtLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndArguments), + Syntax(arguments), + Syntax(unexpectedAfterArguments) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeWrtLabel?.raw, - wrtLabel.raw, - unexpectedBetweenWrtLabelAndColon?.raw, - colon.raw, - unexpectedBetweenColonAndArguments?.raw, - arguments.raw, - unexpectedAfterArguments?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.differentiabilityWithRespectToArgument, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -2693,15 +2560,6 @@ public struct DifferentiabilityWithRespectToArgumentSyntax: SyntaxProtocol, Synt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeWrtLabel), - Syntax(wrtLabel), - Syntax(unexpectedBetweenWrtLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndArguments), - Syntax(arguments), - Syntax(unexpectedAfterArguments) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2838,32 +2696,6 @@ public struct DifferentiableAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHash trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeKindSpecifier?.raw, - kindSpecifier?.raw, - unexpectedBetweenKindSpecifierAndKindSpecifierComma?.raw, - kindSpecifierComma?.raw, - unexpectedBetweenKindSpecifierCommaAndArguments?.raw, - arguments?.raw, - unexpectedBetweenArgumentsAndArgumentsComma?.raw, - argumentsComma?.raw, - unexpectedBetweenArgumentsCommaAndGenericWhereClause?.raw, - genericWhereClause?.raw, - unexpectedAfterGenericWhereClause?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.differentiableAttributeArguments, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeKindSpecifier), Syntax(kindSpecifier), @@ -2877,6 +2709,19 @@ public struct DifferentiableAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHash Syntax(genericWhereClause), Syntax(unexpectedAfterGenericWhereClause) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.differentiableAttributeArguments, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3053,13 +2898,13 @@ public struct DiscardAssignmentExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _ trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforeWildcard), Syntax(wildcard), Syntax(unexpectedAfterWildcard)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforeWildcard?.raw, wildcard.raw, unexpectedAfterWildcard?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.discardAssignmentExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3067,7 +2912,6 @@ public struct DiscardAssignmentExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _ ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforeWildcard), Syntax(wildcard), Syntax(unexpectedAfterWildcard)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3133,19 +2977,19 @@ public struct DiscardStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSy trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeDiscardKeyword), + Syntax(discardKeyword), + Syntax(unexpectedBetweenDiscardKeywordAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeDiscardKeyword?.raw, - discardKeyword.raw, - unexpectedBetweenDiscardKeywordAndExpression?.raw, - expression.raw, - unexpectedAfterExpression?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.discardStmt, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3153,13 +2997,6 @@ public struct DiscardStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeDiscardKeyword), - Syntax(discardKeyword), - Syntax(unexpectedBetweenDiscardKeywordAndExpression), - Syntax(expression), - Syntax(unexpectedAfterExpression) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3279,21 +3116,21 @@ public struct DoExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeDoKeyword), + Syntax(doKeyword), + Syntax(unexpectedBetweenDoKeywordAndBody), + Syntax(body), + Syntax(unexpectedBetweenBodyAndCatchClauses), + Syntax(catchClauses), + Syntax(unexpectedAfterCatchClauses) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeDoKeyword?.raw, - doKeyword.raw, - unexpectedBetweenDoKeywordAndBody?.raw, - body.raw, - unexpectedBetweenBodyAndCatchClauses?.raw, - catchClauses.raw, - unexpectedAfterCatchClauses?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.doExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3301,15 +3138,6 @@ public struct DoExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeDoKeyword), - Syntax(doKeyword), - Syntax(unexpectedBetweenDoKeywordAndBody), - Syntax(body), - Syntax(unexpectedBetweenBodyAndCatchClauses), - Syntax(catchClauses), - Syntax(unexpectedAfterCatchClauses) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3385,7 +3213,7 @@ public struct DoExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.catchClauseList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -3453,23 +3281,23 @@ public struct DoStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntaxN trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeDoKeyword), + Syntax(doKeyword), + Syntax(unexpectedBetweenDoKeywordAndThrowsClause), + Syntax(throwsClause), + Syntax(unexpectedBetweenThrowsClauseAndBody), + Syntax(body), + Syntax(unexpectedBetweenBodyAndCatchClauses), + Syntax(catchClauses), + Syntax(unexpectedAfterCatchClauses) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeDoKeyword?.raw, - doKeyword.raw, - unexpectedBetweenDoKeywordAndThrowsClause?.raw, - throwsClause?.raw, - unexpectedBetweenThrowsClauseAndBody?.raw, - body.raw, - unexpectedBetweenBodyAndCatchClauses?.raw, - catchClauses.raw, - unexpectedAfterCatchClauses?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.doStmt, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3477,17 +3305,6 @@ public struct DoStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntaxN ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeDoKeyword), - Syntax(doKeyword), - Syntax(unexpectedBetweenDoKeywordAndThrowsClause), - Syntax(throwsClause), - Syntax(unexpectedBetweenThrowsClauseAndBody), - Syntax(body), - Syntax(unexpectedBetweenBodyAndCatchClauses), - Syntax(catchClauses), - Syntax(unexpectedAfterCatchClauses) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3582,7 +3399,7 @@ public struct DoStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntaxN collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.catchClauseList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -3738,23 +3555,23 @@ public struct DocumentationAttributeArgumentSyntax: SyntaxProtocol, SyntaxHashab trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLabel), + Syntax(label), + Syntax(unexpectedBetweenLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndValue), + Syntax(value), + Syntax(unexpectedBetweenValueAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLabel?.raw, - label.raw, - unexpectedBetweenLabelAndColon?.raw, - colon.raw, - unexpectedBetweenColonAndValue?.raw, - value.raw, - unexpectedBetweenValueAndTrailingComma?.raw, - trailingComma?.raw, - unexpectedAfterTrailingComma?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.documentationAttributeArgument, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3762,17 +3579,6 @@ public struct DocumentationAttributeArgumentSyntax: SyntaxProtocol, SyntaxHashab ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLabel), - Syntax(label), - Syntax(unexpectedBetweenLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndValue), - Syntax(value), - Syntax(unexpectedBetweenValueAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3921,21 +3727,21 @@ public struct DynamicReplacementAttributeArgumentsSyntax: SyntaxProtocol, Syntax trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeForLabel), + Syntax(forLabel), + Syntax(unexpectedBetweenForLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndDeclName), + Syntax(declName), + Syntax(unexpectedAfterDeclName) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeForLabel?.raw, - forLabel.raw, - unexpectedBetweenForLabelAndColon?.raw, - colon.raw, - unexpectedBetweenColonAndDeclName?.raw, - declName.raw, - unexpectedAfterDeclName?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.dynamicReplacementAttributeArguments, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3943,15 +3749,6 @@ public struct DynamicReplacementAttributeArgumentsSyntax: SyntaxProtocol, Syntax ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeForLabel), - Syntax(forLabel), - Syntax(unexpectedBetweenForLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndDeclName), - Syntax(declName), - Syntax(unexpectedAfterDeclName) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesEF.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesEF.swift index 0b535f2fbf7..04c92dffe23 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesEF.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesEF.swift @@ -51,21 +51,21 @@ public struct EditorPlaceholderDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _ trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndPlaceholder), + Syntax(placeholder), + Syntax(unexpectedAfterPlaceholder) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAttributes?.raw, - attributes.raw, - unexpectedBetweenAttributesAndModifiers?.raw, - modifiers.raw, - unexpectedBetweenModifiersAndPlaceholder?.raw, - placeholder.raw, - unexpectedAfterPlaceholder?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.editorPlaceholderDecl, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -73,15 +73,6 @@ public struct EditorPlaceholderDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _ ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndModifiers), - Syntax(modifiers), - Syntax(unexpectedBetweenModifiersAndPlaceholder), - Syntax(placeholder), - Syntax(unexpectedAfterPlaceholder) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -119,7 +110,7 @@ public struct EditorPlaceholderDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _ collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -165,7 +156,7 @@ public struct EditorPlaceholderDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _ collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -248,13 +239,13 @@ public struct EditorPlaceholderExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _ trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforePlaceholder?.raw, placeholder.raw, unexpectedAfterPlaceholder?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.editorPlaceholderExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -262,7 +253,6 @@ public struct EditorPlaceholderExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _ ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -340,23 +330,23 @@ public struct EnumCaseDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndCaseKeyword), + Syntax(caseKeyword), + Syntax(unexpectedBetweenCaseKeywordAndElements), + Syntax(elements), + Syntax(unexpectedAfterElements) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAttributes?.raw, - attributes.raw, - unexpectedBetweenAttributesAndModifiers?.raw, - modifiers.raw, - unexpectedBetweenModifiersAndCaseKeyword?.raw, - caseKeyword.raw, - unexpectedBetweenCaseKeywordAndElements?.raw, - elements.raw, - unexpectedAfterElements?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.enumCaseDecl, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -364,17 +354,6 @@ public struct EnumCaseDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndModifiers), - Syntax(modifiers), - Syntax(unexpectedBetweenModifiersAndCaseKeyword), - Syntax(caseKeyword), - Syntax(unexpectedBetweenCaseKeywordAndElements), - Syntax(elements), - Syntax(unexpectedAfterElements) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -412,7 +391,7 @@ public struct EnumCaseDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -458,7 +437,7 @@ public struct EnumCaseDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -527,7 +506,7 @@ public struct EnumCaseDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.enumCaseElementList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -606,23 +585,23 @@ public struct EnumCaseElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeName), + Syntax(name), + Syntax(unexpectedBetweenNameAndParameterClause), + Syntax(parameterClause), + Syntax(unexpectedBetweenParameterClauseAndRawValue), + Syntax(rawValue), + Syntax(unexpectedBetweenRawValueAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeName?.raw, - name.raw, - unexpectedBetweenNameAndParameterClause?.raw, - parameterClause?.raw, - unexpectedBetweenParameterClauseAndRawValue?.raw, - rawValue?.raw, - unexpectedBetweenRawValueAndTrailingComma?.raw, - trailingComma?.raw, - unexpectedAfterTrailingComma?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.enumCaseElement, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -630,17 +609,6 @@ public struct EnumCaseElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeName), - Syntax(name), - Syntax(unexpectedBetweenNameAndParameterClause), - Syntax(parameterClause), - Syntax(unexpectedBetweenParameterClauseAndRawValue), - Syntax(rawValue), - Syntax(unexpectedBetweenRawValueAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -789,21 +757,21 @@ public struct EnumCaseParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Le trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndParameters), + Syntax(parameters), + Syntax(unexpectedBetweenParametersAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeftParen?.raw, - leftParen.raw, - unexpectedBetweenLeftParenAndParameters?.raw, - parameters.raw, - unexpectedBetweenParametersAndRightParen?.raw, - rightParen.raw, - unexpectedAfterRightParen?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.enumCaseParameterClause, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -811,15 +779,6 @@ public struct EnumCaseParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Le ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndParameters), - Syntax(parameters), - Syntax(unexpectedBetweenParametersAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -880,7 +839,7 @@ public struct EnumCaseParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Le collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.enumCaseParameterList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -987,36 +946,6 @@ public struct EnumCaseParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeModifiers?.raw, - modifiers.raw, - unexpectedBetweenModifiersAndFirstName?.raw, - firstName?.raw, - unexpectedBetweenFirstNameAndSecondName?.raw, - secondName?.raw, - unexpectedBetweenSecondNameAndColon?.raw, - colon?.raw, - unexpectedBetweenColonAndType?.raw, - type.raw, - unexpectedBetweenTypeAndDefaultValue?.raw, - defaultValue?.raw, - unexpectedBetweenDefaultValueAndTrailingComma?.raw, - trailingComma?.raw, - unexpectedAfterTrailingComma?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.enumCaseParameter, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeModifiers), Syntax(modifiers), @@ -1034,6 +963,19 @@ public struct EnumCaseParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt Syntax(trailingComma), Syntax(unexpectedAfterTrailingComma) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.enumCaseParameter, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1070,7 +1012,7 @@ public struct EnumCaseParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -1297,38 +1239,6 @@ public struct EnumDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynta trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAttributes?.raw, - attributes.raw, - unexpectedBetweenAttributesAndModifiers?.raw, - modifiers.raw, - unexpectedBetweenModifiersAndEnumKeyword?.raw, - enumKeyword.raw, - unexpectedBetweenEnumKeywordAndName?.raw, - name.raw, - unexpectedBetweenNameAndGenericParameterClause?.raw, - genericParameterClause?.raw, - unexpectedBetweenGenericParameterClauseAndInheritanceClause?.raw, - inheritanceClause?.raw, - unexpectedBetweenInheritanceClauseAndGenericWhereClause?.raw, - genericWhereClause?.raw, - unexpectedBetweenGenericWhereClauseAndMemberBlock?.raw, - memberBlock.raw, - unexpectedAfterMemberBlock?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.enumDecl, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeAttributes), Syntax(attributes), @@ -1348,6 +1258,19 @@ public struct EnumDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynta Syntax(memberBlock), Syntax(unexpectedAfterMemberBlock) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.enumDecl, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1385,7 +1308,7 @@ public struct EnumDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynta collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -1431,7 +1354,7 @@ public struct EnumDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynta collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -1633,21 +1556,21 @@ public struct ExposeAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable, _L trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLanguage), + Syntax(language), + Syntax(unexpectedBetweenLanguageAndComma), + Syntax(comma), + Syntax(unexpectedBetweenCommaAndCxxName), + Syntax(cxxName), + Syntax(unexpectedAfterCxxName) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLanguage?.raw, - language.raw, - unexpectedBetweenLanguageAndComma?.raw, - comma?.raw, - unexpectedBetweenCommaAndCxxName?.raw, - cxxName?.raw, - unexpectedAfterCxxName?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.exposeAttributeArguments, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1655,15 +1578,6 @@ public struct ExposeAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable, _L ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLanguage), - Syntax(language), - Syntax(unexpectedBetweenLanguageAndComma), - Syntax(comma), - Syntax(unexpectedBetweenCommaAndCxxName), - Syntax(cxxName), - Syntax(unexpectedAfterCxxName) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1784,13 +1698,13 @@ public struct ExpressionPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _L trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforeExpression), Syntax(expression), Syntax(unexpectedAfterExpression)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforeExpression?.raw, expression.raw, unexpectedAfterExpression?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.expressionPattern, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1798,7 +1712,6 @@ public struct ExpressionPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _L ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforeExpression), Syntax(expression), Syntax(unexpectedAfterExpression)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1878,32 +1791,6 @@ public struct ExpressionSegmentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeBackslash?.raw, - backslash.raw, - unexpectedBetweenBackslashAndPounds?.raw, - pounds?.raw, - unexpectedBetweenPoundsAndLeftParen?.raw, - leftParen.raw, - unexpectedBetweenLeftParenAndExpressions?.raw, - expressions.raw, - unexpectedBetweenExpressionsAndRightParen?.raw, - rightParen.raw, - unexpectedAfterRightParen?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.expressionSegment, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeBackslash), Syntax(backslash), @@ -1917,6 +1804,19 @@ public struct ExpressionSegmentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt Syntax(rightParen), Syntax(unexpectedAfterRightParen) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.expressionSegment, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2016,7 +1916,7 @@ public struct ExpressionSegmentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.labeledExprList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -2099,13 +1999,13 @@ public struct ExpressionStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStm trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforeExpression), Syntax(expression), Syntax(unexpectedAfterExpression)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforeExpression?.raw, expression.raw, unexpectedAfterExpression?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.expressionStmt, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -2113,7 +2013,6 @@ public struct ExpressionStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStm ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforeExpression), Syntax(expression), Syntax(unexpectedAfterExpression)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2210,36 +2109,6 @@ public struct ExtensionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAttributes?.raw, - attributes.raw, - unexpectedBetweenAttributesAndModifiers?.raw, - modifiers.raw, - unexpectedBetweenModifiersAndExtensionKeyword?.raw, - extensionKeyword.raw, - unexpectedBetweenExtensionKeywordAndExtendedType?.raw, - extendedType.raw, - unexpectedBetweenExtendedTypeAndInheritanceClause?.raw, - inheritanceClause?.raw, - unexpectedBetweenInheritanceClauseAndGenericWhereClause?.raw, - genericWhereClause?.raw, - unexpectedBetweenGenericWhereClauseAndMemberBlock?.raw, - memberBlock.raw, - unexpectedAfterMemberBlock?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.extensionDecl, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeAttributes), Syntax(attributes), @@ -2257,6 +2126,19 @@ public struct ExtensionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl Syntax(memberBlock), Syntax(unexpectedAfterMemberBlock) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.extensionDecl, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2302,7 +2184,7 @@ public struct ExtensionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -2348,7 +2230,7 @@ public struct ExtensionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -2513,13 +2395,13 @@ public struct FallThroughStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafSt trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforeFallthroughKeyword), Syntax(fallthroughKeyword), Syntax(unexpectedAfterFallthroughKeyword)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforeFallthroughKeyword?.raw, fallthroughKeyword.raw, unexpectedAfterFallthroughKeyword?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.fallThroughStmt, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -2527,7 +2409,6 @@ public struct FallThroughStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafSt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforeFallthroughKeyword), Syntax(fallthroughKeyword), Syntax(unexpectedAfterFallthroughKeyword)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2590,13 +2471,13 @@ public struct FloatLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforeLiteral), Syntax(literal), Syntax(unexpectedAfterLiteral)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforeLiteral?.raw, literal.raw, unexpectedAfterLiteral?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.floatLiteralExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -2604,7 +2485,6 @@ public struct FloatLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforeLiteral), Syntax(literal), Syntax(unexpectedAfterLiteral)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2694,42 +2574,6 @@ public struct ForStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntax trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeForKeyword?.raw, - forKeyword.raw, - unexpectedBetweenForKeywordAndTryKeyword?.raw, - tryKeyword?.raw, - unexpectedBetweenTryKeywordAndAwaitKeyword?.raw, - awaitKeyword?.raw, - unexpectedBetweenAwaitKeywordAndCaseKeyword?.raw, - caseKeyword?.raw, - unexpectedBetweenCaseKeywordAndPattern?.raw, - pattern.raw, - unexpectedBetweenPatternAndTypeAnnotation?.raw, - typeAnnotation?.raw, - unexpectedBetweenTypeAnnotationAndInKeyword?.raw, - inKeyword.raw, - unexpectedBetweenInKeywordAndSequence?.raw, - sequence.raw, - unexpectedBetweenSequenceAndWhereClause?.raw, - whereClause?.raw, - unexpectedBetweenWhereClauseAndBody?.raw, - body.raw, - unexpectedAfterBody?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.forStmt, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeForKeyword), Syntax(forKeyword), @@ -2753,6 +2597,19 @@ public struct ForStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntax Syntax(body), Syntax(unexpectedAfterBody) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.forStmt, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3014,19 +2871,19 @@ public struct ForceUnwrapExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafEx trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndExclamationMark), + Syntax(exclamationMark), + Syntax(unexpectedAfterExclamationMark) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeExpression?.raw, - expression.raw, - unexpectedBetweenExpressionAndExclamationMark?.raw, - exclamationMark.raw, - unexpectedAfterExclamationMark?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.forceUnwrapExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3034,13 +2891,6 @@ public struct ForceUnwrapExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafEx ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeExpression), - Syntax(expression), - Syntax(unexpectedBetweenExpressionAndExclamationMark), - Syntax(exclamationMark), - Syntax(unexpectedAfterExclamationMark) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3142,34 +2992,6 @@ public struct FunctionCallExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeCalledExpression?.raw, - calledExpression.raw, - unexpectedBetweenCalledExpressionAndLeftParen?.raw, - leftParen?.raw, - unexpectedBetweenLeftParenAndArguments?.raw, - arguments.raw, - unexpectedBetweenArgumentsAndRightParen?.raw, - rightParen?.raw, - unexpectedBetweenRightParenAndTrailingClosure?.raw, - trailingClosure?.raw, - unexpectedBetweenTrailingClosureAndAdditionalTrailingClosures?.raw, - additionalTrailingClosures.raw, - unexpectedAfterAdditionalTrailingClosures?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.functionCallExpr, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeCalledExpression), Syntax(calledExpression), @@ -3185,6 +3007,19 @@ public struct FunctionCallExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE Syntax(additionalTrailingClosures), Syntax(unexpectedAfterAdditionalTrailingClosures) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.functionCallExpr, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3260,7 +3095,7 @@ public struct FunctionCallExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.labeledExprList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -3344,7 +3179,7 @@ public struct FunctionCallExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.multipleTrailingClosureElementList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -3457,38 +3292,6 @@ public struct FunctionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAttributes?.raw, - attributes.raw, - unexpectedBetweenAttributesAndModifiers?.raw, - modifiers.raw, - unexpectedBetweenModifiersAndFuncKeyword?.raw, - funcKeyword.raw, - unexpectedBetweenFuncKeywordAndName?.raw, - name.raw, - unexpectedBetweenNameAndGenericParameterClause?.raw, - genericParameterClause?.raw, - unexpectedBetweenGenericParameterClauseAndSignature?.raw, - signature.raw, - unexpectedBetweenSignatureAndGenericWhereClause?.raw, - genericWhereClause?.raw, - unexpectedBetweenGenericWhereClauseAndBody?.raw, - body?.raw, - unexpectedAfterBody?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.functionDecl, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeAttributes), Syntax(attributes), @@ -3508,6 +3311,19 @@ public struct FunctionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS Syntax(body), Syntax(unexpectedAfterBody) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.functionDecl, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3545,7 +3361,7 @@ public struct FunctionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -3591,7 +3407,7 @@ public struct FunctionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -3794,19 +3610,19 @@ public struct FunctionEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashable, _L trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAsyncSpecifier), + Syntax(asyncSpecifier), + Syntax(unexpectedBetweenAsyncSpecifierAndThrowsClause), + Syntax(throwsClause), + Syntax(unexpectedAfterThrowsClause) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAsyncSpecifier?.raw, - asyncSpecifier?.raw, - unexpectedBetweenAsyncSpecifierAndThrowsClause?.raw, - throwsClause?.raw, - unexpectedAfterThrowsClause?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.functionEffectSpecifiers, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3814,13 +3630,6 @@ public struct FunctionEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashable, _L ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeAsyncSpecifier), - Syntax(asyncSpecifier), - Syntax(unexpectedBetweenAsyncSpecifierAndThrowsClause), - Syntax(throwsClause), - Syntax(unexpectedAfterThrowsClause) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3923,21 +3732,21 @@ public struct FunctionParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Le trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndParameters), + Syntax(parameters), + Syntax(unexpectedBetweenParametersAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeftParen?.raw, - leftParen.raw, - unexpectedBetweenLeftParenAndParameters?.raw, - parameters.raw, - unexpectedBetweenParametersAndRightParen?.raw, - rightParen.raw, - unexpectedAfterRightParen?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.functionParameterClause, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3945,15 +3754,6 @@ public struct FunctionParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Le ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndParameters), - Syntax(parameters), - Syntax(unexpectedBetweenParametersAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4011,7 +3811,7 @@ public struct FunctionParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Le collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.functionParameterList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -4129,40 +3929,6 @@ public struct FunctionParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAttributes?.raw, - attributes.raw, - unexpectedBetweenAttributesAndModifiers?.raw, - modifiers.raw, - unexpectedBetweenModifiersAndFirstName?.raw, - firstName.raw, - unexpectedBetweenFirstNameAndSecondName?.raw, - secondName?.raw, - unexpectedBetweenSecondNameAndColon?.raw, - colon.raw, - unexpectedBetweenColonAndType?.raw, - type.raw, - unexpectedBetweenTypeAndEllipsis?.raw, - ellipsis?.raw, - unexpectedBetweenEllipsisAndDefaultValue?.raw, - defaultValue?.raw, - unexpectedBetweenDefaultValueAndTrailingComma?.raw, - trailingComma?.raw, - unexpectedAfterTrailingComma?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.functionParameter, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeAttributes), Syntax(attributes), @@ -4184,6 +3950,19 @@ public struct FunctionParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt Syntax(trailingComma), Syntax(unexpectedAfterTrailingComma) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.functionParameter, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4221,7 +4000,7 @@ public struct FunctionParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -4267,7 +4046,7 @@ public struct FunctionParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -4511,21 +4290,21 @@ public struct FunctionSignatureSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeParameterClause), + Syntax(parameterClause), + Syntax(unexpectedBetweenParameterClauseAndEffectSpecifiers), + Syntax(effectSpecifiers), + Syntax(unexpectedBetweenEffectSpecifiersAndReturnClause), + Syntax(returnClause), + Syntax(unexpectedAfterReturnClause) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeParameterClause?.raw, - parameterClause.raw, - unexpectedBetweenParameterClauseAndEffectSpecifiers?.raw, - effectSpecifiers?.raw, - unexpectedBetweenEffectSpecifiersAndReturnClause?.raw, - returnClause?.raw, - unexpectedAfterReturnClause?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.functionSignature, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4533,15 +4312,6 @@ public struct FunctionSignatureSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeParameterClause), - Syntax(parameterClause), - Syntax(unexpectedBetweenParameterClauseAndEffectSpecifiers), - Syntax(effectSpecifiers), - Syntax(unexpectedBetweenEffectSpecifiersAndReturnClause), - Syntax(returnClause), - Syntax(unexpectedAfterReturnClause) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4660,32 +4430,6 @@ public struct FunctionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeS trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeftParen?.raw, - leftParen.raw, - unexpectedBetweenLeftParenAndParameters?.raw, - parameters.raw, - unexpectedBetweenParametersAndRightParen?.raw, - rightParen.raw, - unexpectedBetweenRightParenAndEffectSpecifiers?.raw, - effectSpecifiers?.raw, - unexpectedBetweenEffectSpecifiersAndReturnClause?.raw, - returnClause.raw, - unexpectedAfterReturnClause?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.functionType, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeLeftParen), Syntax(leftParen), @@ -4699,6 +4443,19 @@ public struct FunctionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeS Syntax(returnClause), Syntax(unexpectedAfterReturnClause) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.functionType, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4756,7 +4513,7 @@ public struct FunctionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeS collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.tupleTypeElementList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesGHI.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesGHI.swift index 269ffd87e7a..baeccade2f3 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesGHI.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesGHI.swift @@ -53,21 +53,21 @@ public struct GenericArgumentClauseSyntax: SyntaxProtocol, SyntaxHashable, _Leaf trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftAngle), + Syntax(leftAngle), + Syntax(unexpectedBetweenLeftAngleAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndRightAngle), + Syntax(rightAngle), + Syntax(unexpectedAfterRightAngle) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeftAngle?.raw, - leftAngle.raw, - unexpectedBetweenLeftAngleAndArguments?.raw, - arguments.raw, - unexpectedBetweenArgumentsAndRightAngle?.raw, - rightAngle.raw, - unexpectedAfterRightAngle?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.genericArgumentClause, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -75,15 +75,6 @@ public struct GenericArgumentClauseSyntax: SyntaxProtocol, SyntaxHashable, _Leaf ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLeftAngle), - Syntax(leftAngle), - Syntax(unexpectedBetweenLeftAngleAndArguments), - Syntax(arguments), - Syntax(unexpectedBetweenArgumentsAndRightAngle), - Syntax(rightAngle), - Syntax(unexpectedAfterRightAngle) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -141,7 +132,7 @@ public struct GenericArgumentClauseSyntax: SyntaxProtocol, SyntaxHashable, _Leaf collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.genericArgumentList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -227,19 +218,19 @@ public struct GenericArgumentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeArgument), + Syntax(argument), + Syntax(unexpectedBetweenArgumentAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeArgument?.raw, - argument.raw, - unexpectedBetweenArgumentAndTrailingComma?.raw, - trailingComma?.raw, - unexpectedAfterTrailingComma?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.genericArgument, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -247,13 +238,6 @@ public struct GenericArgumentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeArgument), - Syntax(argument), - Syntax(unexpectedBetweenArgumentAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -368,23 +352,23 @@ public struct GenericParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Lea trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftAngle), + Syntax(leftAngle), + Syntax(unexpectedBetweenLeftAngleAndParameters), + Syntax(parameters), + Syntax(unexpectedBetweenParametersAndGenericWhereClause), + Syntax(genericWhereClause), + Syntax(unexpectedBetweenGenericWhereClauseAndRightAngle), + Syntax(rightAngle), + Syntax(unexpectedAfterRightAngle) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeftAngle?.raw, - leftAngle.raw, - unexpectedBetweenLeftAngleAndParameters?.raw, - parameters.raw, - unexpectedBetweenParametersAndGenericWhereClause?.raw, - genericWhereClause?.raw, - unexpectedBetweenGenericWhereClauseAndRightAngle?.raw, - rightAngle.raw, - unexpectedAfterRightAngle?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.genericParameterClause, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -392,17 +376,6 @@ public struct GenericParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Lea ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLeftAngle), - Syntax(leftAngle), - Syntax(unexpectedBetweenLeftAngleAndParameters), - Syntax(parameters), - Syntax(unexpectedBetweenParametersAndGenericWhereClause), - Syntax(genericWhereClause), - Syntax(unexpectedBetweenGenericWhereClauseAndRightAngle), - Syntax(rightAngle), - Syntax(unexpectedAfterRightAngle) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -463,7 +436,7 @@ public struct GenericParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Lea collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.genericParameterList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -584,34 +557,6 @@ public struct GenericParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAttributes?.raw, - attributes.raw, - unexpectedBetweenAttributesAndEachKeyword?.raw, - eachKeyword?.raw, - unexpectedBetweenEachKeywordAndName?.raw, - name.raw, - unexpectedBetweenNameAndColon?.raw, - colon?.raw, - unexpectedBetweenColonAndInheritedType?.raw, - inheritedType?.raw, - unexpectedBetweenInheritedTypeAndTrailingComma?.raw, - trailingComma?.raw, - unexpectedAfterTrailingComma?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.genericParameter, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeAttributes), Syntax(attributes), @@ -627,6 +572,19 @@ public struct GenericParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta Syntax(trailingComma), Syntax(unexpectedAfterTrailingComma) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.genericParameter, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -663,7 +621,7 @@ public struct GenericParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -951,19 +909,19 @@ public struct GenericRequirementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeRequirement), + Syntax(requirement), + Syntax(unexpectedBetweenRequirementAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeRequirement?.raw, - requirement.raw, - unexpectedBetweenRequirementAndTrailingComma?.raw, - trailingComma?.raw, - unexpectedAfterTrailingComma?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.genericRequirement, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -971,13 +929,6 @@ public struct GenericRequirementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeRequirement), - Syntax(requirement), - Syntax(unexpectedBetweenRequirementAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1067,19 +1018,19 @@ public struct GenericSpecializationExprSyntax: ExprSyntaxProtocol, SyntaxHashabl trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndGenericArgumentClause), + Syntax(genericArgumentClause), + Syntax(unexpectedAfterGenericArgumentClause) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeExpression?.raw, - expression.raw, - unexpectedBetweenExpressionAndGenericArgumentClause?.raw, - genericArgumentClause.raw, - unexpectedAfterGenericArgumentClause?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.genericSpecializationExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1087,13 +1038,6 @@ public struct GenericSpecializationExprSyntax: ExprSyntaxProtocol, SyntaxHashabl ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeExpression), - Syntax(expression), - Syntax(unexpectedBetweenExpressionAndGenericArgumentClause), - Syntax(genericArgumentClause), - Syntax(unexpectedAfterGenericArgumentClause) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1202,19 +1146,19 @@ public struct GenericWhereClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeWhereKeyword), + Syntax(whereKeyword), + Syntax(unexpectedBetweenWhereKeywordAndRequirements), + Syntax(requirements), + Syntax(unexpectedAfterRequirements) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeWhereKeyword?.raw, - whereKeyword.raw, - unexpectedBetweenWhereKeywordAndRequirements?.raw, - requirements.raw, - unexpectedAfterRequirements?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.genericWhereClause, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1222,13 +1166,6 @@ public struct GenericWhereClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeWhereKeyword), - Syntax(whereKeyword), - Syntax(unexpectedBetweenWhereKeywordAndRequirements), - Syntax(requirements), - Syntax(unexpectedAfterRequirements) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1289,7 +1226,7 @@ public struct GenericWhereClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.genericRequirementList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -1354,23 +1291,23 @@ public struct GuardStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeGuardKeyword), + Syntax(guardKeyword), + Syntax(unexpectedBetweenGuardKeywordAndConditions), + Syntax(conditions), + Syntax(unexpectedBetweenConditionsAndElseKeyword), + Syntax(elseKeyword), + Syntax(unexpectedBetweenElseKeywordAndBody), + Syntax(body), + Syntax(unexpectedAfterBody) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeGuardKeyword?.raw, - guardKeyword.raw, - unexpectedBetweenGuardKeywordAndConditions?.raw, - conditions.raw, - unexpectedBetweenConditionsAndElseKeyword?.raw, - elseKeyword.raw, - unexpectedBetweenElseKeywordAndBody?.raw, - body.raw, - unexpectedAfterBody?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.guardStmt, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1378,17 +1315,6 @@ public struct GuardStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeGuardKeyword), - Syntax(guardKeyword), - Syntax(unexpectedBetweenGuardKeywordAndConditions), - Syntax(conditions), - Syntax(unexpectedBetweenConditionsAndElseKeyword), - Syntax(elseKeyword), - Syntax(unexpectedBetweenElseKeywordAndBody), - Syntax(body), - Syntax(unexpectedAfterBody) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1446,7 +1372,7 @@ public struct GuardStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.conditionElementList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -1556,13 +1482,13 @@ public struct IdentifierPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _L trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforeIdentifier), Syntax(identifier), Syntax(unexpectedAfterIdentifier)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforeIdentifier?.raw, identifier.raw, unexpectedAfterIdentifier?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.identifierPattern, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1570,7 +1496,6 @@ public struct IdentifierPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _L ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforeIdentifier), Syntax(identifier), Syntax(unexpectedAfterIdentifier)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1641,19 +1566,19 @@ public struct IdentifierTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeName), + Syntax(name), + Syntax(unexpectedBetweenNameAndGenericArgumentClause), + Syntax(genericArgumentClause), + Syntax(unexpectedAfterGenericArgumentClause) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeName?.raw, - name.raw, - unexpectedBetweenNameAndGenericArgumentClause?.raw, - genericArgumentClause?.raw, - unexpectedAfterGenericArgumentClause?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.identifierType, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1661,13 +1586,6 @@ public struct IdentifierTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeName), - Syntax(name), - Syntax(unexpectedBetweenNameAndGenericArgumentClause), - Syntax(genericArgumentClause), - Syntax(unexpectedAfterGenericArgumentClause) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1955,21 +1873,21 @@ public struct IfConfigClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforePoundKeyword), + Syntax(poundKeyword), + Syntax(unexpectedBetweenPoundKeywordAndCondition), + Syntax(condition), + Syntax(unexpectedBetweenConditionAndElements), + Syntax(elements), + Syntax(unexpectedAfterElements) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforePoundKeyword?.raw, - poundKeyword.raw, - unexpectedBetweenPoundKeywordAndCondition?.raw, - condition?.raw, - unexpectedBetweenConditionAndElements?.raw, - elements?.raw, - unexpectedAfterElements?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.ifConfigClause, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1977,15 +1895,6 @@ public struct IfConfigClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforePoundKeyword), - Syntax(poundKeyword), - Syntax(unexpectedBetweenPoundKeywordAndCondition), - Syntax(condition), - Syntax(unexpectedBetweenConditionAndElements), - Syntax(elements), - Syntax(unexpectedAfterElements) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2104,19 +2013,19 @@ public struct IfConfigDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeClauses), + Syntax(clauses), + Syntax(unexpectedBetweenClausesAndPoundEndif), + Syntax(poundEndif), + Syntax(unexpectedAfterPoundEndif) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeClauses?.raw, - clauses.raw, - unexpectedBetweenClausesAndPoundEndif?.raw, - poundEndif.raw, - unexpectedAfterPoundEndif?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.ifConfigDecl, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -2124,13 +2033,6 @@ public struct IfConfigDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeClauses), - Syntax(clauses), - Syntax(unexpectedBetweenClausesAndPoundEndif), - Syntax(poundEndif), - Syntax(unexpectedAfterPoundEndif) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2167,7 +2069,7 @@ public struct IfConfigDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.ifConfigClauseList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -2342,32 +2244,6 @@ public struct IfExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeIfKeyword?.raw, - ifKeyword.raw, - unexpectedBetweenIfKeywordAndConditions?.raw, - conditions.raw, - unexpectedBetweenConditionsAndBody?.raw, - body.raw, - unexpectedBetweenBodyAndElseKeyword?.raw, - elseKeyword?.raw, - unexpectedBetweenElseKeywordAndElseBody?.raw, - elseBody?.raw, - unexpectedAfterElseBody?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.ifExpr, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeIfKeyword), Syntax(ifKeyword), @@ -2381,6 +2257,19 @@ public struct IfExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN Syntax(elseBody), Syntax(unexpectedAfterElseBody) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.ifExpr, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2438,7 +2327,7 @@ public struct IfExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.conditionElementList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -2572,21 +2461,21 @@ public struct ImplementsAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeType), + Syntax(type), + Syntax(unexpectedBetweenTypeAndComma), + Syntax(comma), + Syntax(unexpectedBetweenCommaAndDeclName), + Syntax(declName), + Syntax(unexpectedAfterDeclName) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeType?.raw, - type.raw, - unexpectedBetweenTypeAndComma?.raw, - comma.raw, - unexpectedBetweenCommaAndDeclName?.raw, - declName.raw, - unexpectedAfterDeclName?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.implementsAttributeArguments, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -2594,15 +2483,6 @@ public struct ImplementsAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeType), - Syntax(type), - Syntax(unexpectedBetweenTypeAndComma), - Syntax(comma), - Syntax(unexpectedBetweenCommaAndDeclName), - Syntax(declName), - Syntax(unexpectedAfterDeclName) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2716,19 +2596,19 @@ public struct ImplicitlyUnwrappedOptionalTypeSyntax: TypeSyntaxProtocol, SyntaxH trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeWrappedType), + Syntax(wrappedType), + Syntax(unexpectedBetweenWrappedTypeAndExclamationMark), + Syntax(exclamationMark), + Syntax(unexpectedAfterExclamationMark) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeWrappedType?.raw, - wrappedType.raw, - unexpectedBetweenWrappedTypeAndExclamationMark?.raw, - exclamationMark.raw, - unexpectedAfterExclamationMark?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.implicitlyUnwrappedOptionalType, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -2736,13 +2616,6 @@ public struct ImplicitlyUnwrappedOptionalTypeSyntax: TypeSyntaxProtocol, SyntaxH ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeWrappedType), - Syntax(wrappedType), - Syntax(unexpectedBetweenWrappedTypeAndExclamationMark), - Syntax(exclamationMark), - Syntax(unexpectedAfterExclamationMark) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2854,32 +2727,6 @@ public struct ImportDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyn trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAttributes?.raw, - attributes.raw, - unexpectedBetweenAttributesAndModifiers?.raw, - modifiers.raw, - unexpectedBetweenModifiersAndImportKeyword?.raw, - importKeyword.raw, - unexpectedBetweenImportKeywordAndImportKindSpecifier?.raw, - importKindSpecifier?.raw, - unexpectedBetweenImportKindSpecifierAndPath?.raw, - path.raw, - unexpectedAfterPath?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.importDecl, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeAttributes), Syntax(attributes), @@ -2893,6 +2740,19 @@ public struct ImportDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyn Syntax(path), Syntax(unexpectedAfterPath) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.importDecl, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2930,7 +2790,7 @@ public struct ImportDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyn collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -2976,7 +2836,7 @@ public struct ImportDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyn collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -3079,7 +2939,7 @@ public struct ImportDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyn collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.importPathComponentList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -3148,19 +3008,19 @@ public struct ImportPathComponentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeName), + Syntax(name), + Syntax(unexpectedBetweenNameAndTrailingPeriod), + Syntax(trailingPeriod), + Syntax(unexpectedAfterTrailingPeriod) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeName?.raw, - name.raw, - unexpectedBetweenNameAndTrailingPeriod?.raw, - trailingPeriod?.raw, - unexpectedAfterTrailingPeriod?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.importPathComponent, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3168,13 +3028,6 @@ public struct ImportPathComponentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeName), - Syntax(name), - Syntax(unexpectedBetweenNameAndTrailingPeriod), - Syntax(trailingPeriod), - Syntax(unexpectedAfterTrailingPeriod) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3273,19 +3126,19 @@ public struct InOutExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAmpersand), + Syntax(ampersand), + Syntax(unexpectedBetweenAmpersandAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAmpersand?.raw, - ampersand.raw, - unexpectedBetweenAmpersandAndExpression?.raw, - expression.raw, - unexpectedAfterExpression?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.inOutExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3293,13 +3146,6 @@ public struct InOutExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeAmpersand), - Syntax(ampersand), - Syntax(unexpectedBetweenAmpersandAndExpression), - Syntax(expression), - Syntax(unexpectedAfterExpression) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3398,21 +3244,21 @@ public struct InfixOperatorExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftOperand), + Syntax(leftOperand), + Syntax(unexpectedBetweenLeftOperandAndOperator), + Syntax(`operator`), + Syntax(unexpectedBetweenOperatorAndRightOperand), + Syntax(rightOperand), + Syntax(unexpectedAfterRightOperand) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeftOperand?.raw, - leftOperand.raw, - unexpectedBetweenLeftOperandAndOperator?.raw, - `operator`.raw, - unexpectedBetweenOperatorAndRightOperand?.raw, - rightOperand.raw, - unexpectedAfterRightOperand?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.infixOperatorExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3420,15 +3266,6 @@ public struct InfixOperatorExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLeftOperand), - Syntax(leftOperand), - Syntax(unexpectedBetweenLeftOperandAndOperator), - Syntax(`operator`), - Syntax(unexpectedBetweenOperatorAndRightOperand), - Syntax(rightOperand), - Syntax(unexpectedAfterRightOperand) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3545,19 +3382,19 @@ public struct InheritanceClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndInheritedTypes), + Syntax(inheritedTypes), + Syntax(unexpectedAfterInheritedTypes) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeColon?.raw, - colon.raw, - unexpectedBetweenColonAndInheritedTypes?.raw, - inheritedTypes.raw, - unexpectedAfterInheritedTypes?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.inheritanceClause, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3565,13 +3402,6 @@ public struct InheritanceClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndInheritedTypes), - Syntax(inheritedTypes), - Syntax(unexpectedAfterInheritedTypes) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3629,7 +3459,7 @@ public struct InheritanceClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.inheritedTypeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -3692,19 +3522,19 @@ public struct InheritedTypeSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeType), + Syntax(type), + Syntax(unexpectedBetweenTypeAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeType?.raw, - type.raw, - unexpectedBetweenTypeAndTrailingComma?.raw, - trailingComma?.raw, - unexpectedAfterTrailingComma?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.inheritedType, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3712,13 +3542,6 @@ public struct InheritedTypeSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeType), - Syntax(type), - Syntax(unexpectedBetweenTypeAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3818,19 +3641,19 @@ public struct InitializerClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeEqual), + Syntax(equal), + Syntax(unexpectedBetweenEqualAndValue), + Syntax(value), + Syntax(unexpectedAfterValue) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeEqual?.raw, - equal.raw, - unexpectedBetweenEqualAndValue?.raw, - value.raw, - unexpectedAfterValue?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.initializerClause, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3838,13 +3661,6 @@ public struct InitializerClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeEqual), - Syntax(equal), - Syntax(unexpectedBetweenEqualAndValue), - Syntax(value), - Syntax(unexpectedAfterValue) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3971,38 +3787,6 @@ public struct InitializerDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDe trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAttributes?.raw, - attributes.raw, - unexpectedBetweenAttributesAndModifiers?.raw, - modifiers.raw, - unexpectedBetweenModifiersAndInitKeyword?.raw, - initKeyword.raw, - unexpectedBetweenInitKeywordAndOptionalMark?.raw, - optionalMark?.raw, - unexpectedBetweenOptionalMarkAndGenericParameterClause?.raw, - genericParameterClause?.raw, - unexpectedBetweenGenericParameterClauseAndSignature?.raw, - signature.raw, - unexpectedBetweenSignatureAndGenericWhereClause?.raw, - genericWhereClause?.raw, - unexpectedBetweenGenericWhereClauseAndBody?.raw, - body?.raw, - unexpectedAfterBody?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.initializerDecl, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeAttributes), Syntax(attributes), @@ -4022,6 +3806,19 @@ public struct InitializerDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDe Syntax(body), Syntax(unexpectedAfterBody) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.initializerDecl, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4059,7 +3856,7 @@ public struct InitializerDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDe collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -4105,7 +3902,7 @@ public struct InitializerDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDe collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -4297,13 +4094,13 @@ public struct IntegerLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforeLiteral), Syntax(literal), Syntax(unexpectedAfterLiteral)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforeLiteral?.raw, literal.raw, unexpectedAfterLiteral?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.integerLiteralExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4311,7 +4108,6 @@ public struct IntegerLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforeLiteral), Syntax(literal), Syntax(unexpectedAfterLiteral)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4394,21 +4190,21 @@ public struct IsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndIsKeyword), + Syntax(isKeyword), + Syntax(unexpectedBetweenIsKeywordAndType), + Syntax(type), + Syntax(unexpectedAfterType) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeExpression?.raw, - expression.raw, - unexpectedBetweenExpressionAndIsKeyword?.raw, - isKeyword.raw, - unexpectedBetweenIsKeywordAndType?.raw, - type.raw, - unexpectedAfterType?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.isExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4416,15 +4212,6 @@ public struct IsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeExpression), - Syntax(expression), - Syntax(unexpectedBetweenExpressionAndIsKeyword), - Syntax(isKeyword), - Syntax(unexpectedBetweenIsKeywordAndType), - Syntax(type), - Syntax(unexpectedAfterType) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4538,19 +4325,19 @@ public struct IsTypePatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _LeafP trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeIsKeyword), + Syntax(isKeyword), + Syntax(unexpectedBetweenIsKeywordAndType), + Syntax(type), + Syntax(unexpectedAfterType) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeIsKeyword?.raw, - isKeyword.raw, - unexpectedBetweenIsKeywordAndType?.raw, - type.raw, - unexpectedAfterType?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.isTypePattern, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4558,13 +4345,6 @@ public struct IsTypePatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _LeafP ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeIsKeyword), - Syntax(isKeyword), - Syntax(unexpectedBetweenIsKeywordAndType), - Syntax(type), - Syntax(unexpectedAfterType) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesJKLMN.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesJKLMN.swift index 8fbafefd831..5df069607a3 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesJKLMN.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesJKLMN.swift @@ -162,19 +162,19 @@ public struct KeyPathComponentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforePeriod), + Syntax(period), + Syntax(unexpectedBetweenPeriodAndComponent), + Syntax(component), + Syntax(unexpectedAfterComponent) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforePeriod?.raw, - period?.raw, - unexpectedBetweenPeriodAndComponent?.raw, - component.raw, - unexpectedAfterComponent?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.keyPathComponent, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -182,13 +182,6 @@ public struct KeyPathComponentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforePeriod), - Syntax(period), - Syntax(unexpectedBetweenPeriodAndComponent), - Syntax(component), - Syntax(unexpectedAfterComponent) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -289,21 +282,21 @@ public struct KeyPathExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeBackslash), + Syntax(backslash), + Syntax(unexpectedBetweenBackslashAndRoot), + Syntax(root), + Syntax(unexpectedBetweenRootAndComponents), + Syntax(components), + Syntax(unexpectedAfterComponents) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeBackslash?.raw, - backslash.raw, - unexpectedBetweenBackslashAndRoot?.raw, - root?.raw, - unexpectedBetweenRootAndComponents?.raw, - components.raw, - unexpectedAfterComponents?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.keyPathExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -311,15 +304,6 @@ public struct KeyPathExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeBackslash), - Syntax(backslash), - Syntax(unexpectedBetweenBackslashAndRoot), - Syntax(root), - Syntax(unexpectedBetweenRootAndComponents), - Syntax(components), - Syntax(unexpectedAfterComponents) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -395,7 +379,7 @@ public struct KeyPathExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.keyPathComponentList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -459,13 +443,13 @@ public struct KeyPathOptionalComponentSyntax: SyntaxProtocol, SyntaxHashable, _L trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforeQuestionOrExclamationMark), Syntax(questionOrExclamationMark), Syntax(unexpectedAfterQuestionOrExclamationMark)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforeQuestionOrExclamationMark?.raw, questionOrExclamationMark.raw, unexpectedAfterQuestionOrExclamationMark?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.keyPathOptionalComponent, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -473,7 +457,6 @@ public struct KeyPathOptionalComponentSyntax: SyntaxProtocol, SyntaxHashable, _L ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforeQuestionOrExclamationMark), Syntax(questionOrExclamationMark), Syntax(unexpectedAfterQuestionOrExclamationMark)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -547,19 +530,19 @@ public struct KeyPathPropertyComponentSyntax: SyntaxProtocol, SyntaxHashable, _L trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeDeclName), + Syntax(declName), + Syntax(unexpectedBetweenDeclNameAndGenericArgumentClause), + Syntax(genericArgumentClause), + Syntax(unexpectedAfterGenericArgumentClause) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeDeclName?.raw, - declName.raw, - unexpectedBetweenDeclNameAndGenericArgumentClause?.raw, - genericArgumentClause?.raw, - unexpectedAfterGenericArgumentClause?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.keyPathPropertyComponent, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -567,13 +550,6 @@ public struct KeyPathPropertyComponentSyntax: SyntaxProtocol, SyntaxHashable, _L ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeDeclName), - Syntax(declName), - Syntax(unexpectedBetweenDeclNameAndGenericArgumentClause), - Syntax(genericArgumentClause), - Syntax(unexpectedAfterGenericArgumentClause) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -669,21 +645,21 @@ public struct KeyPathSubscriptComponentSyntax: SyntaxProtocol, SyntaxHashable, _ trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftSquare), + Syntax(leftSquare), + Syntax(unexpectedBetweenLeftSquareAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndRightSquare), + Syntax(rightSquare), + Syntax(unexpectedAfterRightSquare) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeftSquare?.raw, - leftSquare.raw, - unexpectedBetweenLeftSquareAndArguments?.raw, - arguments.raw, - unexpectedBetweenArgumentsAndRightSquare?.raw, - rightSquare.raw, - unexpectedAfterRightSquare?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.keyPathSubscriptComponent, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -691,15 +667,6 @@ public struct KeyPathSubscriptComponentSyntax: SyntaxProtocol, SyntaxHashable, _ ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLeftSquare), - Syntax(leftSquare), - Syntax(unexpectedBetweenLeftSquareAndArguments), - Syntax(arguments), - Syntax(unexpectedBetweenArgumentsAndRightSquare), - Syntax(rightSquare), - Syntax(unexpectedAfterRightSquare) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -757,7 +724,7 @@ public struct KeyPathSubscriptComponentSyntax: SyntaxProtocol, SyntaxHashable, _ collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.labeledExprList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -855,23 +822,23 @@ public struct LabeledExprSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLabel), + Syntax(label), + Syntax(unexpectedBetweenLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLabel?.raw, - label?.raw, - unexpectedBetweenLabelAndColon?.raw, - colon?.raw, - unexpectedBetweenColonAndExpression?.raw, - expression.raw, - unexpectedBetweenExpressionAndTrailingComma?.raw, - trailingComma?.raw, - unexpectedAfterTrailingComma?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.labeledExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -879,17 +846,6 @@ public struct LabeledExprSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLabel), - Syntax(label), - Syntax(unexpectedBetweenLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndExpression), - Syntax(expression), - Syntax(unexpectedBetweenExpressionAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1043,23 +999,23 @@ public struct LabeledSpecializeArgumentSyntax: SyntaxProtocol, SyntaxHashable, _ trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLabel), + Syntax(label), + Syntax(unexpectedBetweenLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndValue), + Syntax(value), + Syntax(unexpectedBetweenValueAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLabel?.raw, - label.raw, - unexpectedBetweenLabelAndColon?.raw, - colon.raw, - unexpectedBetweenColonAndValue?.raw, - value.raw, - unexpectedBetweenValueAndTrailingComma?.raw, - trailingComma?.raw, - unexpectedAfterTrailingComma?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.labeledSpecializeArgument, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1067,17 +1023,6 @@ public struct LabeledSpecializeArgumentSyntax: SyntaxProtocol, SyntaxHashable, _ ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLabel), - Syntax(label), - Syntax(unexpectedBetweenLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndValue), - Syntax(value), - Syntax(unexpectedBetweenValueAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1229,21 +1174,21 @@ public struct LabeledStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSy trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLabel), + Syntax(label), + Syntax(unexpectedBetweenLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndStatement), + Syntax(statement), + Syntax(unexpectedAfterStatement) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLabel?.raw, - label.raw, - unexpectedBetweenLabelAndColon?.raw, - colon.raw, - unexpectedBetweenColonAndStatement?.raw, - statement.raw, - unexpectedAfterStatement?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.labeledStmt, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1251,15 +1196,6 @@ public struct LabeledStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLabel), - Syntax(label), - Syntax(unexpectedBetweenLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndStatement), - Syntax(statement), - Syntax(unexpectedAfterStatement) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1394,38 +1330,6 @@ public struct LayoutRequirementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeType?.raw, - type.raw, - unexpectedBetweenTypeAndColon?.raw, - colon.raw, - unexpectedBetweenColonAndLayoutSpecifier?.raw, - layoutSpecifier.raw, - unexpectedBetweenLayoutSpecifierAndLeftParen?.raw, - leftParen?.raw, - unexpectedBetweenLeftParenAndSize?.raw, - size?.raw, - unexpectedBetweenSizeAndComma?.raw, - comma?.raw, - unexpectedBetweenCommaAndAlignment?.raw, - alignment?.raw, - unexpectedBetweenAlignmentAndRightParen?.raw, - rightParen?.raw, - unexpectedAfterRightParen?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.layoutRequirement, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeType), Syntax(type), @@ -1445,6 +1349,19 @@ public struct LayoutRequirementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt Syntax(rightParen), Syntax(unexpectedAfterRightParen) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.layoutRequirement, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1692,19 +1609,19 @@ public struct LifetimeSpecifierArgumentSyntax: SyntaxProtocol, SyntaxHashable, _ trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeParameter), + Syntax(parameter), + Syntax(unexpectedBetweenParameterAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeParameter?.raw, - parameter.raw, - unexpectedBetweenParameterAndTrailingComma?.raw, - trailingComma?.raw, - unexpectedAfterTrailingComma?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.lifetimeSpecifierArgument, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1712,13 +1629,6 @@ public struct LifetimeSpecifierArgumentSyntax: SyntaxProtocol, SyntaxHashable, _ ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeParameter), - Syntax(parameter), - Syntax(unexpectedBetweenParameterAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1841,32 +1751,6 @@ public struct LifetimeTypeSpecifierSyntax: SyntaxProtocol, SyntaxHashable, _Leaf trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeDependsOnKeyword?.raw, - dependsOnKeyword.raw, - unexpectedBetweenDependsOnKeywordAndLeftParen?.raw, - leftParen.raw, - unexpectedBetweenLeftParenAndScopedKeyword?.raw, - scopedKeyword?.raw, - unexpectedBetweenScopedKeywordAndArguments?.raw, - arguments.raw, - unexpectedBetweenArgumentsAndRightParen?.raw, - rightParen.raw, - unexpectedAfterRightParen?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.lifetimeTypeSpecifier, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeDependsOnKeyword), Syntax(dependsOnKeyword), @@ -1880,6 +1764,19 @@ public struct LifetimeTypeSpecifierSyntax: SyntaxProtocol, SyntaxHashable, _Leaf Syntax(rightParen), Syntax(unexpectedAfterRightParen) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.lifetimeTypeSpecifier, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1983,7 +1880,7 @@ public struct LifetimeTypeSpecifierSyntax: SyntaxProtocol, SyntaxHashable, _Leaf collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.lifetimeSpecifierArgumentList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -2089,38 +1986,6 @@ public struct MacroDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAttributes?.raw, - attributes.raw, - unexpectedBetweenAttributesAndModifiers?.raw, - modifiers.raw, - unexpectedBetweenModifiersAndMacroKeyword?.raw, - macroKeyword.raw, - unexpectedBetweenMacroKeywordAndName?.raw, - name.raw, - unexpectedBetweenNameAndGenericParameterClause?.raw, - genericParameterClause?.raw, - unexpectedBetweenGenericParameterClauseAndSignature?.raw, - signature.raw, - unexpectedBetweenSignatureAndDefinition?.raw, - definition?.raw, - unexpectedBetweenDefinitionAndGenericWhereClause?.raw, - genericWhereClause?.raw, - unexpectedAfterGenericWhereClause?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.macroDecl, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeAttributes), Syntax(attributes), @@ -2140,6 +2005,19 @@ public struct MacroDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt Syntax(genericWhereClause), Syntax(unexpectedAfterGenericWhereClause) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.macroDecl, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2176,7 +2054,7 @@ public struct MacroDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -2221,7 +2099,7 @@ public struct MacroDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -2435,42 +2313,6 @@ public struct MacroExpansionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAttributes?.raw, - attributes.raw, - unexpectedBetweenAttributesAndModifiers?.raw, - modifiers.raw, - unexpectedBetweenModifiersAndPound?.raw, - pound.raw, - unexpectedBetweenPoundAndMacroName?.raw, - macroName.raw, - unexpectedBetweenMacroNameAndGenericArgumentClause?.raw, - genericArgumentClause?.raw, - unexpectedBetweenGenericArgumentClauseAndLeftParen?.raw, - leftParen?.raw, - unexpectedBetweenLeftParenAndArguments?.raw, - arguments.raw, - unexpectedBetweenArgumentsAndRightParen?.raw, - rightParen?.raw, - unexpectedBetweenRightParenAndTrailingClosure?.raw, - trailingClosure?.raw, - unexpectedBetweenTrailingClosureAndAdditionalTrailingClosures?.raw, - additionalTrailingClosures.raw, - unexpectedAfterAdditionalTrailingClosures?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.macroExpansionDecl, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeAttributes), Syntax(attributes), @@ -2494,6 +2336,19 @@ public struct MacroExpansionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea Syntax(additionalTrailingClosures), Syntax(unexpectedAfterAdditionalTrailingClosures) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.macroExpansionDecl, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2530,7 +2385,7 @@ public struct MacroExpansionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -2575,7 +2430,7 @@ public struct MacroExpansionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -2703,7 +2558,7 @@ public struct MacroExpansionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.labeledExprList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -2787,7 +2642,7 @@ public struct MacroExpansionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.multipleTrailingClosureElementList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -2883,38 +2738,6 @@ public struct MacroExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforePound?.raw, - pound.raw, - unexpectedBetweenPoundAndMacroName?.raw, - macroName.raw, - unexpectedBetweenMacroNameAndGenericArgumentClause?.raw, - genericArgumentClause?.raw, - unexpectedBetweenGenericArgumentClauseAndLeftParen?.raw, - leftParen?.raw, - unexpectedBetweenLeftParenAndArguments?.raw, - arguments.raw, - unexpectedBetweenArgumentsAndRightParen?.raw, - rightParen?.raw, - unexpectedBetweenRightParenAndTrailingClosure?.raw, - trailingClosure?.raw, - unexpectedBetweenTrailingClosureAndAdditionalTrailingClosures?.raw, - additionalTrailingClosures.raw, - unexpectedAfterAdditionalTrailingClosures?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.macroExpansionExpr, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforePound), Syntax(pound), @@ -2934,6 +2757,19 @@ public struct MacroExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea Syntax(additionalTrailingClosures), Syntax(unexpectedAfterAdditionalTrailingClosures) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.macroExpansionExpr, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3053,7 +2889,7 @@ public struct MacroExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.labeledExprList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -3137,7 +2973,7 @@ public struct MacroExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.multipleTrailingClosureElementList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -3218,23 +3054,23 @@ public struct MatchingPatternConditionSyntax: SyntaxProtocol, SyntaxHashable, _L trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeCaseKeyword), + Syntax(caseKeyword), + Syntax(unexpectedBetweenCaseKeywordAndPattern), + Syntax(pattern), + Syntax(unexpectedBetweenPatternAndTypeAnnotation), + Syntax(typeAnnotation), + Syntax(unexpectedBetweenTypeAnnotationAndInitializer), + Syntax(initializer), + Syntax(unexpectedAfterInitializer) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeCaseKeyword?.raw, - caseKeyword.raw, - unexpectedBetweenCaseKeywordAndPattern?.raw, - pattern.raw, - unexpectedBetweenPatternAndTypeAnnotation?.raw, - typeAnnotation?.raw, - unexpectedBetweenTypeAnnotationAndInitializer?.raw, - initializer.raw, - unexpectedAfterInitializer?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.matchingPatternCondition, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3242,17 +3078,6 @@ public struct MatchingPatternConditionSyntax: SyntaxProtocol, SyntaxHashable, _L ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeCaseKeyword), - Syntax(caseKeyword), - Syntax(unexpectedBetweenCaseKeywordAndPattern), - Syntax(pattern), - Syntax(unexpectedBetweenPatternAndTypeAnnotation), - Syntax(typeAnnotation), - Syntax(unexpectedBetweenTypeAnnotationAndInitializer), - Syntax(initializer), - Syntax(unexpectedAfterInitializer) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3389,21 +3214,21 @@ public struct MemberAccessExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeBase), + Syntax(base), + Syntax(unexpectedBetweenBaseAndPeriod), + Syntax(period), + Syntax(unexpectedBetweenPeriodAndDeclName), + Syntax(declName), + Syntax(unexpectedAfterDeclName) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeBase?.raw, - base?.raw, - unexpectedBetweenBaseAndPeriod?.raw, - period.raw, - unexpectedBetweenPeriodAndDeclName?.raw, - declName.raw, - unexpectedAfterDeclName?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.memberAccessExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3411,15 +3236,6 @@ public struct MemberAccessExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeBase), - Syntax(base), - Syntax(unexpectedBetweenBaseAndPeriod), - Syntax(period), - Syntax(unexpectedBetweenPeriodAndDeclName), - Syntax(declName), - Syntax(unexpectedAfterDeclName) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3539,19 +3355,19 @@ public struct MemberBlockItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeDecl), + Syntax(decl), + Syntax(unexpectedBetweenDeclAndSemicolon), + Syntax(semicolon), + Syntax(unexpectedAfterSemicolon) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeDecl?.raw, - decl.raw, - unexpectedBetweenDeclAndSemicolon?.raw, - semicolon?.raw, - unexpectedAfterSemicolon?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.memberBlockItem, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3559,13 +3375,6 @@ public struct MemberBlockItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeDecl), - Syntax(decl), - Syntax(unexpectedBetweenDeclAndSemicolon), - Syntax(semicolon), - Syntax(unexpectedAfterSemicolon) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3670,21 +3479,21 @@ public struct MemberBlockSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftBrace), + Syntax(leftBrace), + Syntax(unexpectedBetweenLeftBraceAndMembers), + Syntax(members), + Syntax(unexpectedBetweenMembersAndRightBrace), + Syntax(rightBrace), + Syntax(unexpectedAfterRightBrace) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeftBrace?.raw, - leftBrace.raw, - unexpectedBetweenLeftBraceAndMembers?.raw, - members.raw, - unexpectedBetweenMembersAndRightBrace?.raw, - rightBrace.raw, - unexpectedAfterRightBrace?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.memberBlock, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3692,15 +3501,6 @@ public struct MemberBlockSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLeftBrace), - Syntax(leftBrace), - Syntax(unexpectedBetweenLeftBraceAndMembers), - Syntax(members), - Syntax(unexpectedBetweenMembersAndRightBrace), - Syntax(rightBrace), - Syntax(unexpectedAfterRightBrace) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3758,7 +3558,7 @@ public struct MemberBlockSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.memberBlockItemList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -3846,23 +3646,23 @@ public struct MemberTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSyn trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeBaseType), + Syntax(baseType), + Syntax(unexpectedBetweenBaseTypeAndPeriod), + Syntax(period), + Syntax(unexpectedBetweenPeriodAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndGenericArgumentClause), + Syntax(genericArgumentClause), + Syntax(unexpectedAfterGenericArgumentClause) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeBaseType?.raw, - baseType.raw, - unexpectedBetweenBaseTypeAndPeriod?.raw, - period.raw, - unexpectedBetweenPeriodAndName?.raw, - name.raw, - unexpectedBetweenNameAndGenericArgumentClause?.raw, - genericArgumentClause?.raw, - unexpectedAfterGenericArgumentClause?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.memberType, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3870,17 +3670,6 @@ public struct MemberTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSyn ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeBaseType), - Syntax(baseType), - Syntax(unexpectedBetweenBaseTypeAndPeriod), - Syntax(period), - Syntax(unexpectedBetweenPeriodAndName), - Syntax(name), - Syntax(unexpectedBetweenNameAndGenericArgumentClause), - Syntax(genericArgumentClause), - Syntax(unexpectedAfterGenericArgumentClause) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4018,21 +3807,21 @@ public struct MetatypeTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeS trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeBaseType), + Syntax(baseType), + Syntax(unexpectedBetweenBaseTypeAndPeriod), + Syntax(period), + Syntax(unexpectedBetweenPeriodAndMetatypeSpecifier), + Syntax(metatypeSpecifier), + Syntax(unexpectedAfterMetatypeSpecifier) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeBaseType?.raw, - baseType.raw, - unexpectedBetweenBaseTypeAndPeriod?.raw, - period.raw, - unexpectedBetweenPeriodAndMetatypeSpecifier?.raw, - metatypeSpecifier.raw, - unexpectedAfterMetatypeSpecifier?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.metatypeType, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4040,15 +3829,6 @@ public struct MetatypeTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeS ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeBaseType), - Syntax(baseType), - Syntax(unexpectedBetweenBaseTypeAndPeriod), - Syntax(period), - Syntax(unexpectedBetweenPeriodAndMetatypeSpecifier), - Syntax(metatypeSpecifier), - Syntax(unexpectedAfterMetatypeSpecifier) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4171,21 +3951,21 @@ public struct MissingDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSy trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndPlaceholder), + Syntax(placeholder), + Syntax(unexpectedAfterPlaceholder) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAttributes?.raw, - attributes.raw, - unexpectedBetweenAttributesAndModifiers?.raw, - modifiers.raw, - unexpectedBetweenModifiersAndPlaceholder?.raw, - placeholder.raw, - unexpectedAfterPlaceholder?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.missingDecl, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4193,15 +3973,6 @@ public struct MissingDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndModifiers), - Syntax(modifiers), - Syntax(unexpectedBetweenModifiersAndPlaceholder), - Syntax(placeholder), - Syntax(unexpectedAfterPlaceholder) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4239,7 +4010,7 @@ public struct MissingDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSy collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -4285,7 +4056,7 @@ public struct MissingDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSy collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -4371,13 +4142,13 @@ public struct MissingExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforePlaceholder?.raw, placeholder.raw, unexpectedAfterPlaceholder?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.missingExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4385,7 +4156,6 @@ public struct MissingExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4455,13 +4225,13 @@ public struct MissingPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _Leaf trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforePlaceholder?.raw, placeholder.raw, unexpectedAfterPlaceholder?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.missingPattern, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4469,7 +4239,6 @@ public struct MissingPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _Leaf ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4539,13 +4308,13 @@ public struct MissingStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSy trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforePlaceholder?.raw, placeholder.raw, unexpectedAfterPlaceholder?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.missingStmt, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4553,7 +4322,6 @@ public struct MissingStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4623,13 +4391,13 @@ public struct MissingSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodeProt trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforePlaceholder?.raw, placeholder.raw, unexpectedAfterPlaceholder?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.missing, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4637,7 +4405,6 @@ public struct MissingSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodeProt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4707,13 +4474,13 @@ public struct MissingTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSy trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforePlaceholder?.raw, placeholder.raw, unexpectedAfterPlaceholder?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.missingType, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4721,7 +4488,6 @@ public struct MissingTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforePlaceholder), Syntax(placeholder), Syntax(unexpectedAfterPlaceholder)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4798,21 +4564,21 @@ public struct MultipleTrailingClosureElementSyntax: SyntaxProtocol, SyntaxHashab trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLabel), + Syntax(label), + Syntax(unexpectedBetweenLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndClosure), + Syntax(closure), + Syntax(unexpectedAfterClosure) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLabel?.raw, - label.raw, - unexpectedBetweenLabelAndColon?.raw, - colon.raw, - unexpectedBetweenColonAndClosure?.raw, - closure.raw, - unexpectedAfterClosure?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.multipleTrailingClosureElement, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4820,15 +4586,6 @@ public struct MultipleTrailingClosureElementSyntax: SyntaxProtocol, SyntaxHashab ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLabel), - Syntax(label), - Syntax(unexpectedBetweenLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndClosure), - Syntax(closure), - Syntax(unexpectedAfterClosure) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4944,19 +4701,19 @@ public struct NamedOpaqueReturnTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _ trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeGenericParameterClause), + Syntax(genericParameterClause), + Syntax(unexpectedBetweenGenericParameterClauseAndType), + Syntax(type), + Syntax(unexpectedAfterType) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeGenericParameterClause?.raw, - genericParameterClause.raw, - unexpectedBetweenGenericParameterClauseAndType?.raw, - type.raw, - unexpectedAfterType?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.namedOpaqueReturnType, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4964,13 +4721,6 @@ public struct NamedOpaqueReturnTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _ ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeGenericParameterClause), - Syntax(genericParameterClause), - Syntax(unexpectedBetweenGenericParameterClauseAndType), - Syntax(type), - Syntax(unexpectedAfterType) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -5055,13 +4805,13 @@ public struct NilLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExp trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforeNilKeyword), Syntax(nilKeyword), Syntax(unexpectedAfterNilKeyword)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforeNilKeyword?.raw, nilKeyword.raw, unexpectedAfterNilKeyword?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.nilLiteralExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -5069,7 +4819,6 @@ public struct NilLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExp ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforeNilKeyword), Syntax(nilKeyword), Syntax(unexpectedAfterNilKeyword)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesOP.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesOP.swift index 601c933c0ec..1a9c7f2cdef 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesOP.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesOP.swift @@ -49,19 +49,19 @@ public struct ObjCSelectorPieceSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeName), + Syntax(name), + Syntax(unexpectedBetweenNameAndColon), + Syntax(colon), + Syntax(unexpectedAfterColon) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeName?.raw, - name?.raw, - unexpectedBetweenNameAndColon?.raw, - colon?.raw, - unexpectedAfterColon?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.objCSelectorPiece, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -69,13 +69,6 @@ public struct ObjCSelectorPieceSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeName), - Syntax(name), - Syntax(unexpectedBetweenNameAndColon), - Syntax(colon), - Syntax(unexpectedAfterColon) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -179,21 +172,21 @@ public struct OpaqueReturnTypeOfAttributeArgumentsSyntax: SyntaxProtocol, Syntax trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeMangledName), + Syntax(mangledName), + Syntax(unexpectedBetweenMangledNameAndComma), + Syntax(comma), + Syntax(unexpectedBetweenCommaAndOrdinal), + Syntax(ordinal), + Syntax(unexpectedAfterOrdinal) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeMangledName?.raw, - mangledName.raw, - unexpectedBetweenMangledNameAndComma?.raw, - comma.raw, - unexpectedBetweenCommaAndOrdinal?.raw, - ordinal.raw, - unexpectedAfterOrdinal?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.opaqueReturnTypeOfAttributeArguments, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -201,15 +194,6 @@ public struct OpaqueReturnTypeOfAttributeArgumentsSyntax: SyntaxProtocol, Syntax ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeMangledName), - Syntax(mangledName), - Syntax(unexpectedBetweenMangledNameAndComma), - Syntax(comma), - Syntax(unexpectedBetweenCommaAndOrdinal), - Syntax(ordinal), - Syntax(unexpectedAfterOrdinal) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -335,23 +319,23 @@ public struct OperatorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeFixitySpecifier), + Syntax(fixitySpecifier), + Syntax(unexpectedBetweenFixitySpecifierAndOperatorKeyword), + Syntax(operatorKeyword), + Syntax(unexpectedBetweenOperatorKeywordAndName), + Syntax(name), + Syntax(unexpectedBetweenNameAndOperatorPrecedenceAndTypes), + Syntax(operatorPrecedenceAndTypes), + Syntax(unexpectedAfterOperatorPrecedenceAndTypes) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeFixitySpecifier?.raw, - fixitySpecifier.raw, - unexpectedBetweenFixitySpecifierAndOperatorKeyword?.raw, - operatorKeyword.raw, - unexpectedBetweenOperatorKeywordAndName?.raw, - name.raw, - unexpectedBetweenNameAndOperatorPrecedenceAndTypes?.raw, - operatorPrecedenceAndTypes?.raw, - unexpectedAfterOperatorPrecedenceAndTypes?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.operatorDecl, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -359,17 +343,6 @@ public struct OperatorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeFixitySpecifier), - Syntax(fixitySpecifier), - Syntax(unexpectedBetweenFixitySpecifierAndOperatorKeyword), - Syntax(operatorKeyword), - Syntax(unexpectedBetweenOperatorKeywordAndName), - Syntax(name), - Syntax(unexpectedBetweenNameAndOperatorPrecedenceAndTypes), - Syntax(operatorPrecedenceAndTypes), - Syntax(unexpectedAfterOperatorPrecedenceAndTypes) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -525,21 +498,21 @@ public struct OperatorPrecedenceAndTypesSyntax: SyntaxProtocol, SyntaxHashable, trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndPrecedenceGroup), + Syntax(precedenceGroup), + Syntax(unexpectedBetweenPrecedenceGroupAndDesignatedTypes), + Syntax(designatedTypes), + Syntax(unexpectedAfterDesignatedTypes) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeColon?.raw, - colon.raw, - unexpectedBetweenColonAndPrecedenceGroup?.raw, - precedenceGroup.raw, - unexpectedBetweenPrecedenceGroupAndDesignatedTypes?.raw, - designatedTypes.raw, - unexpectedAfterDesignatedTypes?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.operatorPrecedenceAndTypes, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -547,15 +520,6 @@ public struct OperatorPrecedenceAndTypesSyntax: SyntaxProtocol, SyntaxHashable, ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndPrecedenceGroup), - Syntax(precedenceGroup), - Syntax(unexpectedBetweenPrecedenceGroupAndDesignatedTypes), - Syntax(designatedTypes), - Syntax(unexpectedAfterDesignatedTypes) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -637,7 +601,7 @@ public struct OperatorPrecedenceAndTypesSyntax: SyntaxProtocol, SyntaxHashable, collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.designatedTypeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -708,23 +672,23 @@ public struct OptionalBindingConditionSyntax: SyntaxProtocol, SyntaxHashable, _L trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeBindingSpecifier), + Syntax(bindingSpecifier), + Syntax(unexpectedBetweenBindingSpecifierAndPattern), + Syntax(pattern), + Syntax(unexpectedBetweenPatternAndTypeAnnotation), + Syntax(typeAnnotation), + Syntax(unexpectedBetweenTypeAnnotationAndInitializer), + Syntax(initializer), + Syntax(unexpectedAfterInitializer) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeBindingSpecifier?.raw, - bindingSpecifier.raw, - unexpectedBetweenBindingSpecifierAndPattern?.raw, - pattern.raw, - unexpectedBetweenPatternAndTypeAnnotation?.raw, - typeAnnotation?.raw, - unexpectedBetweenTypeAnnotationAndInitializer?.raw, - initializer?.raw, - unexpectedAfterInitializer?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.optionalBindingCondition, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -732,17 +696,6 @@ public struct OptionalBindingConditionSyntax: SyntaxProtocol, SyntaxHashable, _L ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeBindingSpecifier), - Syntax(bindingSpecifier), - Syntax(unexpectedBetweenBindingSpecifierAndPattern), - Syntax(pattern), - Syntax(unexpectedBetweenPatternAndTypeAnnotation), - Syntax(typeAnnotation), - Syntax(unexpectedBetweenTypeAnnotationAndInitializer), - Syntax(initializer), - Syntax(unexpectedAfterInitializer) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -878,19 +831,19 @@ public struct OptionalChainingExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _L trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndQuestionMark), + Syntax(questionMark), + Syntax(unexpectedAfterQuestionMark) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeExpression?.raw, - expression.raw, - unexpectedBetweenExpressionAndQuestionMark?.raw, - questionMark.raw, - unexpectedAfterQuestionMark?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.optionalChainingExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -898,13 +851,6 @@ public struct OptionalChainingExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _L ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeExpression), - Syntax(expression), - Syntax(unexpectedBetweenExpressionAndQuestionMark), - Syntax(questionMark), - Syntax(unexpectedAfterQuestionMark) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -994,19 +940,19 @@ public struct OptionalTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeS trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeWrappedType), + Syntax(wrappedType), + Syntax(unexpectedBetweenWrappedTypeAndQuestionMark), + Syntax(questionMark), + Syntax(unexpectedAfterQuestionMark) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeWrappedType?.raw, - wrappedType.raw, - unexpectedBetweenWrappedTypeAndQuestionMark?.raw, - questionMark.raw, - unexpectedAfterQuestionMark?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.optionalType, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1014,13 +960,6 @@ public struct OptionalTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeS ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeWrappedType), - Syntax(wrappedType), - Syntax(unexpectedBetweenWrappedTypeAndQuestionMark), - Syntax(questionMark), - Syntax(unexpectedAfterQuestionMark) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1125,32 +1064,6 @@ public struct OriginallyDefinedInAttributeArgumentsSyntax: SyntaxProtocol, Synta trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeModuleLabel?.raw, - moduleLabel.raw, - unexpectedBetweenModuleLabelAndColon?.raw, - colon.raw, - unexpectedBetweenColonAndModuleName?.raw, - moduleName.raw, - unexpectedBetweenModuleNameAndComma?.raw, - comma.raw, - unexpectedBetweenCommaAndPlatforms?.raw, - platforms.raw, - unexpectedAfterPlatforms?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.originallyDefinedInAttributeArguments, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeModuleLabel), Syntax(moduleLabel), @@ -1164,6 +1077,19 @@ public struct OriginallyDefinedInAttributeArgumentsSyntax: SyntaxProtocol, Synta Syntax(platforms), Syntax(unexpectedAfterPlatforms) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.originallyDefinedInAttributeArguments, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1281,7 +1207,7 @@ public struct OriginallyDefinedInAttributeArgumentsSyntax: SyntaxProtocol, Synta collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.platformVersionItemList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -1348,19 +1274,19 @@ public struct PackElementExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafEx trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeEachKeyword), + Syntax(eachKeyword), + Syntax(unexpectedBetweenEachKeywordAndPack), + Syntax(pack), + Syntax(unexpectedAfterPack) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeEachKeyword?.raw, - eachKeyword.raw, - unexpectedBetweenEachKeywordAndPack?.raw, - pack.raw, - unexpectedAfterPack?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.packElementExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1368,13 +1294,6 @@ public struct PackElementExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafEx ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeEachKeyword), - Syntax(eachKeyword), - Syntax(unexpectedBetweenEachKeywordAndPack), - Syntax(pack), - Syntax(unexpectedAfterPack) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1464,19 +1383,19 @@ public struct PackElementTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTy trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeEachKeyword), + Syntax(eachKeyword), + Syntax(unexpectedBetweenEachKeywordAndPack), + Syntax(pack), + Syntax(unexpectedAfterPack) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeEachKeyword?.raw, - eachKeyword.raw, - unexpectedBetweenEachKeywordAndPack?.raw, - pack.raw, - unexpectedAfterPack?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.packElementType, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1484,13 +1403,6 @@ public struct PackElementTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeEachKeyword), - Syntax(eachKeyword), - Syntax(unexpectedBetweenEachKeywordAndPack), - Syntax(pack), - Syntax(unexpectedAfterPack) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1582,19 +1494,19 @@ public struct PackExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeRepeatKeyword), + Syntax(repeatKeyword), + Syntax(unexpectedBetweenRepeatKeywordAndRepetitionPattern), + Syntax(repetitionPattern), + Syntax(unexpectedAfterRepetitionPattern) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeRepeatKeyword?.raw, - repeatKeyword.raw, - unexpectedBetweenRepeatKeywordAndRepetitionPattern?.raw, - repetitionPattern.raw, - unexpectedAfterRepetitionPattern?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.packExpansionExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1602,13 +1514,6 @@ public struct PackExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeRepeatKeyword), - Syntax(repeatKeyword), - Syntax(unexpectedBetweenRepeatKeywordAndRepetitionPattern), - Syntax(repetitionPattern), - Syntax(unexpectedAfterRepetitionPattern) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1698,19 +1603,19 @@ public struct PackExpansionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _Leaf trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeRepeatKeyword), + Syntax(repeatKeyword), + Syntax(unexpectedBetweenRepeatKeywordAndRepetitionPattern), + Syntax(repetitionPattern), + Syntax(unexpectedAfterRepetitionPattern) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeRepeatKeyword?.raw, - repeatKeyword.raw, - unexpectedBetweenRepeatKeywordAndRepetitionPattern?.raw, - repetitionPattern.raw, - unexpectedAfterRepetitionPattern?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.packExpansionType, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1718,13 +1623,6 @@ public struct PackExpansionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _Leaf ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeRepeatKeyword), - Syntax(repeatKeyword), - Syntax(unexpectedBetweenRepeatKeywordAndRepetitionPattern), - Syntax(repetitionPattern), - Syntax(unexpectedAfterRepetitionPattern) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1833,32 +1731,6 @@ public struct PatternBindingSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforePattern?.raw, - pattern.raw, - unexpectedBetweenPatternAndTypeAnnotation?.raw, - typeAnnotation?.raw, - unexpectedBetweenTypeAnnotationAndInitializer?.raw, - initializer?.raw, - unexpectedBetweenInitializerAndAccessorBlock?.raw, - accessorBlock?.raw, - unexpectedBetweenAccessorBlockAndTrailingComma?.raw, - trailingComma?.raw, - unexpectedAfterTrailingComma?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.patternBinding, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforePattern), Syntax(pattern), @@ -1872,6 +1744,19 @@ public struct PatternBindingSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN Syntax(trailingComma), Syntax(unexpectedAfterTrailingComma) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.patternBinding, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2034,13 +1919,13 @@ public struct PatternExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforePattern), Syntax(pattern), Syntax(unexpectedAfterPattern)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforePattern?.raw, pattern.raw, unexpectedAfterPattern?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.patternExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -2048,7 +1933,6 @@ public struct PatternExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforePattern), Syntax(pattern), Syntax(unexpectedAfterPattern)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2119,19 +2003,19 @@ public struct PlatformVersionItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforePlatformVersion), + Syntax(platformVersion), + Syntax(unexpectedBetweenPlatformVersionAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforePlatformVersion?.raw, - platformVersion.raw, - unexpectedBetweenPlatformVersionAndTrailingComma?.raw, - trailingComma?.raw, - unexpectedAfterTrailingComma?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.platformVersionItem, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -2139,13 +2023,6 @@ public struct PlatformVersionItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforePlatformVersion), - Syntax(platformVersion), - Syntax(unexpectedBetweenPlatformVersionAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2247,19 +2124,19 @@ public struct PlatformVersionSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforePlatform), + Syntax(platform), + Syntax(unexpectedBetweenPlatformAndVersion), + Syntax(version), + Syntax(unexpectedAfterVersion) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforePlatform?.raw, - platform.raw, - unexpectedBetweenPlatformAndVersion?.raw, - version?.raw, - unexpectedAfterVersion?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.platformVersion, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -2267,13 +2144,6 @@ public struct PlatformVersionSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforePlatform), - Syntax(platform), - Syntax(unexpectedBetweenPlatformAndVersion), - Syntax(version), - Syntax(unexpectedAfterVersion) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2370,19 +2240,19 @@ public struct PostfixIfConfigExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Le trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeBase), + Syntax(base), + Syntax(unexpectedBetweenBaseAndConfig), + Syntax(config), + Syntax(unexpectedAfterConfig) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeBase?.raw, - base?.raw, - unexpectedBetweenBaseAndConfig?.raw, - config.raw, - unexpectedAfterConfig?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.postfixIfConfigExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -2390,13 +2260,6 @@ public struct PostfixIfConfigExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Le ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeBase), - Syntax(base), - Syntax(unexpectedBetweenBaseAndConfig), - Syntax(config), - Syntax(unexpectedAfterConfig) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2483,19 +2346,19 @@ public struct PostfixOperatorExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Le trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndOperator), + Syntax(`operator`), + Syntax(unexpectedAfterOperator) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeExpression?.raw, - expression.raw, - unexpectedBetweenExpressionAndOperator?.raw, - `operator`.raw, - unexpectedAfterOperator?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.postfixOperatorExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -2503,13 +2366,6 @@ public struct PostfixOperatorExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Le ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeExpression), - Syntax(expression), - Syntax(unexpectedBetweenExpressionAndOperator), - Syntax(`operator`), - Syntax(unexpectedAfterOperator) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2618,36 +2474,6 @@ public struct PoundSourceLocationArgumentsSyntax: SyntaxProtocol, SyntaxHashable trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeFileLabel?.raw, - fileLabel.raw, - unexpectedBetweenFileLabelAndFileColon?.raw, - fileColon.raw, - unexpectedBetweenFileColonAndFileName?.raw, - fileName.raw, - unexpectedBetweenFileNameAndComma?.raw, - comma.raw, - unexpectedBetweenCommaAndLineLabel?.raw, - lineLabel.raw, - unexpectedBetweenLineLabelAndLineColon?.raw, - lineColon.raw, - unexpectedBetweenLineColonAndLineNumber?.raw, - lineNumber.raw, - unexpectedAfterLineNumber?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.poundSourceLocationArguments, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeFileLabel), Syntax(fileLabel), @@ -2665,6 +2491,19 @@ public struct PoundSourceLocationArgumentsSyntax: SyntaxProtocol, SyntaxHashable Syntax(lineNumber), Syntax(unexpectedAfterLineNumber) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.poundSourceLocationArguments, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2875,23 +2714,23 @@ public struct PoundSourceLocationSyntax: DeclSyntaxProtocol, SyntaxHashable, _Le trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforePoundSourceLocation), + Syntax(poundSourceLocation), + Syntax(unexpectedBetweenPoundSourceLocationAndLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndArguments), + Syntax(arguments), + Syntax(unexpectedBetweenArgumentsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforePoundSourceLocation?.raw, - poundSourceLocation.raw, - unexpectedBetweenPoundSourceLocationAndLeftParen?.raw, - leftParen.raw, - unexpectedBetweenLeftParenAndArguments?.raw, - arguments?.raw, - unexpectedBetweenArgumentsAndRightParen?.raw, - rightParen.raw, - unexpectedAfterRightParen?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.poundSourceLocation, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -2899,17 +2738,6 @@ public struct PoundSourceLocationSyntax: DeclSyntaxProtocol, SyntaxHashable, _Le ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforePoundSourceLocation), - Syntax(poundSourceLocation), - Syntax(unexpectedBetweenPoundSourceLocationAndLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndArguments), - Syntax(arguments), - Syntax(unexpectedBetweenArgumentsAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3055,21 +2883,21 @@ public struct PrecedenceGroupAssignmentSyntax: SyntaxProtocol, SyntaxHashable, _ trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAssignmentLabel), + Syntax(assignmentLabel), + Syntax(unexpectedBetweenAssignmentLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndValue), + Syntax(value), + Syntax(unexpectedAfterValue) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAssignmentLabel?.raw, - assignmentLabel.raw, - unexpectedBetweenAssignmentLabelAndColon?.raw, - colon.raw, - unexpectedBetweenColonAndValue?.raw, - value.raw, - unexpectedAfterValue?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.precedenceGroupAssignment, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3077,15 +2905,6 @@ public struct PrecedenceGroupAssignmentSyntax: SyntaxProtocol, SyntaxHashable, _ ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeAssignmentLabel), - Syntax(assignmentLabel), - Syntax(unexpectedBetweenAssignmentLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndValue), - Syntax(value), - Syntax(unexpectedAfterValue) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3215,21 +3034,21 @@ public struct PrecedenceGroupAssociativitySyntax: SyntaxProtocol, SyntaxHashable trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAssociativityLabel), + Syntax(associativityLabel), + Syntax(unexpectedBetweenAssociativityLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndValue), + Syntax(value), + Syntax(unexpectedAfterValue) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAssociativityLabel?.raw, - associativityLabel.raw, - unexpectedBetweenAssociativityLabelAndColon?.raw, - colon.raw, - unexpectedBetweenColonAndValue?.raw, - value.raw, - unexpectedAfterValue?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.precedenceGroupAssociativity, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3237,15 +3056,6 @@ public struct PrecedenceGroupAssociativitySyntax: SyntaxProtocol, SyntaxHashable ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeAssociativityLabel), - Syntax(associativityLabel), - Syntax(unexpectedBetweenAssociativityLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndValue), - Syntax(value), - Syntax(unexpectedAfterValue) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3387,36 +3197,6 @@ public struct PrecedenceGroupDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Le trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAttributes?.raw, - attributes.raw, - unexpectedBetweenAttributesAndModifiers?.raw, - modifiers.raw, - unexpectedBetweenModifiersAndPrecedencegroupKeyword?.raw, - precedencegroupKeyword.raw, - unexpectedBetweenPrecedencegroupKeywordAndName?.raw, - name.raw, - unexpectedBetweenNameAndLeftBrace?.raw, - leftBrace.raw, - unexpectedBetweenLeftBraceAndGroupAttributes?.raw, - groupAttributes.raw, - unexpectedBetweenGroupAttributesAndRightBrace?.raw, - rightBrace.raw, - unexpectedAfterRightBrace?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.precedenceGroupDecl, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeAttributes), Syntax(attributes), @@ -3434,6 +3214,19 @@ public struct PrecedenceGroupDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Le Syntax(rightBrace), Syntax(unexpectedAfterRightBrace) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.precedenceGroupDecl, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3471,7 +3264,7 @@ public struct PrecedenceGroupDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Le collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -3517,7 +3310,7 @@ public struct PrecedenceGroupDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Le collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -3628,7 +3421,7 @@ public struct PrecedenceGroupDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Le collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.precedenceGroupAttributeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -3722,19 +3515,19 @@ public struct PrecedenceGroupNameSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeName), + Syntax(name), + Syntax(unexpectedBetweenNameAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeName?.raw, - name.raw, - unexpectedBetweenNameAndTrailingComma?.raw, - trailingComma?.raw, - unexpectedAfterTrailingComma?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.precedenceGroupName, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3742,13 +3535,6 @@ public struct PrecedenceGroupNameSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeName), - Syntax(name), - Syntax(unexpectedBetweenNameAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3852,21 +3638,21 @@ public struct PrecedenceGroupRelationSyntax: SyntaxProtocol, SyntaxHashable, _Le trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeHigherThanOrLowerThanLabel), + Syntax(higherThanOrLowerThanLabel), + Syntax(unexpectedBetweenHigherThanOrLowerThanLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndPrecedenceGroups), + Syntax(precedenceGroups), + Syntax(unexpectedAfterPrecedenceGroups) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeHigherThanOrLowerThanLabel?.raw, - higherThanOrLowerThanLabel.raw, - unexpectedBetweenHigherThanOrLowerThanLabelAndColon?.raw, - colon.raw, - unexpectedBetweenColonAndPrecedenceGroups?.raw, - precedenceGroups.raw, - unexpectedAfterPrecedenceGroups?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.precedenceGroupRelation, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3874,15 +3660,6 @@ public struct PrecedenceGroupRelationSyntax: SyntaxProtocol, SyntaxHashable, _Le ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeHigherThanOrLowerThanLabel), - Syntax(higherThanOrLowerThanLabel), - Syntax(unexpectedBetweenHigherThanOrLowerThanLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndPrecedenceGroups), - Syntax(precedenceGroups), - Syntax(unexpectedAfterPrecedenceGroups) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3966,7 +3743,7 @@ public struct PrecedenceGroupRelationSyntax: SyntaxProtocol, SyntaxHashable, _Le collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.precedenceGroupNameList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -4039,19 +3816,19 @@ public struct PrefixOperatorExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeOperator), + Syntax(`operator`), + Syntax(unexpectedBetweenOperatorAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeOperator?.raw, - `operator`.raw, - unexpectedBetweenOperatorAndExpression?.raw, - expression.raw, - unexpectedAfterExpression?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.prefixOperatorExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4059,13 +3836,6 @@ public struct PrefixOperatorExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeOperator), - Syntax(`operator`), - Syntax(unexpectedBetweenOperatorAndExpression), - Syntax(expression), - Syntax(unexpectedAfterExpression) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4162,21 +3932,21 @@ public struct PrimaryAssociatedTypeClauseSyntax: SyntaxProtocol, SyntaxHashable, trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftAngle), + Syntax(leftAngle), + Syntax(unexpectedBetweenLeftAngleAndPrimaryAssociatedTypes), + Syntax(primaryAssociatedTypes), + Syntax(unexpectedBetweenPrimaryAssociatedTypesAndRightAngle), + Syntax(rightAngle), + Syntax(unexpectedAfterRightAngle) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeftAngle?.raw, - leftAngle.raw, - unexpectedBetweenLeftAngleAndPrimaryAssociatedTypes?.raw, - primaryAssociatedTypes.raw, - unexpectedBetweenPrimaryAssociatedTypesAndRightAngle?.raw, - rightAngle.raw, - unexpectedAfterRightAngle?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.primaryAssociatedTypeClause, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4184,15 +3954,6 @@ public struct PrimaryAssociatedTypeClauseSyntax: SyntaxProtocol, SyntaxHashable, ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLeftAngle), - Syntax(leftAngle), - Syntax(unexpectedBetweenLeftAngleAndPrimaryAssociatedTypes), - Syntax(primaryAssociatedTypes), - Syntax(unexpectedBetweenPrimaryAssociatedTypesAndRightAngle), - Syntax(rightAngle), - Syntax(unexpectedAfterRightAngle) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4250,7 +4011,7 @@ public struct PrimaryAssociatedTypeClauseSyntax: SyntaxProtocol, SyntaxHashable, collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.primaryAssociatedTypeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -4336,19 +4097,19 @@ public struct PrimaryAssociatedTypeSyntax: SyntaxProtocol, SyntaxHashable, _Leaf trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeName), + Syntax(name), + Syntax(unexpectedBetweenNameAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeName?.raw, - name.raw, - unexpectedBetweenNameAndTrailingComma?.raw, - trailingComma?.raw, - unexpectedAfterTrailingComma?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.primaryAssociatedType, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4356,13 +4117,6 @@ public struct PrimaryAssociatedTypeSyntax: SyntaxProtocol, SyntaxHashable, _Leaf ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeName), - Syntax(name), - Syntax(unexpectedBetweenNameAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4491,38 +4245,6 @@ public struct ProtocolDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAttributes?.raw, - attributes.raw, - unexpectedBetweenAttributesAndModifiers?.raw, - modifiers.raw, - unexpectedBetweenModifiersAndProtocolKeyword?.raw, - protocolKeyword.raw, - unexpectedBetweenProtocolKeywordAndName?.raw, - name.raw, - unexpectedBetweenNameAndPrimaryAssociatedTypeClause?.raw, - primaryAssociatedTypeClause?.raw, - unexpectedBetweenPrimaryAssociatedTypeClauseAndInheritanceClause?.raw, - inheritanceClause?.raw, - unexpectedBetweenInheritanceClauseAndGenericWhereClause?.raw, - genericWhereClause?.raw, - unexpectedBetweenGenericWhereClauseAndMemberBlock?.raw, - memberBlock.raw, - unexpectedAfterMemberBlock?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.protocolDecl, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeAttributes), Syntax(attributes), @@ -4542,6 +4264,19 @@ public struct ProtocolDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS Syntax(memberBlock), Syntax(unexpectedAfterMemberBlock) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.protocolDecl, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4579,7 +4314,7 @@ public struct ProtocolDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -4625,7 +4360,7 @@ public struct ProtocolDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift index a4b18723a4f..89586f5b616 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift @@ -50,32 +50,6 @@ public struct RegexLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeOpeningPounds?.raw, - openingPounds?.raw, - unexpectedBetweenOpeningPoundsAndOpeningSlash?.raw, - openingSlash.raw, - unexpectedBetweenOpeningSlashAndRegex?.raw, - regex.raw, - unexpectedBetweenRegexAndClosingSlash?.raw, - closingSlash.raw, - unexpectedBetweenClosingSlashAndClosingPounds?.raw, - closingPounds?.raw, - unexpectedAfterClosingPounds?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.regexLiteralExpr, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeOpeningPounds), Syntax(openingPounds), @@ -89,6 +63,19 @@ public struct RegexLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE Syntax(closingPounds), Syntax(unexpectedAfterClosingPounds) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.regexLiteralExpr, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -256,23 +243,23 @@ public struct RepeatStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyn trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeRepeatKeyword), + Syntax(repeatKeyword), + Syntax(unexpectedBetweenRepeatKeywordAndBody), + Syntax(body), + Syntax(unexpectedBetweenBodyAndWhileKeyword), + Syntax(whileKeyword), + Syntax(unexpectedBetweenWhileKeywordAndCondition), + Syntax(condition), + Syntax(unexpectedAfterCondition) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeRepeatKeyword?.raw, - repeatKeyword.raw, - unexpectedBetweenRepeatKeywordAndBody?.raw, - body.raw, - unexpectedBetweenBodyAndWhileKeyword?.raw, - whileKeyword.raw, - unexpectedBetweenWhileKeywordAndCondition?.raw, - condition.raw, - unexpectedAfterCondition?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.repeatStmt, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -280,17 +267,6 @@ public struct RepeatStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyn ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeRepeatKeyword), - Syntax(repeatKeyword), - Syntax(unexpectedBetweenRepeatKeywordAndBody), - Syntax(body), - Syntax(unexpectedBetweenBodyAndWhileKeyword), - Syntax(whileKeyword), - Syntax(unexpectedBetweenWhileKeywordAndCondition), - Syntax(condition), - Syntax(unexpectedAfterCondition) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -432,19 +408,19 @@ public struct ReturnClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeArrow), + Syntax(arrow), + Syntax(unexpectedBetweenArrowAndType), + Syntax(type), + Syntax(unexpectedAfterType) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeArrow?.raw, - arrow.raw, - unexpectedBetweenArrowAndType?.raw, - type.raw, - unexpectedAfterType?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.returnClause, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -452,13 +428,6 @@ public struct ReturnClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeArrow), - Syntax(arrow), - Syntax(unexpectedBetweenArrowAndType), - Syntax(type), - Syntax(unexpectedAfterType) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -551,19 +520,19 @@ public struct ReturnStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyn trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeReturnKeyword), + Syntax(returnKeyword), + Syntax(unexpectedBetweenReturnKeywordAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeReturnKeyword?.raw, - returnKeyword.raw, - unexpectedBetweenReturnKeywordAndExpression?.raw, - expression?.raw, - unexpectedAfterExpression?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.returnStmt, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -571,13 +540,6 @@ public struct ReturnStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyn ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeReturnKeyword), - Syntax(returnKeyword), - Syntax(unexpectedBetweenReturnKeywordAndExpression), - Syntax(expression), - Syntax(unexpectedAfterExpression) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -674,21 +636,21 @@ public struct SameTypeRequirementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftType), + Syntax(leftType), + Syntax(unexpectedBetweenLeftTypeAndEqual), + Syntax(equal), + Syntax(unexpectedBetweenEqualAndRightType), + Syntax(rightType), + Syntax(unexpectedAfterRightType) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeftType?.raw, - leftType.raw, - unexpectedBetweenLeftTypeAndEqual?.raw, - equal.raw, - unexpectedBetweenEqualAndRightType?.raw, - rightType.raw, - unexpectedAfterRightType?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.sameTypeRequirement, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -696,15 +658,6 @@ public struct SameTypeRequirementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLeftType), - Syntax(leftType), - Syntax(unexpectedBetweenLeftTypeAndEqual), - Syntax(equal), - Syntax(unexpectedBetweenEqualAndRightType), - Syntax(rightType), - Syntax(unexpectedAfterRightType) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -822,13 +775,13 @@ public struct SequenceExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprS trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforeElements), Syntax(elements), Syntax(unexpectedAfterElements)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforeElements?.raw, elements.raw, unexpectedAfterElements?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.sequenceExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -836,7 +789,6 @@ public struct SequenceExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprS ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforeElements), Syntax(elements), Syntax(unexpectedAfterElements)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -873,7 +825,7 @@ public struct SequenceExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprS collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.exprList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -939,21 +891,21 @@ public struct SimpleStringLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeOpeningQuote), + Syntax(openingQuote), + Syntax(unexpectedBetweenOpeningQuoteAndSegments), + Syntax(segments), + Syntax(unexpectedBetweenSegmentsAndClosingQuote), + Syntax(closingQuote), + Syntax(unexpectedAfterClosingQuote) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeOpeningQuote?.raw, - openingQuote.raw, - unexpectedBetweenOpeningQuoteAndSegments?.raw, - segments.raw, - unexpectedBetweenSegmentsAndClosingQuote?.raw, - closingQuote.raw, - unexpectedAfterClosingQuote?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.simpleStringLiteralExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -961,15 +913,6 @@ public struct SimpleStringLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeOpeningQuote), - Syntax(openingQuote), - Syntax(unexpectedBetweenOpeningQuoteAndSegments), - Syntax(segments), - Syntax(unexpectedBetweenSegmentsAndClosingQuote), - Syntax(closingQuote), - Syntax(unexpectedAfterClosingQuote) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1032,7 +975,7 @@ public struct SimpleStringLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.simpleStringLiteralSegmentList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -1122,13 +1065,13 @@ public struct SimpleTypeSpecifierSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforeSpecifier), Syntax(specifier), Syntax(unexpectedAfterSpecifier)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforeSpecifier?.raw, specifier.raw, unexpectedAfterSpecifier?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.simpleTypeSpecifier, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1136,7 +1079,6 @@ public struct SimpleTypeSpecifierSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforeSpecifier), Syntax(specifier), Syntax(unexpectedAfterSpecifier)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1212,19 +1154,19 @@ public struct SomeOrAnyTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafType trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeSomeOrAnySpecifier), + Syntax(someOrAnySpecifier), + Syntax(unexpectedBetweenSomeOrAnySpecifierAndConstraint), + Syntax(constraint), + Syntax(unexpectedAfterConstraint) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeSomeOrAnySpecifier?.raw, - someOrAnySpecifier.raw, - unexpectedBetweenSomeOrAnySpecifierAndConstraint?.raw, - constraint.raw, - unexpectedAfterConstraint?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.someOrAnyType, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1232,13 +1174,6 @@ public struct SomeOrAnyTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafType ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeSomeOrAnySpecifier), - Syntax(someOrAnySpecifier), - Syntax(unexpectedBetweenSomeOrAnySpecifierAndConstraint), - Syntax(constraint), - Syntax(unexpectedAfterConstraint) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1334,21 +1269,21 @@ public struct SourceFileSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodeP trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeShebang), + Syntax(shebang), + Syntax(unexpectedBetweenShebangAndStatements), + Syntax(statements), + Syntax(unexpectedBetweenStatementsAndEndOfFileToken), + Syntax(endOfFileToken), + Syntax(unexpectedAfterEndOfFileToken) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeShebang?.raw, - shebang?.raw, - unexpectedBetweenShebangAndStatements?.raw, - statements.raw, - unexpectedBetweenStatementsAndEndOfFileToken?.raw, - endOfFileToken.raw, - unexpectedAfterEndOfFileToken?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.sourceFile, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1356,15 +1291,6 @@ public struct SourceFileSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodeP ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeShebang), - Syntax(shebang), - Syntax(unexpectedBetweenShebangAndStatements), - Syntax(statements), - Syntax(unexpectedBetweenStatementsAndEndOfFileToken), - Syntax(endOfFileToken), - Syntax(unexpectedAfterEndOfFileToken) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1424,7 +1350,7 @@ public struct SourceFileSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodeP collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.codeBlockItemList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -1520,23 +1446,23 @@ public struct SpecializeAvailabilityArgumentSyntax: SyntaxProtocol, SyntaxHashab trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAvailabilityLabel), + Syntax(availabilityLabel), + Syntax(unexpectedBetweenAvailabilityLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndAvailabilityArguments), + Syntax(availabilityArguments), + Syntax(unexpectedBetweenAvailabilityArgumentsAndSemicolon), + Syntax(semicolon), + Syntax(unexpectedAfterSemicolon) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAvailabilityLabel?.raw, - availabilityLabel.raw, - unexpectedBetweenAvailabilityLabelAndColon?.raw, - colon.raw, - unexpectedBetweenColonAndAvailabilityArguments?.raw, - availabilityArguments.raw, - unexpectedBetweenAvailabilityArgumentsAndSemicolon?.raw, - semicolon.raw, - unexpectedAfterSemicolon?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.specializeAvailabilityArgument, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1544,17 +1470,6 @@ public struct SpecializeAvailabilityArgumentSyntax: SyntaxProtocol, SyntaxHashab ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeAvailabilityLabel), - Syntax(availabilityLabel), - Syntax(unexpectedBetweenAvailabilityLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndAvailabilityArguments), - Syntax(availabilityArguments), - Syntax(unexpectedBetweenAvailabilityArgumentsAndSemicolon), - Syntax(semicolon), - Syntax(unexpectedAfterSemicolon) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1637,7 +1552,7 @@ public struct SpecializeAvailabilityArgumentSyntax: SyntaxProtocol, SyntaxHashab collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.availabilityArgumentList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -1737,23 +1652,23 @@ public struct SpecializeTargetFunctionArgumentSyntax: SyntaxProtocol, SyntaxHash trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeTargetLabel), + Syntax(targetLabel), + Syntax(unexpectedBetweenTargetLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndDeclName), + Syntax(declName), + Syntax(unexpectedBetweenDeclNameAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeTargetLabel?.raw, - targetLabel.raw, - unexpectedBetweenTargetLabelAndColon?.raw, - colon.raw, - unexpectedBetweenColonAndDeclName?.raw, - declName.raw, - unexpectedBetweenDeclNameAndTrailingComma?.raw, - trailingComma?.raw, - unexpectedAfterTrailingComma?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.specializeTargetFunctionArgument, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1761,17 +1676,6 @@ public struct SpecializeTargetFunctionArgumentSyntax: SyntaxProtocol, SyntaxHash ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeTargetLabel), - Syntax(targetLabel), - Syntax(unexpectedBetweenTargetLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndDeclName), - Syntax(declName), - Syntax(unexpectedBetweenDeclNameAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1942,32 +1846,6 @@ public struct StringLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeOpeningPounds?.raw, - openingPounds?.raw, - unexpectedBetweenOpeningPoundsAndOpeningQuote?.raw, - openingQuote.raw, - unexpectedBetweenOpeningQuoteAndSegments?.raw, - segments.raw, - unexpectedBetweenSegmentsAndClosingQuote?.raw, - closingQuote.raw, - unexpectedBetweenClosingQuoteAndClosingPounds?.raw, - closingPounds?.raw, - unexpectedAfterClosingPounds?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.stringLiteralExpr, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeOpeningPounds), Syntax(openingPounds), @@ -1981,6 +1859,19 @@ public struct StringLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf Syntax(closingPounds), Syntax(unexpectedAfterClosingPounds) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.stringLiteralExpr, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2062,7 +1953,7 @@ public struct StringLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.stringLiteralSegmentList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -2178,13 +2069,13 @@ public struct StringSegmentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforeContent), Syntax(content), Syntax(unexpectedAfterContent)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforeContent?.raw, content.raw, unexpectedAfterContent?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.stringSegment, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -2192,7 +2083,6 @@ public struct StringSegmentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforeContent), Syntax(content), Syntax(unexpectedAfterContent)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2342,38 +2232,6 @@ public struct StructDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyn trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAttributes?.raw, - attributes.raw, - unexpectedBetweenAttributesAndModifiers?.raw, - modifiers.raw, - unexpectedBetweenModifiersAndStructKeyword?.raw, - structKeyword.raw, - unexpectedBetweenStructKeywordAndName?.raw, - name.raw, - unexpectedBetweenNameAndGenericParameterClause?.raw, - genericParameterClause?.raw, - unexpectedBetweenGenericParameterClauseAndInheritanceClause?.raw, - inheritanceClause?.raw, - unexpectedBetweenInheritanceClauseAndGenericWhereClause?.raw, - genericWhereClause?.raw, - unexpectedBetweenGenericWhereClauseAndMemberBlock?.raw, - memberBlock.raw, - unexpectedAfterMemberBlock?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.structDecl, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeAttributes), Syntax(attributes), @@ -2393,6 +2251,19 @@ public struct StructDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyn Syntax(memberBlock), Syntax(unexpectedAfterMemberBlock) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.structDecl, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2430,7 +2301,7 @@ public struct StructDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyn collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -2476,7 +2347,7 @@ public struct StructDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyn collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -2681,34 +2552,6 @@ public struct SubscriptCallExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeCalledExpression?.raw, - calledExpression.raw, - unexpectedBetweenCalledExpressionAndLeftSquare?.raw, - leftSquare.raw, - unexpectedBetweenLeftSquareAndArguments?.raw, - arguments.raw, - unexpectedBetweenArgumentsAndRightSquare?.raw, - rightSquare.raw, - unexpectedBetweenRightSquareAndTrailingClosure?.raw, - trailingClosure?.raw, - unexpectedBetweenTrailingClosureAndAdditionalTrailingClosures?.raw, - additionalTrailingClosures.raw, - unexpectedAfterAdditionalTrailingClosures?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.subscriptCallExpr, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeCalledExpression), Syntax(calledExpression), @@ -2724,6 +2567,19 @@ public struct SubscriptCallExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf Syntax(additionalTrailingClosures), Syntax(unexpectedAfterAdditionalTrailingClosures) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.subscriptCallExpr, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2799,7 +2655,7 @@ public struct SubscriptCallExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.labeledExprList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -2883,7 +2739,7 @@ public struct SubscriptCallExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.multipleTrailingClosureElementList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -2970,38 +2826,6 @@ public struct SubscriptDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAttributes?.raw, - attributes.raw, - unexpectedBetweenAttributesAndModifiers?.raw, - modifiers.raw, - unexpectedBetweenModifiersAndSubscriptKeyword?.raw, - subscriptKeyword.raw, - unexpectedBetweenSubscriptKeywordAndGenericParameterClause?.raw, - genericParameterClause?.raw, - unexpectedBetweenGenericParameterClauseAndParameterClause?.raw, - parameterClause.raw, - unexpectedBetweenParameterClauseAndReturnClause?.raw, - returnClause.raw, - unexpectedBetweenReturnClauseAndGenericWhereClause?.raw, - genericWhereClause?.raw, - unexpectedBetweenGenericWhereClauseAndAccessorBlock?.raw, - accessorBlock?.raw, - unexpectedAfterAccessorBlock?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.subscriptDecl, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeAttributes), Syntax(attributes), @@ -3021,6 +2845,19 @@ public struct SubscriptDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl Syntax(accessorBlock), Syntax(unexpectedAfterAccessorBlock) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.subscriptDecl, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3057,7 +2894,7 @@ public struct SubscriptDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -3102,7 +2939,7 @@ public struct SubscriptDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -3283,13 +3120,13 @@ public struct SuperExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforeSuperKeyword), Syntax(superKeyword), Syntax(unexpectedAfterSuperKeyword)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforeSuperKeyword?.raw, superKeyword.raw, unexpectedAfterSuperKeyword?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.superExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3297,7 +3134,6 @@ public struct SuperExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforeSuperKeyword), Syntax(superKeyword), Syntax(unexpectedAfterSuperKeyword)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3363,19 +3199,19 @@ public struct SuppressedTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeWithoutTilde), + Syntax(withoutTilde), + Syntax(unexpectedBetweenWithoutTildeAndType), + Syntax(type), + Syntax(unexpectedAfterType) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeWithoutTilde?.raw, - withoutTilde.raw, - unexpectedBetweenWithoutTildeAndType?.raw, - type.raw, - unexpectedAfterType?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.suppressedType, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3383,13 +3219,6 @@ public struct SuppressedTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeWithoutTilde), - Syntax(withoutTilde), - Syntax(unexpectedBetweenWithoutTildeAndType), - Syntax(type), - Syntax(unexpectedAfterType) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3486,21 +3315,21 @@ public struct SwitchCaseItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforePattern), + Syntax(pattern), + Syntax(unexpectedBetweenPatternAndWhereClause), + Syntax(whereClause), + Syntax(unexpectedBetweenWhereClauseAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforePattern?.raw, - pattern.raw, - unexpectedBetweenPatternAndWhereClause?.raw, - whereClause?.raw, - unexpectedBetweenWhereClauseAndTrailingComma?.raw, - trailingComma?.raw, - unexpectedAfterTrailingComma?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.switchCaseItem, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3508,15 +3337,6 @@ public struct SwitchCaseItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforePattern), - Syntax(pattern), - Syntax(unexpectedBetweenPatternAndWhereClause), - Syntax(whereClause), - Syntax(unexpectedBetweenWhereClauseAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3633,21 +3453,21 @@ public struct SwitchCaseLabelSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeCaseKeyword), + Syntax(caseKeyword), + Syntax(unexpectedBetweenCaseKeywordAndCaseItems), + Syntax(caseItems), + Syntax(unexpectedBetweenCaseItemsAndColon), + Syntax(colon), + Syntax(unexpectedAfterColon) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeCaseKeyword?.raw, - caseKeyword.raw, - unexpectedBetweenCaseKeywordAndCaseItems?.raw, - caseItems.raw, - unexpectedBetweenCaseItemsAndColon?.raw, - colon.raw, - unexpectedAfterColon?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.switchCaseLabel, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3655,15 +3475,6 @@ public struct SwitchCaseLabelSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeCaseKeyword), - Syntax(caseKeyword), - Syntax(unexpectedBetweenCaseKeywordAndCaseItems), - Syntax(caseItems), - Syntax(unexpectedBetweenCaseItemsAndColon), - Syntax(colon), - Syntax(unexpectedAfterColon) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3721,7 +3532,7 @@ public struct SwitchCaseLabelSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.switchCaseItemList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -3893,21 +3704,21 @@ public struct SwitchCaseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodeP trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttribute), + Syntax(attribute), + Syntax(unexpectedBetweenAttributeAndLabel), + Syntax(label), + Syntax(unexpectedBetweenLabelAndStatements), + Syntax(statements), + Syntax(unexpectedAfterStatements) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAttribute?.raw, - attribute?.raw, - unexpectedBetweenAttributeAndLabel?.raw, - label.raw, - unexpectedBetweenLabelAndStatements?.raw, - statements.raw, - unexpectedAfterStatements?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.switchCase, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3915,15 +3726,6 @@ public struct SwitchCaseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodeP ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeAttribute), - Syntax(attribute), - Syntax(unexpectedBetweenAttributeAndLabel), - Syntax(label), - Syntax(unexpectedBetweenLabelAndStatements), - Syntax(statements), - Syntax(unexpectedAfterStatements) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3997,7 +3799,7 @@ public struct SwitchCaseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodeP collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.codeBlockItemList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -4062,19 +3864,19 @@ public struct SwitchDefaultLabelSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeDefaultKeyword), + Syntax(defaultKeyword), + Syntax(unexpectedBetweenDefaultKeywordAndColon), + Syntax(colon), + Syntax(unexpectedAfterColon) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeDefaultKeyword?.raw, - defaultKeyword.raw, - unexpectedBetweenDefaultKeywordAndColon?.raw, - colon.raw, - unexpectedAfterColon?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.switchDefaultLabel, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4082,13 +3884,6 @@ public struct SwitchDefaultLabelSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeDefaultKeyword), - Syntax(defaultKeyword), - Syntax(unexpectedBetweenDefaultKeywordAndColon), - Syntax(colon), - Syntax(unexpectedAfterColon) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4208,32 +4003,6 @@ public struct SwitchExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyn trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeSwitchKeyword?.raw, - switchKeyword.raw, - unexpectedBetweenSwitchKeywordAndSubject?.raw, - subject.raw, - unexpectedBetweenSubjectAndLeftBrace?.raw, - leftBrace.raw, - unexpectedBetweenLeftBraceAndCases?.raw, - cases.raw, - unexpectedBetweenCasesAndRightBrace?.raw, - rightBrace.raw, - unexpectedAfterRightBrace?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.switchExpr, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeSwitchKeyword), Syntax(switchKeyword), @@ -4247,6 +4016,19 @@ public struct SwitchExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyn Syntax(rightBrace), Syntax(unexpectedAfterRightBrace) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.switchExpr, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4349,7 +4131,7 @@ public struct SwitchExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyn collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.switchCaseList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesTUVWXYZ.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesTUVWXYZ.swift index 2cd621d113b..fc917ca7515 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesTUVWXYZ.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesTUVWXYZ.swift @@ -61,32 +61,6 @@ public struct TernaryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeCondition?.raw, - condition.raw, - unexpectedBetweenConditionAndQuestionMark?.raw, - questionMark.raw, - unexpectedBetweenQuestionMarkAndThenExpression?.raw, - thenExpression.raw, - unexpectedBetweenThenExpressionAndColon?.raw, - colon.raw, - unexpectedBetweenColonAndElseExpression?.raw, - elseExpression.raw, - unexpectedAfterElseExpression?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.ternaryExpr, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeCondition), Syntax(condition), @@ -100,6 +74,19 @@ public struct TernaryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy Syntax(elseExpression), Syntax(unexpectedAfterElseExpression) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.ternaryExpr, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -265,19 +252,19 @@ public struct ThenStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynta trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeThenKeyword), + Syntax(thenKeyword), + Syntax(unexpectedBetweenThenKeywordAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeThenKeyword?.raw, - thenKeyword.raw, - unexpectedBetweenThenKeywordAndExpression?.raw, - expression.raw, - unexpectedAfterExpression?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.thenStmt, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -285,13 +272,6 @@ public struct ThenStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynta ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeThenKeyword), - Syntax(thenKeyword), - Syntax(unexpectedBetweenThenKeywordAndExpression), - Syntax(expression), - Syntax(unexpectedAfterExpression) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -381,19 +361,19 @@ public struct ThrowStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeThrowKeyword), + Syntax(throwKeyword), + Syntax(unexpectedBetweenThrowKeywordAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeThrowKeyword?.raw, - throwKeyword.raw, - unexpectedBetweenThrowKeywordAndExpression?.raw, - expression.raw, - unexpectedAfterExpression?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.throwStmt, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -401,13 +381,6 @@ public struct ThrowStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeThrowKeyword), - Syntax(throwKeyword), - Syntax(unexpectedBetweenThrowKeywordAndExpression), - Syntax(expression), - Syntax(unexpectedAfterExpression) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -514,23 +487,23 @@ public struct ThrowsClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeThrowsSpecifier), + Syntax(throwsSpecifier), + Syntax(unexpectedBetweenThrowsSpecifierAndLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndType), + Syntax(type), + Syntax(unexpectedBetweenTypeAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeThrowsSpecifier?.raw, - throwsSpecifier.raw, - unexpectedBetweenThrowsSpecifierAndLeftParen?.raw, - leftParen?.raw, - unexpectedBetweenLeftParenAndType?.raw, - type?.raw, - unexpectedBetweenTypeAndRightParen?.raw, - rightParen?.raw, - unexpectedAfterRightParen?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.throwsClause, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -538,17 +511,6 @@ public struct ThrowsClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeThrowsSpecifier), - Syntax(throwsSpecifier), - Syntax(unexpectedBetweenThrowsSpecifierAndLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndType), - Syntax(type), - Syntax(unexpectedBetweenTypeAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -712,21 +674,21 @@ public struct TryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntax trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeTryKeyword), + Syntax(tryKeyword), + Syntax(unexpectedBetweenTryKeywordAndQuestionOrExclamationMark), + Syntax(questionOrExclamationMark), + Syntax(unexpectedBetweenQuestionOrExclamationMarkAndExpression), + Syntax(expression), + Syntax(unexpectedAfterExpression) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeTryKeyword?.raw, - tryKeyword.raw, - unexpectedBetweenTryKeywordAndQuestionOrExclamationMark?.raw, - questionOrExclamationMark?.raw, - unexpectedBetweenQuestionOrExclamationMarkAndExpression?.raw, - expression.raw, - unexpectedAfterExpression?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.tryExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -734,15 +696,6 @@ public struct TryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntax ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeTryKeyword), - Syntax(tryKeyword), - Syntax(unexpectedBetweenTryKeywordAndQuestionOrExclamationMark), - Syntax(questionOrExclamationMark), - Syntax(unexpectedBetweenQuestionOrExclamationMarkAndExpression), - Syntax(expression), - Syntax(unexpectedAfterExpression) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -860,21 +813,21 @@ public struct TupleExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndElements), + Syntax(elements), + Syntax(unexpectedBetweenElementsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeftParen?.raw, - leftParen.raw, - unexpectedBetweenLeftParenAndElements?.raw, - elements.raw, - unexpectedBetweenElementsAndRightParen?.raw, - rightParen.raw, - unexpectedAfterRightParen?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.tupleExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -882,15 +835,6 @@ public struct TupleExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndElements), - Syntax(elements), - Syntax(unexpectedBetweenElementsAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -948,7 +892,7 @@ public struct TupleExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.labeledExprList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -1046,23 +990,23 @@ public struct TuplePatternElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLabel), + Syntax(label), + Syntax(unexpectedBetweenLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndPattern), + Syntax(pattern), + Syntax(unexpectedBetweenPatternAndTrailingComma), + Syntax(trailingComma), + Syntax(unexpectedAfterTrailingComma) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLabel?.raw, - label?.raw, - unexpectedBetweenLabelAndColon?.raw, - colon?.raw, - unexpectedBetweenColonAndPattern?.raw, - pattern.raw, - unexpectedBetweenPatternAndTrailingComma?.raw, - trailingComma?.raw, - unexpectedAfterTrailingComma?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.tuplePatternElement, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1070,17 +1014,6 @@ public struct TuplePatternElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLabel), - Syntax(label), - Syntax(unexpectedBetweenLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndPattern), - Syntax(pattern), - Syntax(unexpectedBetweenPatternAndTrailingComma), - Syntax(trailingComma), - Syntax(unexpectedAfterTrailingComma) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1239,21 +1172,21 @@ public struct TuplePatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _LeafPa trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndElements), + Syntax(elements), + Syntax(unexpectedBetweenElementsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeftParen?.raw, - leftParen.raw, - unexpectedBetweenLeftParenAndElements?.raw, - elements.raw, - unexpectedBetweenElementsAndRightParen?.raw, - rightParen.raw, - unexpectedAfterRightParen?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.tuplePattern, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1261,15 +1194,6 @@ public struct TuplePatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _LeafPa ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndElements), - Syntax(elements), - Syntax(unexpectedBetweenElementsAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1329,7 +1253,7 @@ public struct TuplePatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _LeafPa collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.tuplePatternElementList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -1432,36 +1356,6 @@ public struct TupleTypeElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeInoutKeyword?.raw, - inoutKeyword?.raw, - unexpectedBetweenInoutKeywordAndFirstName?.raw, - firstName?.raw, - unexpectedBetweenFirstNameAndSecondName?.raw, - secondName?.raw, - unexpectedBetweenSecondNameAndColon?.raw, - colon?.raw, - unexpectedBetweenColonAndType?.raw, - type.raw, - unexpectedBetweenTypeAndEllipsis?.raw, - ellipsis?.raw, - unexpectedBetweenEllipsisAndTrailingComma?.raw, - trailingComma?.raw, - unexpectedAfterTrailingComma?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.tupleTypeElement, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeInoutKeyword), Syntax(inoutKeyword), @@ -1479,6 +1373,19 @@ public struct TupleTypeElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta Syntax(trailingComma), Syntax(unexpectedAfterTrailingComma) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.tupleTypeElement, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1690,21 +1597,21 @@ public struct TupleTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSynt trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndElements), + Syntax(elements), + Syntax(unexpectedBetweenElementsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeftParen?.raw, - leftParen.raw, - unexpectedBetweenLeftParenAndElements?.raw, - elements.raw, - unexpectedBetweenElementsAndRightParen?.raw, - rightParen.raw, - unexpectedAfterRightParen?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.tupleType, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -1712,15 +1619,6 @@ public struct TupleTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndElements), - Syntax(elements), - Syntax(unexpectedBetweenElementsAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1778,7 +1676,7 @@ public struct TupleTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSynt collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.tupleTypeElementList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -1877,36 +1775,6 @@ public struct TypeAliasDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl trailingTrivia: Trivia? = nil ) { - // Extend the lifetime of all parameters so their arenas don't get destroyed - // before they can be added as children of the new arena. - self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAttributes?.raw, - attributes.raw, - unexpectedBetweenAttributesAndModifiers?.raw, - modifiers.raw, - unexpectedBetweenModifiersAndTypealiasKeyword?.raw, - typealiasKeyword.raw, - unexpectedBetweenTypealiasKeywordAndName?.raw, - name.raw, - unexpectedBetweenNameAndGenericParameterClause?.raw, - genericParameterClause?.raw, - unexpectedBetweenGenericParameterClauseAndInitializer?.raw, - initializer.raw, - unexpectedBetweenInitializerAndGenericWhereClause?.raw, - genericWhereClause?.raw, - unexpectedAfterGenericWhereClause?.raw - ] - let raw = RawSyntax.makeLayout( - kind: SyntaxKind.typeAliasDecl, - from: layout, - arena: arena, - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia - - ) - return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) - } let nodes: [Syntax?] = [ Syntax(unexpectedBeforeAttributes), Syntax(attributes), @@ -1924,6 +1792,19 @@ public struct TypeAliasDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl Syntax(genericWhereClause), Syntax(unexpectedAfterGenericWhereClause) ] + // Extend the lifetime of all parameters so their arenas don't get destroyed + // before they can be added as children of the new arena. + self = withExtendedLifetime(SyntaxArena()) { (arena) in + let raw = RawSyntax.makeLayout( + kind: SyntaxKind.typeAliasDecl, + from: nodes, + arena: arena, + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia + + ) + return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) + } Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -1960,7 +1841,7 @@ public struct TypeAliasDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -2005,7 +1886,7 @@ public struct TypeAliasDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -2180,19 +2061,19 @@ public struct TypeAnnotationSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndType), + Syntax(type), + Syntax(unexpectedAfterType) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeColon?.raw, - colon.raw, - unexpectedBetweenColonAndType?.raw, - type.raw, - unexpectedAfterType?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.typeAnnotation, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -2200,13 +2081,6 @@ public struct TypeAnnotationSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndType), - Syntax(type), - Syntax(unexpectedAfterType) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2305,19 +2179,19 @@ public struct TypeEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashable, _LeafS trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAsyncSpecifier), + Syntax(asyncSpecifier), + Syntax(unexpectedBetweenAsyncSpecifierAndThrowsClause), + Syntax(throwsClause), + Syntax(unexpectedAfterThrowsClause) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAsyncSpecifier?.raw, - asyncSpecifier?.raw, - unexpectedBetweenAsyncSpecifierAndThrowsClause?.raw, - throwsClause?.raw, - unexpectedAfterThrowsClause?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.typeEffectSpecifiers, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -2325,13 +2199,6 @@ public struct TypeEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashable, _LeafS ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeAsyncSpecifier), - Syntax(asyncSpecifier), - Syntax(unexpectedBetweenAsyncSpecifierAndThrowsClause), - Syntax(throwsClause), - Syntax(unexpectedAfterThrowsClause) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2419,13 +2286,13 @@ public struct TypeExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynta trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforeType), Syntax(type), Syntax(unexpectedAfterType)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforeType?.raw, type.raw, unexpectedAfterType?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.typeExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -2433,7 +2300,6 @@ public struct TypeExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynta ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforeType), Syntax(type), Syntax(unexpectedAfterType)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2501,19 +2367,19 @@ public struct TypeInitializerClauseSyntax: SyntaxProtocol, SyntaxHashable, _Leaf trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeEqual), + Syntax(equal), + Syntax(unexpectedBetweenEqualAndValue), + Syntax(value), + Syntax(unexpectedAfterValue) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeEqual?.raw, - equal.raw, - unexpectedBetweenEqualAndValue?.raw, - value.raw, - unexpectedAfterValue?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.typeInitializerClause, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -2521,13 +2387,6 @@ public struct TypeInitializerClauseSyntax: SyntaxProtocol, SyntaxHashable, _Leaf ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeEqual), - Syntax(equal), - Syntax(unexpectedBetweenEqualAndValue), - Syntax(value), - Syntax(unexpectedAfterValue) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2626,21 +2485,21 @@ public struct UnavailableFromAsyncAttributeArgumentsSyntax: SyntaxProtocol, Synt trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeMessageLabel), + Syntax(messageLabel), + Syntax(unexpectedBetweenMessageLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndMessage), + Syntax(message), + Syntax(unexpectedAfterMessage) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeMessageLabel?.raw, - messageLabel.raw, - unexpectedBetweenMessageLabelAndColon?.raw, - colon.raw, - unexpectedBetweenColonAndMessage?.raw, - message.raw, - unexpectedAfterMessage?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.unavailableFromAsyncAttributeArguments, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -2648,15 +2507,6 @@ public struct UnavailableFromAsyncAttributeArgumentsSyntax: SyntaxProtocol, Synt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeMessageLabel), - Syntax(messageLabel), - Syntax(unexpectedBetweenMessageLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndMessage), - Syntax(message), - Syntax(unexpectedAfterMessage) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2778,21 +2628,21 @@ public struct UnderscorePrivateAttributeArgumentsSyntax: SyntaxProtocol, SyntaxH trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeSourceFileLabel), + Syntax(sourceFileLabel), + Syntax(unexpectedBetweenSourceFileLabelAndColon), + Syntax(colon), + Syntax(unexpectedBetweenColonAndFilename), + Syntax(filename), + Syntax(unexpectedAfterFilename) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeSourceFileLabel?.raw, - sourceFileLabel.raw, - unexpectedBetweenSourceFileLabelAndColon?.raw, - colon.raw, - unexpectedBetweenColonAndFilename?.raw, - filename.raw, - unexpectedAfterFilename?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.underscorePrivateAttributeArguments, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -2800,15 +2650,6 @@ public struct UnderscorePrivateAttributeArgumentsSyntax: SyntaxProtocol, SyntaxH ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeSourceFileLabel), - Syntax(sourceFileLabel), - Syntax(unexpectedBetweenSourceFileLabelAndColon), - Syntax(colon), - Syntax(unexpectedBetweenColonAndFilename), - Syntax(filename), - Syntax(unexpectedAfterFilename) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -2926,19 +2767,19 @@ public struct UnresolvedAsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAsKeyword), + Syntax(asKeyword), + Syntax(unexpectedBetweenAsKeywordAndQuestionOrExclamationMark), + Syntax(questionOrExclamationMark), + Syntax(unexpectedAfterQuestionOrExclamationMark) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAsKeyword?.raw, - asKeyword.raw, - unexpectedBetweenAsKeywordAndQuestionOrExclamationMark?.raw, - questionOrExclamationMark?.raw, - unexpectedAfterQuestionOrExclamationMark?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.unresolvedAsExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -2946,13 +2787,6 @@ public struct UnresolvedAsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeAsKeyword), - Syntax(asKeyword), - Syntax(unexpectedBetweenAsKeywordAndQuestionOrExclamationMark), - Syntax(questionOrExclamationMark), - Syntax(unexpectedAfterQuestionOrExclamationMark) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3049,13 +2883,13 @@ public struct UnresolvedIsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforeIsKeyword), Syntax(isKeyword), Syntax(unexpectedAfterIsKeyword)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforeIsKeyword?.raw, isKeyword.raw, unexpectedAfterIsKeyword?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.unresolvedIsExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3063,7 +2897,6 @@ public struct UnresolvedIsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforeIsKeyword), Syntax(isKeyword), Syntax(unexpectedAfterIsKeyword)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3138,21 +2971,21 @@ public struct UnresolvedTernaryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _ trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeQuestionMark), + Syntax(questionMark), + Syntax(unexpectedBetweenQuestionMarkAndThenExpression), + Syntax(thenExpression), + Syntax(unexpectedBetweenThenExpressionAndColon), + Syntax(colon), + Syntax(unexpectedAfterColon) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeQuestionMark?.raw, - questionMark.raw, - unexpectedBetweenQuestionMarkAndThenExpression?.raw, - thenExpression.raw, - unexpectedBetweenThenExpressionAndColon?.raw, - colon.raw, - unexpectedAfterColon?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.unresolvedTernaryExpr, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3160,15 +2993,6 @@ public struct UnresolvedTernaryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _ ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeQuestionMark), - Syntax(questionMark), - Syntax(unexpectedBetweenQuestionMarkAndThenExpression), - Syntax(thenExpression), - Syntax(unexpectedBetweenThenExpressionAndColon), - Syntax(colon), - Syntax(unexpectedAfterColon) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3281,19 +3105,19 @@ public struct ValueBindingPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeBindingSpecifier), + Syntax(bindingSpecifier), + Syntax(unexpectedBetweenBindingSpecifierAndPattern), + Syntax(pattern), + Syntax(unexpectedAfterPattern) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeBindingSpecifier?.raw, - bindingSpecifier.raw, - unexpectedBetweenBindingSpecifierAndPattern?.raw, - pattern.raw, - unexpectedAfterPattern?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.valueBindingPattern, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3301,13 +3125,6 @@ public struct ValueBindingPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeBindingSpecifier), - Syntax(bindingSpecifier), - Syntax(unexpectedBetweenBindingSpecifierAndPattern), - Syntax(pattern), - Syntax(unexpectedAfterPattern) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3418,23 +3235,23 @@ public struct VariableDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeAttributes), + Syntax(attributes), + Syntax(unexpectedBetweenAttributesAndModifiers), + Syntax(modifiers), + Syntax(unexpectedBetweenModifiersAndBindingSpecifier), + Syntax(bindingSpecifier), + Syntax(unexpectedBetweenBindingSpecifierAndBindings), + Syntax(bindings), + Syntax(unexpectedAfterBindings) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeAttributes?.raw, - attributes.raw, - unexpectedBetweenAttributesAndModifiers?.raw, - modifiers.raw, - unexpectedBetweenModifiersAndBindingSpecifier?.raw, - bindingSpecifier.raw, - unexpectedBetweenBindingSpecifierAndBindings?.raw, - bindings.raw, - unexpectedAfterBindings?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.variableDecl, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3442,17 +3259,6 @@ public struct VariableDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeAttributes), - Syntax(attributes), - Syntax(unexpectedBetweenAttributesAndModifiers), - Syntax(modifiers), - Syntax(unexpectedBetweenModifiersAndBindingSpecifier), - Syntax(bindingSpecifier), - Syntax(unexpectedBetweenBindingSpecifierAndBindings), - Syntax(bindings), - Syntax(unexpectedAfterBindings) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3489,7 +3295,7 @@ public struct VariableDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -3535,7 +3341,7 @@ public struct VariableDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -3620,7 +3426,7 @@ public struct VariableDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.patternBindingList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -3691,19 +3497,19 @@ public struct VersionComponentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforePeriod), + Syntax(period), + Syntax(unexpectedBetweenPeriodAndNumber), + Syntax(number), + Syntax(unexpectedAfterNumber) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforePeriod?.raw, - period.raw, - unexpectedBetweenPeriodAndNumber?.raw, - number.raw, - unexpectedAfterNumber?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.versionComponent, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3711,13 +3517,6 @@ public struct VersionComponentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforePeriod), - Syntax(period), - Syntax(unexpectedBetweenPeriodAndNumber), - Syntax(number), - Syntax(unexpectedAfterNumber) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3824,19 +3623,19 @@ public struct VersionTupleSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeMajor), + Syntax(major), + Syntax(unexpectedBetweenMajorAndComponents), + Syntax(components), + Syntax(unexpectedAfterComponents) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeMajor?.raw, - major.raw, - unexpectedBetweenMajorAndComponents?.raw, - components.raw, - unexpectedAfterComponents?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.versionTuple, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3844,13 +3643,6 @@ public struct VersionTupleSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeMajor), - Syntax(major), - Syntax(unexpectedBetweenMajorAndComponents), - Syntax(components), - Syntax(unexpectedAfterComponents) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -3911,7 +3703,7 @@ public struct VersionTupleSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.versionComponentList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -3976,19 +3768,19 @@ public struct WhereClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeWhereKeyword), + Syntax(whereKeyword), + Syntax(unexpectedBetweenWhereKeywordAndCondition), + Syntax(condition), + Syntax(unexpectedAfterCondition) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeWhereKeyword?.raw, - whereKeyword.raw, - unexpectedBetweenWhereKeywordAndCondition?.raw, - condition.raw, - unexpectedAfterCondition?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.whereClause, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -3996,13 +3788,6 @@ public struct WhereClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeWhereKeyword), - Syntax(whereKeyword), - Syntax(unexpectedBetweenWhereKeywordAndCondition), - Syntax(condition), - Syntax(unexpectedAfterCondition) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4095,21 +3880,21 @@ public struct WhileStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeWhileKeyword), + Syntax(whileKeyword), + Syntax(unexpectedBetweenWhileKeywordAndConditions), + Syntax(conditions), + Syntax(unexpectedBetweenConditionsAndBody), + Syntax(body), + Syntax(unexpectedAfterBody) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeWhileKeyword?.raw, - whileKeyword.raw, - unexpectedBetweenWhileKeywordAndConditions?.raw, - conditions.raw, - unexpectedBetweenConditionsAndBody?.raw, - body.raw, - unexpectedAfterBody?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.whileStmt, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4117,15 +3902,6 @@ public struct WhileStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeWhileKeyword), - Syntax(whileKeyword), - Syntax(unexpectedBetweenWhileKeywordAndConditions), - Syntax(conditions), - Syntax(unexpectedBetweenConditionsAndBody), - Syntax(body), - Syntax(unexpectedAfterBody) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4183,7 +3959,7 @@ public struct WhileStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.conditionElementList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( @@ -4272,13 +4048,13 @@ public struct WildcardPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _Lea trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [Syntax(unexpectedBeforeWildcard), Syntax(wildcard), Syntax(unexpectedAfterWildcard)] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [unexpectedBeforeWildcard?.raw, wildcard.raw, unexpectedAfterWildcard?.raw] let raw = RawSyntax.makeLayout( kind: SyntaxKind.wildcardPattern, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4286,7 +4062,6 @@ public struct WildcardPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _Lea ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [Syntax(unexpectedBeforeWildcard), Syntax(wildcard), Syntax(unexpectedAfterWildcard)] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4434,19 +4209,19 @@ public struct YieldStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeYieldKeyword), + Syntax(yieldKeyword), + Syntax(unexpectedBetweenYieldKeywordAndYieldedExpressions), + Syntax(yieldedExpressions), + Syntax(unexpectedAfterYieldedExpressions) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeYieldKeyword?.raw, - yieldKeyword.raw, - unexpectedBetweenYieldKeywordAndYieldedExpressions?.raw, - yieldedExpressions.raw, - unexpectedAfterYieldedExpressions?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.yieldStmt, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4454,13 +4229,6 @@ public struct YieldStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeYieldKeyword), - Syntax(yieldKeyword), - Syntax(unexpectedBetweenYieldKeywordAndYieldedExpressions), - Syntax(yieldedExpressions), - Syntax(unexpectedAfterYieldedExpressions) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4554,19 +4322,19 @@ public struct YieldedExpressionSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeExpression), + Syntax(expression), + Syntax(unexpectedBetweenExpressionAndComma), + Syntax(comma), + Syntax(unexpectedAfterComma) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeExpression?.raw, - expression.raw, - unexpectedBetweenExpressionAndComma?.raw, - comma?.raw, - unexpectedAfterComma?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.yieldedExpression, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4574,13 +4342,6 @@ public struct YieldedExpressionSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeExpression), - Syntax(expression), - Syntax(unexpectedBetweenExpressionAndComma), - Syntax(comma), - Syntax(unexpectedAfterComma) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4677,21 +4438,21 @@ public struct YieldedExpressionsClauseSyntax: SyntaxProtocol, SyntaxHashable, _L trailingTrivia: Trivia? = nil ) { + let nodes: [Syntax?] = [ + Syntax(unexpectedBeforeLeftParen), + Syntax(leftParen), + Syntax(unexpectedBetweenLeftParenAndElements), + Syntax(elements), + Syntax(unexpectedBetweenElementsAndRightParen), + Syntax(rightParen), + Syntax(unexpectedAfterRightParen) + ] // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. self = withExtendedLifetime(SyntaxArena()) { (arena) in - let layout: [RawSyntax?] = [ - unexpectedBeforeLeftParen?.raw, - leftParen.raw, - unexpectedBetweenLeftParenAndElements?.raw, - elements.raw, - unexpectedBetweenElementsAndRightParen?.raw, - rightParen.raw, - unexpectedAfterRightParen?.raw - ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.yieldedExpressionsClause, - from: layout, + from: nodes, arena: arena, leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia @@ -4699,15 +4460,6 @@ public struct YieldedExpressionsClauseSyntax: SyntaxProtocol, SyntaxHashable, _L ) return Syntax.forRoot(raw, rawNodeArena: arena).cast(Self.self) } - let nodes: [Syntax?] = [ - Syntax(unexpectedBeforeLeftParen), - Syntax(leftParen), - Syntax(unexpectedBetweenLeftParenAndElements), - Syntax(elements), - Syntax(unexpectedBetweenElementsAndRightParen), - Syntax(rightParen), - Syntax(unexpectedAfterRightParen) - ] Syntax(self).setSyntaxTrackingOfTree(SyntaxTracking(tracking: nodes)) } @@ -4765,7 +4517,7 @@ public struct YieldedExpressionsClauseSyntax: SyntaxProtocol, SyntaxHashable, _L collection = col.layoutView!.appending(element.raw, arena: arena) } else { collection = RawSyntax.makeLayout(kind: SyntaxKind.yieldedExpressionList, - from: [element.raw], arena: arena) + from: [Syntax(element)], arena: arena) } return Syntax(self) .replacingChild( From 4d285984fda623c72bdfe82f505a9bcd33ff6093 Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Thu, 1 Aug 2024 14:37:39 -0700 Subject: [PATCH 8/9] Check that we are actually tracking the tree passed in as `originalTree` to `originalNode` --- Sources/SwiftSyntax/SyntaxTracking.swift | 3 ++ .../SwiftSyntaxTest/SyntaxTrackingTests.swift | 41 +++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/Sources/SwiftSyntax/SyntaxTracking.swift b/Sources/SwiftSyntax/SyntaxTracking.swift index 38d794d1575..1d6c54d63c7 100644 --- a/Sources/SwiftSyntax/SyntaxTracking.swift +++ b/Sources/SwiftSyntax/SyntaxTracking.swift @@ -300,6 +300,9 @@ extension SyntaxProtocol { /// - SeeAlso: ``SyntaxProtocol/tracked`` /// - Complexity: O(tracked ranges in this tree) + O(width * depth of original tree) public func originalNode(in originalTree: some SyntaxProtocol) -> Self? { + guard Syntax(self).syntaxTracking?.trackedTree == originalTree.id.rootId else { + return nil + } guard let originalIndexInTree = Syntax(self).syntaxTracking?.originalIndexInTree(of: self.id.indexInTree) else { return nil } diff --git a/Tests/SwiftSyntaxTest/SyntaxTrackingTests.swift b/Tests/SwiftSyntaxTest/SyntaxTrackingTests.swift index 9bfc153d58b..135edaef342 100644 --- a/Tests/SwiftSyntaxTest/SyntaxTrackingTests.swift +++ b/Tests/SwiftSyntaxTest/SyntaxTrackingTests.swift @@ -117,4 +117,45 @@ public class SyntaxTrackingTests: XCTestCase { XCTAssertEqual(codeBlockItemList.last?.item.originalNode(in: originalFunction)?.id, originalFunction.id) } + + func testTwoLayerModification() throws { + let originalFunction = try FunctionDeclSyntax("func foo() {}").tracked + let modifiedFunction = originalFunction.with(\.name, "bar") + let secondModification = modifiedFunction.with(\.body, nil) + + XCTAssertEqual( + secondModification.funcKeyword.originalNode(in: originalFunction)?.id, + originalFunction.funcKeyword.id + ) + XCTAssertNil(secondModification.name.originalNode(in: originalFunction)) + XCTAssertNil(secondModification.name.originalNode(in: modifiedFunction)) + } + + func testEditAndThenCreation() throws { + let originalFunction = try FunctionDeclSyntax("func foo() {}").tracked + let modifiedFunction = originalFunction.with(\.name, "bar") + + let codeBlockItem = CodeBlockItemSyntax(item: .decl(DeclSyntax(modifiedFunction))) + + XCTAssertEqual( + codeBlockItem.item.as(FunctionDeclSyntax.self)?.funcKeyword.originalNode(in: originalFunction)?.id, + originalFunction.funcKeyword.id + ) + XCTAssertNil(codeBlockItem.item.as(FunctionDeclSyntax.self)?.name.originalNode(in: originalFunction)?.id) + XCTAssertNil(codeBlockItem.item.as(FunctionDeclSyntax.self)?.name.originalNode(in: modifiedFunction)?.id) + } + + func testStartTrackingModifiedNode() throws { + let originalFunction = try FunctionDeclSyntax("func foo() {}").tracked + let modifiedFunction = originalFunction.with(\.name, "bar").tracked + let secondModification = modifiedFunction.with(\.body, nil) + + XCTAssertNil(secondModification.funcKeyword.originalNode(in: originalFunction)) + XCTAssertEqual( + secondModification.funcKeyword.originalNode(in: modifiedFunction)?.id, + modifiedFunction.funcKeyword.id + ) + XCTAssertNil(secondModification.name.originalNode(in: originalFunction)) + XCTAssertEqual(secondModification.name.originalNode(in: modifiedFunction)?.id, modifiedFunction.name.id) + } } From 31b7eb12442818a654c2244ebfac3c3a847c6b25 Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Thu, 1 Aug 2024 14:38:29 -0700 Subject: [PATCH 9/9] Improve documentation of `SyntaxProtocol.tracked` and write entry in release notes --- Release Notes/601.md | 9 ++++++-- Sources/SwiftSyntax/SyntaxTracking.swift | 29 ++++++++++++++++++++---- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/Release Notes/601.md b/Release Notes/601.md index 0aa91b991d7..a12204d6a71 100644 --- a/Release Notes/601.md +++ b/Release Notes/601.md @@ -6,7 +6,7 @@ - Description: Allows retrieving the represented literal value when valid. - Issue: https://github.com/apple/swift-syntax/issues/405 - Pull Request: https://github.com/apple/swift-syntax/pull/2605 - + - `SyntaxProtocol` now has a method `ancestorOrSelf`. - Description: Returns the node or the first ancestor that satisfies `condition`. - Pull Request: https://github.com/swiftlang/swift-syntax/pull/2696 @@ -19,6 +19,11 @@ - Description: This new library provides facilities for evaluating `#if` conditions and determining which regions of a syntax tree are active according to a given build configuration. - Pull Request: https://github.com/swiftlang/swift-syntax/pull/1816 +- `SyntaxProtocol.tracked` / `SyntaxProtocol.originalNode(in:)` + - Description: `tracked` enables node tracking of a tree. For every tree derived from a tracked tree, `originalNode(in:)` returns the original node in the tracked tree. This allows clients to e.g. get the original location of a node in a source file after a tree has been modified. + - Issue: rdar://112679655 + - Pull Request: https://github.com/apple/swift-syntax/pull/2118 + ## API Behavior Changes - `SyntaxProtocol.trimmed` detaches the node @@ -38,7 +43,7 @@ - Description: Allows retrieving the radix value from the `literal.text`. - Issue: https://github.com/apple/swift-syntax/issues/405 - Pull Request: https://github.com/apple/swift-syntax/pull/2605 - + - `FixIt.Change` gained a new case `replaceChild(data:)`. - Description: The new case covers the replacement of a child node with another node. - Issue: https://github.com/swiftlang/swift-syntax/issues/2205 diff --git a/Sources/SwiftSyntax/SyntaxTracking.swift b/Sources/SwiftSyntax/SyntaxTracking.swift index 1d6c54d63c7..153f2d75643 100644 --- a/Sources/SwiftSyntax/SyntaxTracking.swift +++ b/Sources/SwiftSyntax/SyntaxTracking.swift @@ -278,18 +278,39 @@ class IndexInTreeFinder: SyntaxAnyVisitor { } extension SyntaxProtocol { - /// The same ``Syntax`` but with tracking enabled in the entire tree. + /// Start tracking this syntax tree as the original tree for all trees derived + /// from it. /// - /// All syntax nodes derived from this will be able to find their - /// corresponding location in this original tree. + /// All syntax nodes derived from the returned, tracked, tree will be able to + /// find the corresponding node in the original tree by calling + /// ``SyntaxProtocol/originalNode(in:)``. + /// + /// Derived nodes are + /// - Nodes that contain a node from this tree as a subtree. + /// - Nodes that resulted from modification of a node in this tree (e.g. + /// modification of a child node or insertion of an element into a + /// collection). + /// - Detached subtrees of this tree (see ``SyntaxProtocol/detached``). + /// + /// Node tracking is not enabled by default because maintaining the mapping + /// back to the tracked tree has a performance cost that. + /// + /// A tree can only track a single original tree. I.e. it is not possible to + /// create a node that has one child in tracked tree A and another child in + /// tracked tree B. In practice, this should seldom pose an issue because the + /// most common use case is to mark the tree obtained from a file on disk as + /// the tracked tree and trees from separate source files will rarely be + /// merged. /// + /// - SeeAlso: ``SyntaxProtocol/originalNode(in:)`` /// - Complexity: O(number of ancestors) public var tracked: Self { return Syntax(self).tracked.cast(Self.self) } /// If this syntax node is tracking `originalTree` and this node originated - /// in that tree, return the corresponding corresponding node in `originalTree`. + /// from that tree, return the corresponding corresponding node in + /// `originalTree`. /// /// The original node will have the same structure as this node but the parent /// might be different since it's anchored in `originalTree`.