new brace style

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@213 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent b264c0e8a8
commit 0cb4e7e046
  1. 16
      jode/jode/flow/LoopBlock.java
  2. 5
      jode/jode/flow/SwitchBlock.java
  3. 11
      jode/jode/flow/SynchronizedBlock.java
  4. 5
      jode/jode/flow/TryBlock.java

@ -253,15 +253,19 @@ public class LoopBlock extends StructuredBlock implements BreakableBlock {
+incr.getInstruction().simplify().toString()+")");
break;
}
writer.println( needBrace?" {": "");
if (needBrace)
writer.openBrace();
else
writer.println();
writer.tab();
bodyBlock.dumpSource(writer);
writer.untab();
if (type == DOWHILE)
writer.println((needBrace?"} ": "")+
"while ("+cond.simplify().toString()+");");
else if (needBrace)
writer.println("}");
if (type == DOWHILE) {
if (needBrace)
writer.closeBraceContinue();
writer.println("while ("+cond.simplify().toString()+");");
} else if (needBrace)
writer.closeBrace();
}

@ -134,10 +134,11 @@ implements BreakableBlock {
writer.println(label+":");
writer.tab();
}
writer.println("switch ("+instr.simplify()+") {");
writer.print("switch ("+instr.simplify()+")");
writer.openBrace();
for (int i=0; i < caseBlocks.length; i++)
caseBlocks[i].dumpSource(writer);
writer.println("}");
writer.closeBrace();
}
/**

@ -82,14 +82,15 @@ public class SynchronizedBlock extends StructuredBlock {
{
if (!isEntered)
writer.println("MISSING MONITORENTER");
writer.println("synchronized ("
+ (object != null
? object.simplify().toString()
: local.getName()) + ") {");
writer.print("synchronized ("
+ (object != null
? object.simplify().toString()
: local.getName()) + ")");
writer.openBrace();
writer.tab();
bodyBlock.dumpSource(writer);
writer.untab();
writer.println("}");
writer.closeBrace();
}
public boolean doTransformations() {

@ -92,13 +92,14 @@ public class TryBlock extends StructuredBlock {
public void dumpInstruction(TabbedPrintWriter writer)
throws java.io.IOException {
writer.println("try {");
writer.print("try");
writer.openBrace();
writer.tab();
subBlocks[0].dumpSource(writer);
writer.untab();
for (int i=1; i<subBlocks.length;i++)
subBlocks[i].dumpSource(writer);
writer.println("}");
writer.closeBrace();
}
/**

Loading…
Cancel
Save