geirm       00/12/09 20:49:34

  Modified:    src/java/org/apache/velocity/runtime/parser Parser.jjt
  Log:
  Changes to support template-scope for inline VMs.
  
  Revision  Changes    Path
  1.40      +13 -4     
jakarta-velocity/src/java/org/apache/velocity/runtime/parser/Parser.jjt
  
  Index: Parser.jjt
  ===================================================================
  RCS file: 
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/Parser.jjt,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- Parser.jjt        2000/12/08 03:17:31     1.39
  +++ Parser.jjt        2000/12/10 04:49:33     1.40
  @@ -120,7 +120,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
  - * @version $Id: Parser.jjt,v 1.39 2000/12/08 03:17:31 geirm Exp $ 
  + * @version $Id: Parser.jjt,v 1.40 2000/12/10 04:49:33 geirm Exp $ 
   */
   public class Parser
   {
  @@ -162,6 +162,15 @@
           
           strCurrentTemplateName = strTemplateName;
   
  +        /*
  +         *  clearing the VM namespace for this template
  +         *  the VM factory / manager will determine if this 
  +         *  is appropose, but I think this is the place to indicate
  +         *  that it should be done.
  +         */
  +
  +        Runtime.dumpVMNamespace( strCurrentTemplateName );
  +
           try
           {
               token_source.clearStateVars();
  @@ -233,7 +242,7 @@
           {
              bRecognizedDirective = true;
           }
  -        else if (Runtime.isVelocimacro( strDirective.substring(1)))
  +        else if (Runtime.isVelocimacro( strDirective.substring(1), 
strCurrentTemplateName))
           {
               bRecognizedDirective = true;
           }
  @@ -1010,7 +1019,7 @@
   
           if ( isDirective( t.next.image.substring(1)))
               bControl = true;
  -        else if ( Runtime.isVelocimacro( t.next.image.substring(1)))
  +        else if ( Runtime.isVelocimacro( t.next.image.substring(1), 
strCurrentTemplateName))
               bControl = true;
   
           t.image = "";
  @@ -1120,7 +1129,7 @@
                *  if null, then not a real directive, but maybe a Velocimacro
                 */
   
  -            d  =  (Directive) Runtime.getVelocimacro( strDirectiveName );
  +            d  =  (Directive) Runtime.getVelocimacro( strDirectiveName, 
strCurrentTemplateName );
   
               if (d == null) 
               {   
  
  
  

Reply via email to