import fs from 'node:fs';
import { fileURLToPath } from 'node:url';
import createAnalyze from "./analyze.mjs";
const treeSitterYamlPath = fileURLToPath(new URL('../../wasm/tree-sitter-yaml.wasm', import.meta.url));
const treeSitterYaml = fs.readFileSync(treeSitterYamlPath);

/**
 * Lexical Analysis of source string using WebTreeSitter.
 * This is WebAssembly version of TreeSitters Lexical Analysis.
 *
 * Given JavaScript doesn't support true parallelism, this
 * code should be as lazy as possible and temporal safety should be fine.
 * @public
 */
const analyze = createAnalyze(treeSitterYaml);
export default analyze;