v4 Semantics
Loop legality
breakandcontinuerequire active loop context- track
loopDepth - emit deterministic diagnostics
for loop analysis
- dedicated loop scope for init/cond/post/body
- loop scope ends at loop end
while semantics
- no new variable scope from header
- loopDepth still controls break/continue legality
Function + loop context
- track functionDepth and loopDepth independently
returnandcontinue/breakare separate legality checks
Short-circuit analysis
- analyze both sides of
&&and|| - do not skip static errors on RHS
Layered checks
- keep v3/v4 checks for names, redeclarations, consts, arity, return
Quick checks
- nested loops
- invalid post variable references
- unresolved names in logical RHS
1 / 1