1// SPDX-FileCopyrightText: 2025 The Project Pterodactyl Developers 2// 3// SPDX-License-Identifier: MPL-2.0 4 5import Foundation 6 7struct LocalAnalysis { 8 let depth: Int 9 10 init(depth: Int = 0) { 11 self.depth = depth 12 } 13 14 var next: Self { 15 Self(depth: depth + 1) 16 } 17 18 func fresh(type: AsyncThunk<Value.Type_>) -> Value { 19 let boundary: AsyncThunk<Value.Boundary> = AsyncThunk { 20 await Value.Boundary(type: type.value(), value: nil) 21 } 22 23 return Value.shift( 24 neutral: Value.Neutral( 25 head: .local(level: depth), 26 spine: [], 27 boundary: boundary 28 ) 29 ) 30 } 31}