this repo has no description
www.jonmsterling.com/01HC/
1import Foundation
2
3public struct Cursor<L: Language>: Sendable {
4 let node: Child<L>
5 let utf16Offset: Int
6 let children: [Cursor<L>]
7
8 init(node: Child<L>, utf16Offset: Int) {
9 self.node = node
10 self.utf16Offset = utf16Offset
11
12 var children: [Cursor<L>] = []
13 var utf16Offset = utf16Offset
14 for childNode in node.children {
15 children.append(Self(node: childNode, utf16Offset: utf16Offset))
16 utf16Offset += childNode.utf16Length
17 }
18
19 self.children = children
20 }
21}