You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by ge...@locus.apache.org on 2000/11/01 02:10:34 UTC

cvs commit: jakarta-velocity/src/java/org/apache/velocity/runtime/parser Parser.jjt

geirm       00/10/31 17:10:34

  Modified:    src/java/org/apache/velocity/runtime/parser Parser.jjt
  Log:
  Separated the ) for REFMOD2 and DIRECTIVE to keep REFMOD2 from eating the whitespace.
  
  Revision  Changes    Path
  1.12      +15 -3     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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Parser.jjt	2000/10/31 16:02:21	1.11
  +++ Parser.jjt	2000/11/01 01:10:34	1.12
  @@ -122,7 +122,7 @@
    *
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
    * @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
  - * @version $Id: Parser.jjt,v 1.11 2000/10/31 16:02:21 geirm Exp $ 
  + * @version $Id: Parser.jjt,v 1.12 2000/11/01 01:10:34 geirm Exp $ 
   */
   public class Parser
   {
  @@ -450,7 +450,7 @@
       <COMMA:",">
   }
   
  -<DIRECTIVE,REFMODIFIER,REFMOD2>
  +<DIRECTIVE,REFMODIFIER>
   TOKEN:
   {
       <LPAREN: "(">
  @@ -473,6 +473,18 @@
       }    
   }
   
  +/*
  + *  in REFMOD2, we don't want to bind the whitespace and \n like we do when closing a directive.
  + */
  +<REFMOD2>
  +TOKEN:
  +{
  +    <REFMOD2_RPAREN: ")">
  +    {
  +       RPARENHandler();
  +    }    
  +}
  +
   <*>
   MORE :
   {
  @@ -956,7 +968,7 @@
    */
   void Method() : {}
   {
  -    Identifier() <LPAREN> [ Parameter() ( <COMMA> Parameter() )* ] <RPAREN>
  +    Identifier() <LPAREN> [ Parameter() ( <COMMA> Parameter() )* ] <REFMOD2_RPAREN>
   }
   
   void Reference() : {}