geirm       00/11/11 14:43:25

  Modified:    src/java/org/apache/velocity/runtime/directive Foreach.java
  Log:
  Rewrote the block handling to be clearer, and removed support for escape handling, 
which is now elsewhere in the parser and nodes..
  
  Revision  Changes    Path
  1.18      +1 -26     
jakarta-velocity/src/java/org/apache/velocity/runtime/directive/Foreach.java
  
  Index: Foreach.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/directive/Foreach.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- Foreach.java      2000/11/07 21:41:41     1.17
  +++ Foreach.java      2000/11/11 22:43:25     1.18
  @@ -81,7 +81,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
  - * @version $Id: Foreach.java,v 1.17 2000/11/07 21:41:41 geirm Exp $
  + * @version $Id: Foreach.java,v 1.18 2000/11/11 22:43:25 geirm Exp $
    */
   public class Foreach extends Directive
   {
  @@ -100,8 +100,6 @@
       private Object tmp;
       private int iterator;
   
  -    private Node endNode_ = null;
  -
       public String getName() 
       { 
           return "foreach"; 
  @@ -117,21 +115,6 @@
           Object sampleElement = null;
           elementKey = node.jjtGetChild(0).getFirstToken().image.substring(1);
   
  -        /*
  -         *  I am assuming that since we are BLOCK type directive we have an 
EndStatement
  -         */
  -
  -        for( int i = 0; i < node.jjtGetNumChildren(); i++)
  -        {
  -            Node child = node.jjtGetChild(i);
  -               
  -            if ( child.getType() == ParserTreeConstants.JJTENDSTATEMENT )
  -            {    
  -                endNode_ = child;
  -                break;
  -            }
  -        }
  - 
           // This is a refence node and it needs to
           // be inititialized.
           node.jjtGetChild(2).init(context, null);
  @@ -216,14 +199,6 @@
               context.put(elementKey,i.next());
               node.jjtGetChild(3).render(context, writer);
               iterator++;
  -
  -            /*
  -             *  and render the EndStatement()
  -             */
  -  
  -            if (endNode_ != null)
  -                endNode_.render( context, writer );
  -            
           }
   
           context.remove(COUNTER_IDENTIFIER);
  
  
  

Reply via email to