mirror of
https://github.com/exogen/t2-mapper.git
synced 2026-03-02 12:03:56 +00:00
parallelize script loads
This commit is contained in:
parent
9d3554de02
commit
2f23934de0
17 changed files with 561 additions and 68 deletions
|
|
@ -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)* {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue