harn-hostlib 0.9.21

Opt-in code-intelligence and deterministic-tool host builtins for the Harn VM
Documentation
// WordIndex.swift
//
// Fixture stand-in for the word index. Only shape matters
// for the scenario test — substring queries should find this file by
// name.

import Foundation

public struct WordHit {
    public let file: UInt32
    public let line: UInt32
}

public struct WordIndex {
    public private(set) var index: [String: [WordHit]] = [:]

    public init() {}

    public func get(_ word: String) -> [WordHit] {
        index[word] ?? []
    }
}