geirm       01/01/24 08:05:07

  Modified:    src/java/org/apache/velocity/runtime/parser Parser.jjt
  Log:
  Small fix to ensure that inSet is properly reset - there was a small bug that if a 
#set() preceeded something like #00FF7F, then the parser would make a mistake.  Very 
amusing, as my client thinks velocity changes the colors of his web pages.... :)
  
  Revision  Changes    Path
  1.52      +13 -2     
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.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- Parser.jjt        2001/01/06 20:56:13     1.51
  +++ Parser.jjt        2001/01/24 16:05:06     1.52
  @@ -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.51 2001/01/06 20:56:13 geirm Exp $ 
  + * @version $Id: Parser.jjt,v 1.52 2001/01/24 16:05:06 geirm Exp $ 
   */
   public class Parser
   {
  @@ -289,7 +289,7 @@
       private boolean inReference;
       public boolean inDirective;
       private boolean inComment;
  -    private boolean inSet;
  +    public  boolean inSet;
   
       /**
        *  pushes the current state onto the 'state stack',
  @@ -810,7 +810,10 @@
            */
   
           if ( lparen == 0 && !inSet && curLexState != REFMOD2)
  +        {
               stateStackPop();
  +        }
  +       
       }
   }
   
  @@ -1298,6 +1301,14 @@
       <SET_DIRECTIVE>  
       [ LOOKAHEAD(2) <WHITESPACE> ] 
       ( LOOKAHEAD(2) ( <LPAREN> Expression() <RPAREN> ) | ( Expression() [<NEWLINE>]) 
)
  +
  +    { 
  +        /*
  +         * ensure that inSet is false.  Leads to some amusing bugs...
  +         */
  +    
  +        token_source.inSet = false; 
  +    }
   }    
   
   /**
  
  
  

Reply via email to