[tools] parse IndexOfBlock inside procedures

a procedure can only see its own blocks