diff --git a/src/me/topchetoeu/jscript/compilation/control/SwitchStatement.java b/src/me/topchetoeu/jscript/compilation/control/SwitchStatement.java index 8e6b521..1151a35 100644 --- a/src/me/topchetoeu/jscript/compilation/control/SwitchStatement.java +++ b/src/me/topchetoeu/jscript/compilation/control/SwitchStatement.java @@ -66,9 +66,6 @@ public class SwitchStatement extends Statement { if (instr.type == Type.NOP && instr.is(0, "break") && instr.get(1) == null) { target.set(i, Instruction.jmp(target.size() - i).locate(instr.location)); } - if (instr.type == Type.NOP && instr.is(0, "try_break") && instr.get(1) == null) { - target.set(i, Instruction.signal("jmp_" + (target.size() - (Integer)instr.get(2))).locate(instr.location)); - } } for (var el : caseMap.entrySet()) { var loc = target.get(el.getKey()).location; diff --git a/src/me/topchetoeu/jscript/compilation/control/WhileStatement.java b/src/me/topchetoeu/jscript/compilation/control/WhileStatement.java index d7f04a2..af7738b 100644 --- a/src/me/topchetoeu/jscript/compilation/control/WhileStatement.java +++ b/src/me/topchetoeu/jscript/compilation/control/WhileStatement.java @@ -81,14 +81,6 @@ public class WhileStatement extends Statement { target.set(i, Instruction.jmp(breakPoint - i)); target.get(i).location = instr.location; } - if (instr.type == Type.NOP && instr.is(0, "try_cont") && (instr.get(1) == null || instr.is(1, label))) { - target.set(i, Instruction.signal("jmp_" + (continuePoint - (Integer)instr.get(2)))); - target.get(i).location = instr.location; - } - if (instr.type == Type.NOP && instr.is(0, "try_break") && (instr.get(1) == null || instr.is(1, label))) { - target.set(i, Instruction.signal("jmp_" + (breakPoint - (Integer)instr.get(2)))); - target.get(i).location = instr.location; - } } } diff --git a/src/me/topchetoeu/jscript/compilation/values/FunctionStatement.java b/src/me/topchetoeu/jscript/compilation/values/FunctionStatement.java index eb52f84..c0937db 100644 --- a/src/me/topchetoeu/jscript/compilation/values/FunctionStatement.java +++ b/src/me/topchetoeu/jscript/compilation/values/FunctionStatement.java @@ -28,10 +28,10 @@ public class FunctionStatement extends Statement { public static void checkBreakAndCont(List target, int start) { for (int i = start; i < target.size(); i++) { if (target.get(i).type == Type.NOP) { - if (target.get(i).is(0, "break") || target.get(i).is(0, "try_break")) { + if (target.get(i).is(0, "break") ) { throw new SyntaxException(target.get(i).location, "Break was placed outside a loop."); } - if (target.get(i).is(0, "cont") || target.get(i).is(0, "try_cont")) { + if (target.get(i).is(0, "cont")) { throw new SyntaxException(target.get(i).location, "Continue was placed outside a loop."); } }