loopDepth property
If loopDepth > 0 we are in a loop construct and can break. This is used to detect the correctness of the "break" keyword.
Implementation
int loopDepth = 0;
If loopDepth > 0 we are in a loop construct and can break. This is used to detect the correctness of the "break" keyword.
int loopDepth = 0;