parallelize script loads

This commit is contained in:
Brian Beck 2025-12-02 22:06:20 -08:00
parent 9d3554de02
commit 2f23934de0
17 changed files with 561 additions and 68 deletions

View file

@ -1,7 +1,8 @@
{{
// Collect exec() script paths during parsing (deduplicated)
const execScriptPathsSet = new Set();
let hasDynamicExec = false;
// These are reset in the per-parse initializer below
let execScriptPathsSet;
let hasDynamicExec;
function buildBinaryExpression(head, tail) {
return tail.reduce((left, [op, right]) => ({
@ -41,6 +42,12 @@
}
}}
// Per-parse initializer - reset state for each parse call
{
execScriptPathsSet = new Set();
hasDynamicExec = false;
}
// Main entry point
Program
= ws items:((Comment / Statement) ws)* {