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...@apache.org on 2001/11/08 03:41:30 UTC

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

geirm       01/11/07 18:41:29

  Modified:    src/java/org/apache/velocity/runtime/parser Tag:
                        VEL_1_2_BRANCH Parser.jjt
  Log:
  Backport the 'disappearing curly' and David Esposito's 'nit' fixes
  from the 1.3 to 1.2 for release.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.66.2.1  +21 -12    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.66
  retrieving revision 1.66.2.1
  diff -u -r1.66 -r1.66.2.1
  --- Parser.jjt	2001/08/13 13:57:42	1.66
  +++ Parser.jjt	2001/11/08 02:41:29	1.66.2.1
  @@ -108,8 +108,6 @@
        */
       DEBUG_PARSER=false;
       DEBUG_TOKEN_MANAGER=false;
  -
  -
   }    
   
   PARSER_BEGIN(Parser)
  @@ -134,9 +132,9 @@
    * Please look at the Parser.jjt file which is
    * what controls the generation of this class.
    *
  - * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
  + * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
    * @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
  - * @version $Id: Parser.jjt,v 1.66 2001/08/13 13:57:42 geirm Exp $ 
  + * @version $Id: Parser.jjt,v 1.66.2.1 2001/11/08 02:41:29 geirm Exp $ 
   */
   public class Parser
   {
  @@ -692,7 +690,7 @@
                * you are going into DIRECTIVE while in REFERENCE.  -gmj
                */
   
  -            if (curLexState == REFERENCE)
  +            if (curLexState == REFERENCE || curLexState == REFMODIFIER )
               {
                   inReference = false;
                   stateStackPop();
  @@ -1028,7 +1026,7 @@
   {
       IfStatement()
   |   StopStatement()
  -|   Reference()
  +|   LOOKAHEAD(2) Reference()
   |   Comment()
   |   SetDirective()
   |   EscapedDirective()
  @@ -1330,12 +1328,21 @@
   
   void Reference() : {}
   { 
  -    // This should be changed to Indentifier() now. Make
  -    // it easier to walk the AST.
  -    [<LCURLY>]
  -    <IDENTIFIER>
  -    [<RCURLY>]
  -    (LOOKAHEAD(2) <DOT> (LOOKAHEAD(3) Method() | Identifier() ) [<RCURLY>] )*
  +    /*
  +     *  A reference is either ${<FOO>} or  $<FOO>
  +     */
  +     
  +      ( 
  +         <IDENTIFIER> 
  +         (LOOKAHEAD(2) <DOT> (LOOKAHEAD(3) Method() | Identifier() ))* 
  +      )
  +      |      
  +      ( 
  +         <LCURLY> 
  +         <IDENTIFIER>  
  +         (LOOKAHEAD(2) <DOT> (LOOKAHEAD(3) Method() | Identifier() ))* 
  +         <RCURLY>
  +      )
   }
   
   void True() : {}
  @@ -1362,6 +1369,8 @@
   |   <NUMBER_LITERAL>
   |   <STRING_LITERAL>
   |   <ESCAPE>
  +|   <LCURLY>
  +|   <RCURLY>
   }
   
   /* -----------------------------------------------------------------------
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>