diff --git a/TorqueScript.pegjs b/TorqueScript.pegjs index d38b1322..290a9ba2 100644 --- a/TorqueScript.pegjs +++ b/TorqueScript.pegjs @@ -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)* { diff --git a/docs/404.html b/docs/404.html index 298d9c21..d3954c6f 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1 +1 @@ -