bug fix in declaration searching

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@693 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 7e96eb87ff
commit a9d316f2b5
  1. 14
      jode/jode/flow/CaseBlock.java

@ -102,15 +102,21 @@ public class CaseBlock extends StructuredBlock {
if (!(block instanceof SequentialBlock)) { if (!(block instanceof SequentialBlock)) {
/* This was the last block on the first level. /* This was the last block on the first level.
* If we get here, we need no braces. * Finally check if that is an declaring InstructionBlock.
*/
if (block instanceof InstructionBlock
&& ((InstructionBlock)block).isDeclaration)
return true;
/* If we get here, we need no braces.
*/ */
return false; return false;
} }
StructuredBlock[] subBlocks = block.getSubBlocks(); StructuredBlock[] subBlocks = block.getSubBlocks();
if (subBlocks[0] instanceof InstructionBlock if (subBlocks[0] instanceof InstructionBlock
&& subBlocks[0].declare != null && ((InstructionBlock)subBlocks[0]).isDeclaration) {
&& !subBlocks[0].declare.isEmpty()) {
/* An instruction block declares on the same level as /* An instruction block declares on the same level as
* the surrounding SequentialBlock. * the surrounding SequentialBlock.
*/ */

Loading…
Cancel
Save