From c2bcc9aab256168cc612e18da7c1d7f275b18de7 Mon Sep 17 00:00:00 2001 From: "Benjamin J. Culkin" Date: Wed, 31 Jul 2019 18:54:39 -0300 Subject: Remove unneeded code --- .../ioutils/format/directives/EscapeDirective.java | 50 +--------------------- 1 file changed, 1 insertion(+), 49 deletions(-) (limited to 'clformat') diff --git a/clformat/src/main/java/bjc/utils/ioutils/format/directives/EscapeDirective.java b/clformat/src/main/java/bjc/utils/ioutils/format/directives/EscapeDirective.java index a5356c9..0b70d47 100644 --- a/clformat/src/main/java/bjc/utils/ioutils/format/directives/EscapeDirective.java +++ b/clformat/src/main/java/bjc/utils/ioutils/format/directives/EscapeDirective.java @@ -13,61 +13,13 @@ import bjc.utils.ioutils.format.*; * @author Ben Culkin */ public class EscapeDirective implements Directive { + @Override public void format(FormatParameters dirParams) throws IOException { Edict edt = compile(dirParams.toCompileCTX()); edt.format(dirParams.toFormatCTX()); } - public void formatF(FormatParameters dirParams) { - Tape itemTape = dirParams.tParams; - CLModifiers mods = dirParams.getMods(); - - boolean shouldExit; - - if (mods.dollarMod) dirParams.tParams.right(); - - CLParameters params = dirParams.getParams(); - switch(params.length()) { - case 0: - shouldExit = dirParams.tParams.atEnd(); - break; - case 1: { - params.mapIndices("count"); - int num = params.getInt(itemTape, "count", "condition count", "^", 0); - - shouldExit = num == 0; - break; - } - case 2: { - params.mapIndices("lhand", "rhand"); - int left = params.getInt(itemTape, "lhand", "left-hand condition", "^", 0); - int right = params.getInt(itemTape, "rhand", "right-hand condition", "^", 0); - - shouldExit = left == right; - break; - } - case 3: - default: { - params.mapIndices("lower", "ival", "upper"); - - int low = params.getInt(itemTape, "lower", "lower-bound condition", "^", 0); - int mid = params.getInt(itemTape, "ival", "interval condition", "^", 0); - int high = params.getInt(itemTape, "upper", "upper-bound condition", "^", 0); - - shouldExit = (low <= mid) && (mid <= high); - break; - } - } - - if (mods.dollarMod) dirParams.tParams.left(); - - /* At negates it. */ - if(mods.atMod) shouldExit = !shouldExit; - - if(shouldExit) throw new EscapeException(mods.colonMod); - } - @Override public Edict compile(CompileContext compCTX) { CLParameters params = compCTX.decr.parameters; -- cgit v1.2.3