mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-05 08:13:06 +08:00
A while loop's counter gets an integer range when the loop only adds
positive literals to it and its condition bounds it. A counter written
inside a nested loop was refused, which is every hand-written scanner:
`while (pos < end) { ... while (pos < end && isDigit(...)) pos++; ... }`.
A nested while loop may now advance the counter when its own condition
bounds it the same way and does not write it. Its passes start at most
at that bound, so it leaves the counter at its entry value or at the
highest value one of its passes reaches, and the outer loop's range
follows from there. Other nested loops, and nested loops that do not
bound the counter, still refuse it.