From 4176463b88349ea619adac7d24733464459310f0 Mon Sep 17 00:00:00 2001 From: axelcl Date: Mon, 19 Dec 2005 23:31:45 +0000 Subject: [PATCH 1/1] Fix #1371992: Error with switch when last case block omits break or return --- .../phpdt/internal/compiler/parser/Parser.java | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Parser.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Parser.java index c1e2cf7..ded438e 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Parser.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Parser.java @@ -1725,6 +1725,10 @@ public class Parser implements ITerminalSymbols, CompilerModifiers, ParserBasicI expr(); // constant(); if (token == TokenNameCOLON || token == TokenNameSEMICOLON) { getNextToken(); + if (token == TokenNameRBRACE) { + // empty case; assumes that the '}' token belongs to the wrapping switch statement + break; + } if (token == TokenNamecase || token == TokenNamedefault) { // empty case statement ? continue; @@ -1752,7 +1756,7 @@ public class Parser implements ITerminalSymbols, CompilerModifiers, ParserBasicI if (token == TokenNameCOLON || token == TokenNameSEMICOLON) { getNextToken(); if (token == TokenNameRBRACE) { - // empty default case + // empty default case; ; assumes that the '}' token belongs to the wrapping switch statement break; } if (token != TokenNamecase) { -- 1.7.1