From: kpouer Date: Thu, 9 Oct 2003 13:12:35 +0000 (+0000) Subject: a bug fixed in the switch labels parsing X-Git-Url: http://secure.phpeclipse.com a bug fixed in the switch labels parsing --- diff --git a/net.sourceforge.phpeclipse/src/test/PHPParser.java b/net.sourceforge.phpeclipse/src/test/PHPParser.java index 219e662..07c6773 100644 --- a/net.sourceforge.phpeclipse/src/test/PHPParser.java +++ b/net.sourceforge.phpeclipse/src/test/PHPParser.java @@ -4005,6 +4005,7 @@ Token token; Statement statement; final ArrayList stmts = new ArrayList(); final Token token = PHPParser.token; + final int start = PHPParser.token.next.sourceStart; expr = SwitchLabel(); label_31: while (true) { @@ -4123,7 +4124,8 @@ Token token; final Statement[] stmtsArray = new Statement[listSize]; stmts.toArray(stmtsArray); if (expr == null) {//it's a default - {if (true) return new DefaultCase(stmtsArray,token.sourceStart,stmtsArray[listSize-1].sourceEnd);} + final int end = PHPParser.token.next.sourceStart; + {if (true) return new DefaultCase(stmtsArray,start,end);} } if (listSize != 0) { {if (true) return new Case(expr,stmtsArray,expr.sourceStart,stmtsArray[listSize-1].sourceEnd);} @@ -5963,6 +5965,12 @@ final ArrayList list = new ArrayList(); return false; } + static final private boolean jj_3_5() { + if (jj_3R_45()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + static final private boolean jj_3R_186() { if (jj_scan_token(BIT_AND)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -6002,12 +6010,6 @@ final ArrayList list = new ArrayList(); return false; } - static final private boolean jj_3_5() { - if (jj_3R_45()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - static final private boolean jj_3R_94() { if (jj_scan_token(ORASSIGN)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; diff --git a/net.sourceforge.phpeclipse/src/test/PHPParser.jj b/net.sourceforge.phpeclipse/src/test/PHPParser.jj index 14f1716..f2cd08d 100644 --- a/net.sourceforge.phpeclipse/src/test/PHPParser.jj +++ b/net.sourceforge.phpeclipse/src/test/PHPParser.jj @@ -2803,6 +2803,7 @@ AbstractCase switchLabel0() : Statement statement; final ArrayList stmts = new ArrayList(); final Token token = PHPParser.token; + final int start = PHPParser.token.next.sourceStart; } { expr = SwitchLabel() @@ -2815,7 +2816,8 @@ AbstractCase switchLabel0() : final Statement[] stmtsArray = new Statement[listSize]; stmts.toArray(stmtsArray); if (expr == null) {//it's a default - return new DefaultCase(stmtsArray,token.sourceStart,stmtsArray[listSize-1].sourceEnd); + final int end = PHPParser.token.next.sourceStart; + return new DefaultCase(stmtsArray,start,end); } if (listSize != 0) { return new Case(expr,stmtsArray,expr.sourceStart,stmtsArray[listSize-1].sourceEnd);