Records the last scan refused for an out-of-contract express id (express-id.ts, #3395). Reset per scan; the caller reports it.
Scan for all entity declarations (#EXPRESS_ID = TYPE(...)) Returns entity references without parsing full content.
Closes each record on the ')' balancing its argument list. The scan itself
lives in scan-entities-balanced.ts; only the refusal count comes back
here, and it comes back in a finally so an abandoned generator still
reports what it refused.
FAST scan - skips to semicolon instead of matching parentheses ~5-10x faster for large files, yields length=0 (calculate on-demand)
0 or 1: whether the last run DROPPED a record for having no terminator of its own. Never a count of how many: the first is reported and later ones are not accumulated. Nor does it say the scan STOPPED.
The two scans DISAGREE about which records exist, and this is where that shows.
scanEntitiesFastapplies the #4179 record-boundary rules, so#1=IFCA(1);\n#2=IFCB(2)\n#3=IFCC(3);gives ids [1, 3] and a count of 1: it drops the unterminated #2 and recovers.scanEntities(BalancedEntityScan) closes every record on the ')' balancing its '(' and never looks at the ';' at all, so the same input gives [1, 2, 3] and a count of 0. Reset at the start of every scan; the caller reports it.