*** empty log message ***
[phpeclipse.git] / net.sourceforge.phpeclipse / src / test / PHPParser.jj
index 915c49c..a28acb9 100644 (file)
@@ -635,7 +635,7 @@ void PhpBlock() :
 {
   phpEchoBlock()
 |
-  [ <PHPSTARTLONG>
+  [   <PHPSTARTLONG>
     | <PHPSTARTSHORT>
     {try {
       setMarker(fileToParse,
@@ -798,7 +798,7 @@ FieldDeclaration FieldDeclaration() :
     errorLevel   = ERROR;
     errorStart   = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
     errorEnd     = SimpleCharStream.getPosition() + 1;
-    throw e;
+    processParseException(e);
   }
 
   {list = new VariableDeclaration[arrayList.size()];
@@ -1831,10 +1831,11 @@ HTMLBlock htmlBlock() :
     throw e;
   }
   {
-  nbNodes = nodePtr-startIndex - 1;
+  nbNodes    = nodePtr - startIndex;
   blockNodes = new AstNode[nbNodes];
   System.arraycopy(nodes,startIndex,blockNodes,0,nbNodes);
-  return new HTMLBlock(nodes);}
+  nodePtr = startIndex;
+  return new HTMLBlock(blockNodes);}
 }
 
 /**
@@ -2102,9 +2103,11 @@ Statement BlockStatement() :
   final Statement statement;
 }
 {
-  statement = Statement()         {return statement;}
+  statement = Statement()         {if (phpDocument == currentSegment) pushOnAstNodes(statement);
+                                   return statement;}
 | statement = ClassDeclaration()  {return statement;}
-| statement = MethodDeclaration() {return statement;}
+| statement = MethodDeclaration() {if (phpDocument == currentSegment) pushOnAstNodes(statement);
+                                   return statement;}
 }
 
 /**