use of org.develnext.jphp.core.tokenizer.token.stmt.ContinueStmtToken in project jphp by jphp-compiler.
the class JumpCompiler method write.
@Override
public void write(JumpStmtToken token) {
int level = token.getLevel();
JumpItem jump = method.getJump(level);
if (jump == null) {
env.error(token.toTraceInfo(compiler.getContext()), ErrorType.E_COMPILE_ERROR, level == 1 ? Messages.ERR_CANNOT_JUMP.fetch() : Messages.ERR_CANNOT_JUMP_TO_LEVEL.fetch(level));
return;
}
if (token instanceof ContinueStmtToken) {
add(new JumpInsnNode(GOTO, jump.continueLabel));
} else if (token instanceof BreakStmtToken) {
add(new JumpInsnNode(GOTO, jump.breakLabel));
}
}
Aggregations