Found it. "IF with var decl in TRUE branch" causes the infinite loop. The issue is that in occam, an IF branch body can contain variable declarations before statements:
IF
TRUE
VAL INT max.digits IS 20:
[max.digits]INT D:
INT x, i:
SEQ
SKIP
The parser doesn't handle multiple statements (declarations + body) inside an IF branch. Let me look at how the IF body is parsed: