new braces style

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@204 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 60f3ddda89
commit cf1ef397e5
  1. 11
      jode/jode/flow/CaseBlock.java
  2. 6
      jode/jode/flow/CatchBlock.java
  3. 4
      jode/jode/flow/FinallyBlock.java

@ -131,22 +131,25 @@ public class CaseBlock extends StructuredBlock {
&& subBlock instanceof EmptyBlock
&& subBlock.jump == null)
return;
writer.println("default:" + (wantBraces ? " {" : ""));
writer.print("default:");
} else {
ConstOperator constOp = new ConstOperator
(((SwitchBlock)outer).getInstruction().getType(),
Integer.toString(value));
constOp.makeInitializer();
writer.println("case " + constOp.toString() + ":"
+ (wantBraces ? " {" : ""));
writer.print("case " + constOp.toString() + ":");
}
if (wantBraces)
writer.openBrace();
else
writer.println();
if (subBlock != null) {
writer.tab();
subBlock.dumpSource(writer);
writer.untab();
}
if (wantBraces)
writer.println("}");
writer.closeBrace();
}
/**

@ -104,8 +104,10 @@ public class CatchBlock extends StructuredBlock {
public void dumpInstruction(jode.TabbedPrintWriter writer)
throws java.io.IOException {
writer.println("} catch ("+exceptionType.toString() + " "
+ exceptionLocal.getName().toString()+ ") {");
writer.closeBraceContinue();
writer.print("catch ("+exceptionType.toString() + " "
+ exceptionLocal.getName().toString()+ ")");
writer.openBrace();
writer.tab();
catchBlock.dumpSource(writer);
writer.untab();

@ -46,7 +46,9 @@ public class FinallyBlock extends CatchBlock {
public void dumpInstruction(jode.TabbedPrintWriter writer)
throws java.io.IOException {
writer.println("} finally {");
writer.closeBraceContinue();
writer.print("finally");
writer.openBrace();
writer.tab();
catchBlock.dumpSource(writer);
writer.untab();

Loading…
Cancel
Save