this repo has no description
www.jonmsterling.com/01HC/
1// SPDX-FileCopyrightText: 2025 The Project Pterodactyl Developers
2//
3// SPDX-License-Identifier: MPL-2.0
4
5import Foundation
6
7public struct Cursor: Sendable {
8 let node: SyntaxTree.Child
9 let utf16Offset: Int
10 let children: [Cursor]
11
12 init(node: SyntaxTree.Child, utf16Offset: Int) {
13 self.node = node
14 self.utf16Offset = utf16Offset
15
16 var children: [Cursor] = []
17 var utf16Offset = utf16Offset
18 for childNode in node.children {
19 children.append(Self(node: childNode, utf16Offset: utf16Offset))
20 utf16Offset += childNode.utf16Length
21 }
22
23 self.children = children
24 }
25}