You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by wg...@apache.org on 2005/10/06 06:26:17 UTC

svn commit: r306522 - in /jakarta/velocity/core/trunk: src/java/org/apache/velocity/runtime/parser/ test/templates/ test/templates/compare/

Author: wglass
Date: Wed Oct  5 21:25:59 2005
New Revision: 306522

URL: http://svn.apache.org/viewcvs?rev=306522&view=rev
Log:
fixed bug with parse error when comment was last line of file.  VELOCITY-272

Added:
    jakarta/velocity/core/trunk/test/templates/comment-eof.vm
    jakarta/velocity/core/trunk/test/templates/compare/comment-eof.cmp
Modified:
    jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java
    jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jj
    jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jjt
    jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/ParserConstants.java
    jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java
    jakarta/velocity/core/trunk/test/templates/templates.properties

Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java?rev=306522&r1=306521&r2=306522&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java Wed Oct  5 21:25:59 2005
@@ -109,12 +109,12 @@
              *  thrown by the Macro class when something is amiss in the
              *  Macro specification
              */
-            rsvc.getLog().error("Parser Error: #macro() : " + templateName, mee);
+            rsvc.error ("Parser Error:  #macro() : " + templateName + " : " + StringUtils.stackTrace(mee));
             throw new ParseException(mee.getMessage());
         }
         catch (ParseException pe)
         {
-            rsvc.getLog().error("Parser Exception: " + templateName, pe);
+            rsvc.error ("Parser Exception: " + templateName + " : " + StringUtils.stackTrace(pe));
             throw new ParseException (pe.currentToken,
                 pe.expectedTokenSequences, pe.tokenImage);
         }
@@ -124,7 +124,7 @@
         }
         catch (Exception e)
         {
-            rsvc.getLog().error("Parser Error: " + templateName, e);
+            rsvc.error ("Parser Error: " + templateName + " : " + StringUtils.stackTrace(e));
         }
 
         currentTemplateName = "";
@@ -231,10 +231,10 @@
         case RPAREN:
         case ESCAPE_DIRECTIVE:
         case SET_DIRECTIVE:
+        case SINGLE_LINE_COMMENT_START:
         case DOUBLE_ESCAPE:
         case ESCAPE:
         case TEXT:
-        case SINGLE_LINE_COMMENT:
         case FORMAL_COMMENT:
         case MULTI_LINE_COMMENT:
         case STRING_LITERAL:
@@ -300,7 +300,7 @@
         Reference();
       } else {
         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-        case SINGLE_LINE_COMMENT:
+        case SINGLE_LINE_COMMENT_START:
         case FORMAL_COMMENT:
         case MULTI_LINE_COMMENT:
           Comment();
@@ -435,8 +435,16 @@
   jjtree.openNodeScope(jjtn000);
     try {
       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-      case SINGLE_LINE_COMMENT:
-        jj_consume_token(SINGLE_LINE_COMMENT);
+      case SINGLE_LINE_COMMENT_START:
+        jj_consume_token(SINGLE_LINE_COMMENT_START);
+        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+        case SINGLE_LINE_COMMENT:
+          jj_consume_token(SINGLE_LINE_COMMENT);
+          break;
+        default:
+          jj_la1[3] = jj_gen;
+          ;
+        }
         break;
       case MULTI_LINE_COMMENT:
         jj_consume_token(MULTI_LINE_COMMENT);
@@ -445,14 +453,14 @@
         jj_consume_token(FORMAL_COMMENT);
         break;
       default:
-        jj_la1[3] = jj_gen;
+        jj_la1[4] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
       }
     } finally {
-      if (jjtc000) {
-        jjtree.closeNodeScope(jjtn000, true);
-      }
+          if (jjtc000) {
+            jjtree.closeNodeScope(jjtn000, true);
+          }
     }
   }
 
@@ -563,7 +571,7 @@
         {if (true) return ParserTreeConstants.JJTINTEGERLITERAL;}
       break;
     default:
-      jj_la1[4] = jj_gen;
+      jj_la1[5] = jj_gen;
       if (jj_2_3(2147483647)) {
         IntegerRange();
         {if (true) return ParserTreeConstants.JJTINTEGERRANGE;}
@@ -590,7 +598,7 @@
         {if (true) return ParserTreeConstants.JJTFALSE;}
           break;
         default:
-          jj_la1[5] = jj_gen;
+          jj_la1[6] = jj_gen;
           jj_consume_token(-1);
           throw new ParseException();
         }
@@ -623,7 +631,7 @@
         t = jj_consume_token(BRACKETED_WORD);
         break;
       default:
-        jj_la1[6] = jj_gen;
+        jj_la1[7] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
       }
@@ -697,7 +705,7 @@
         jj_consume_token(WHITESPACE);
         break;
       default:
-        jj_la1[7] = jj_gen;
+        jj_la1[8] = jj_gen;
         ;
       }
       jj_consume_token(LPAREN);
@@ -713,7 +721,7 @@
           jj_consume_token(WHITESPACE);
           break;
         default:
-          jj_la1[8] = jj_gen;
+          jj_la1[9] = jj_gen;
           ;
         }
         argType = DirectiveArg();
@@ -762,7 +770,7 @@
         jj_consume_token(WHITESPACE);
         break;
       default:
-        jj_la1[9] = jj_gen;
+        jj_la1[10] = jj_gen;
         ;
       }
       jj_consume_token(RPAREN);
@@ -782,10 +790,10 @@
           case RPAREN:
           case ESCAPE_DIRECTIVE:
           case SET_DIRECTIVE:
+          case SINGLE_LINE_COMMENT_START:
           case DOUBLE_ESCAPE:
           case ESCAPE:
           case TEXT:
-          case SINGLE_LINE_COMMENT:
           case FORMAL_COMMENT:
           case MULTI_LINE_COMMENT:
           case STRING_LITERAL:
@@ -802,7 +810,7 @@
             ;
             break;
           default:
-            jj_la1[10] = jj_gen;
+            jj_la1[11] = jj_gen;
             break label_4;
           }
         }
@@ -891,7 +899,7 @@
             ;
             break;
           default:
-            jj_la1[11] = jj_gen;
+            jj_la1[12] = jj_gen;
             break label_5;
           }
           jj_consume_token(COMMA);
@@ -905,7 +913,7 @@
           jj_consume_token(WHITESPACE);
           break;
         default:
-          jj_la1[12] = jj_gen;
+          jj_la1[13] = jj_gen;
           ;
         }
       }
@@ -957,7 +965,7 @@
             ;
             break;
           default:
-            jj_la1[13] = jj_gen;
+            jj_la1[14] = jj_gen;
             break label_6;
           }
           jj_consume_token(COMMA);
@@ -965,7 +973,7 @@
         }
         break;
       default:
-        jj_la1[14] = jj_gen;
+        jj_la1[15] = jj_gen;
         ;
       }
       jj_consume_token(RBRACKET);
@@ -1007,7 +1015,7 @@
         jj_consume_token(WHITESPACE);
         break;
       default:
-        jj_la1[15] = jj_gen;
+        jj_la1[16] = jj_gen;
         ;
       }
       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
@@ -1019,7 +1027,7 @@
         IntegerLiteral();
         break;
       default:
-        jj_la1[16] = jj_gen;
+        jj_la1[17] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
       }
@@ -1028,7 +1036,7 @@
         jj_consume_token(WHITESPACE);
         break;
       default:
-        jj_la1[17] = jj_gen;
+        jj_la1[18] = jj_gen;
         ;
       }
       jj_consume_token(DOUBLEDOT);
@@ -1037,7 +1045,7 @@
         jj_consume_token(WHITESPACE);
         break;
       default:
-        jj_la1[18] = jj_gen;
+        jj_la1[19] = jj_gen;
         ;
       }
       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
@@ -1049,7 +1057,7 @@
         IntegerLiteral();
         break;
       default:
-        jj_la1[19] = jj_gen;
+        jj_la1[20] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
       }
@@ -1058,7 +1066,7 @@
         jj_consume_token(WHITESPACE);
         break;
       default:
-        jj_la1[20] = jj_gen;
+        jj_la1[21] = jj_gen;
         ;
       }
       jj_consume_token(RBRACKET);
@@ -1094,7 +1102,7 @@
       jj_consume_token(WHITESPACE);
       break;
     default:
-      jj_la1[21] = jj_gen;
+      jj_la1[22] = jj_gen;
       ;
     }
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
@@ -1105,7 +1113,7 @@
       IntegerLiteral();
       break;
     default:
-      jj_la1[22] = jj_gen;
+      jj_la1[23] = jj_gen;
       if (jj_2_6(2147483647)) {
         IntegerRange();
       } else {
@@ -1130,7 +1138,7 @@
           FloatingPointLiteral();
           break;
         default:
-          jj_la1[23] = jj_gen;
+          jj_la1[24] = jj_gen;
           jj_consume_token(-1);
           throw new ParseException();
         }
@@ -1141,7 +1149,7 @@
       jj_consume_token(WHITESPACE);
       break;
     default:
-      jj_la1[24] = jj_gen;
+      jj_la1[25] = jj_gen;
       ;
     }
   }
@@ -1178,7 +1186,7 @@
             ;
             break;
           default:
-            jj_la1[25] = jj_gen;
+            jj_la1[26] = jj_gen;
             break label_7;
           }
           jj_consume_token(COMMA);
@@ -1186,7 +1194,7 @@
         }
         break;
       default:
-        jj_la1[26] = jj_gen;
+        jj_la1[27] = jj_gen;
         ;
       }
       jj_consume_token(REFMOD2_RPAREN);
@@ -1236,7 +1244,7 @@
               Identifier();
               break;
             default:
-              jj_la1[27] = jj_gen;
+              jj_la1[28] = jj_gen;
               jj_consume_token(-1);
               throw new ParseException();
             }
@@ -1262,7 +1270,7 @@
               Identifier();
               break;
             default:
-              jj_la1[28] = jj_gen;
+              jj_la1[29] = jj_gen;
               jj_consume_token(-1);
               throw new ParseException();
             }
@@ -1271,7 +1279,7 @@
         jj_consume_token(RCURLY);
         break;
       default:
-        jj_la1[29] = jj_gen;
+        jj_la1[30] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
       }
@@ -1367,7 +1375,7 @@
         jj_consume_token(RCURLY);
         break;
       default:
-        jj_la1[30] = jj_gen;
+        jj_la1[31] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
       }
@@ -1395,7 +1403,7 @@
         jj_consume_token(WHITESPACE);
         break;
       default:
-        jj_la1[31] = jj_gen;
+        jj_la1[32] = jj_gen;
         ;
       }
       jj_consume_token(LPAREN);
@@ -1412,10 +1420,10 @@
           case RPAREN:
           case ESCAPE_DIRECTIVE:
           case SET_DIRECTIVE:
+          case SINGLE_LINE_COMMENT_START:
           case DOUBLE_ESCAPE:
           case ESCAPE:
           case TEXT:
-          case SINGLE_LINE_COMMENT:
           case FORMAL_COMMENT:
           case MULTI_LINE_COMMENT:
           case STRING_LITERAL:
@@ -1432,7 +1440,7 @@
             ;
             break;
           default:
-            jj_la1[32] = jj_gen;
+            jj_la1[33] = jj_gen;
             break label_10;
           }
           Statement();
@@ -1466,13 +1474,13 @@
             ;
             break;
           default:
-            jj_la1[33] = jj_gen;
+            jj_la1[34] = jj_gen;
             break label_11;
           }
         }
         break;
       default:
-        jj_la1[34] = jj_gen;
+        jj_la1[35] = jj_gen;
         ;
       }
       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
@@ -1480,7 +1488,7 @@
         ElseStatement();
         break;
       default:
-        jj_la1[35] = jj_gen;
+        jj_la1[36] = jj_gen;
         ;
       }
       jj_consume_token(END);
@@ -1523,10 +1531,10 @@
           case RPAREN:
           case ESCAPE_DIRECTIVE:
           case SET_DIRECTIVE:
+          case SINGLE_LINE_COMMENT_START:
           case DOUBLE_ESCAPE:
           case ESCAPE:
           case TEXT:
-          case SINGLE_LINE_COMMENT:
           case FORMAL_COMMENT:
           case MULTI_LINE_COMMENT:
           case STRING_LITERAL:
@@ -1543,7 +1551,7 @@
             ;
             break;
           default:
-            jj_la1[36] = jj_gen;
+            jj_la1[37] = jj_gen;
             break label_12;
           }
           Statement();
@@ -1600,7 +1608,7 @@
         jj_consume_token(WHITESPACE);
         break;
       default:
-        jj_la1[37] = jj_gen;
+        jj_la1[38] = jj_gen;
         ;
       }
       jj_consume_token(LPAREN);
@@ -1617,10 +1625,10 @@
           case RPAREN:
           case ESCAPE_DIRECTIVE:
           case SET_DIRECTIVE:
+          case SINGLE_LINE_COMMENT_START:
           case DOUBLE_ESCAPE:
           case ESCAPE:
           case TEXT:
-          case SINGLE_LINE_COMMENT:
           case FORMAL_COMMENT:
           case MULTI_LINE_COMMENT:
           case STRING_LITERAL:
@@ -1637,7 +1645,7 @@
             ;
             break;
           default:
-            jj_la1[38] = jj_gen;
+            jj_la1[39] = jj_gen;
             break label_13;
           }
           Statement();
@@ -1699,7 +1707,7 @@
         jj_consume_token(WHITESPACE);
         break;
       default:
-        jj_la1[39] = jj_gen;
+        jj_la1[40] = jj_gen;
         ;
       }
       Reference();
@@ -1708,7 +1716,7 @@
         jj_consume_token(WHITESPACE);
         break;
       default:
-        jj_la1[40] = jj_gen;
+        jj_la1[41] = jj_gen;
         ;
       }
       jj_consume_token(EQUALS);
@@ -1724,7 +1732,7 @@
         jj_consume_token(NEWLINE);
         break;
       default:
-        jj_la1[41] = jj_gen;
+        jj_la1[42] = jj_gen;
         ;
       }
     } catch (Throwable jjte000) {
@@ -1841,7 +1849,7 @@
         ;
         break;
       default:
-        jj_la1[42] = jj_gen;
+        jj_la1[43] = jj_gen;
         break label_14;
       }
       jj_consume_token(LOGICAL_OR);
@@ -1881,7 +1889,7 @@
         ;
         break;
       default:
-        jj_la1[43] = jj_gen;
+        jj_la1[44] = jj_gen;
         break label_15;
       }
       jj_consume_token(LOGICAL_AND);
@@ -1922,7 +1930,7 @@
         ;
         break;
       default:
-        jj_la1[44] = jj_gen;
+        jj_la1[45] = jj_gen;
         break label_16;
       }
       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
@@ -1981,7 +1989,7 @@
         }
         break;
       default:
-        jj_la1[45] = jj_gen;
+        jj_la1[46] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
       }
@@ -2000,7 +2008,7 @@
         ;
         break;
       default:
-        jj_la1[46] = jj_gen;
+        jj_la1[47] = jj_gen;
         break label_17;
       }
       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
@@ -2113,7 +2121,7 @@
         }
         break;
       default:
-        jj_la1[47] = jj_gen;
+        jj_la1[48] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
       }
@@ -2130,7 +2138,7 @@
         ;
         break;
       default:
-        jj_la1[48] = jj_gen;
+        jj_la1[49] = jj_gen;
         break label_18;
       }
       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
@@ -2189,7 +2197,7 @@
         }
         break;
       default:
-        jj_la1[49] = jj_gen;
+        jj_la1[50] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
       }
@@ -2207,7 +2215,7 @@
         ;
         break;
       default:
-        jj_la1[50] = jj_gen;
+        jj_la1[51] = jj_gen;
         break label_19;
       }
       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
@@ -2293,7 +2301,7 @@
         }
         break;
       default:
-        jj_la1[51] = jj_gen;
+        jj_la1[52] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
       }
@@ -2307,7 +2315,7 @@
         jj_consume_token(WHITESPACE);
         break;
       default:
-        jj_la1[52] = jj_gen;
+        jj_la1[53] = jj_gen;
         ;
       }
       jj_consume_token(LOGICAL_NOT);
@@ -2351,7 +2359,7 @@
         PrimaryExpression();
         break;
       default:
-        jj_la1[53] = jj_gen;
+        jj_la1[54] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
       }
@@ -2364,7 +2372,7 @@
       jj_consume_token(WHITESPACE);
       break;
     default:
-      jj_la1[54] = jj_gen;
+      jj_la1[55] = jj_gen;
       ;
     }
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
@@ -2379,7 +2387,7 @@
       IntegerLiteral();
       break;
     default:
-      jj_la1[55] = jj_gen;
+      jj_la1[56] = jj_gen;
       if (jj_2_12(2147483647)) {
         IntegerRange();
       } else {
@@ -2405,7 +2413,7 @@
           jj_consume_token(RPAREN);
           break;
         default:
-          jj_la1[56] = jj_gen;
+          jj_la1[57] = jj_gen;
           jj_consume_token(-1);
           throw new ParseException();
         }
@@ -2416,7 +2424,7 @@
       jj_consume_token(WHITESPACE);
       break;
     default:
-      jj_la1[57] = jj_gen;
+      jj_la1[58] = jj_gen;
       ;
     }
   }
@@ -2505,17 +2513,6 @@
     finally { jj_save(11, xla); }
   }
 
-  final private boolean jj_3R_81() {
-    if (jj_scan_token(COMMA)) return true;
-    if (jj_3R_24()) return true;
-    return false;
-  }
-
-  final private boolean jj_3_8() {
-    if (jj_3R_28()) return true;
-    return false;
-  }
-
   final private boolean jj_3R_25() {
     if (jj_3R_20()) return true;
     return false;
@@ -3120,6 +3117,17 @@
     return false;
   }
 
+  final private boolean jj_3R_81() {
+    if (jj_scan_token(COMMA)) return true;
+    if (jj_3R_24()) return true;
+    return false;
+  }
+
+  final private boolean jj_3_8() {
+    if (jj_3R_28()) return true;
+    return false;
+  }
+
   public ParserTokenManager token_source;
   public Token token, jj_nt;
   private int jj_ntk;
@@ -3128,7 +3136,7 @@
   public boolean lookingAhead = false;
   private boolean jj_semLA;
   private int jj_gen;
-  final private int[] jj_la1 = new int[58];
+  final private int[] jj_la1 = new int[59];
   static private int[] jj_la1_0;
   static private int[] jj_la1_1;
   static private int[] jj_la1_2;
@@ -3138,13 +3146,13 @@
       jj_la1_2();
    }
    private static void jj_la1_0() {
-      jj_la1_0 = new int[] {0x9f81b00,0x0,0x9f81b00,0x1c00000,0x8000000,0x30000042,0x0,0x4000000,0x4000000,0x4000000,0x9f81b00,0x8,0x4000000,0x8,0x3c000042,0x4000000,0x0,0x4000000,0x4000000,0x0,0x4000000,0x4000000,0x8000000,0x30000042,0x4000000,0x8,0x3c000042,0x0,0x0,0x0,0x8300300,0x4000000,0x9f81b00,0x0,0x0,0x0,0x9f81b00,0x4000000,0x9f81b00,0x4000000,0x4000000,0x40000000,0x0,0x0,0x0,0x0,0x0,0x0,0x80000000,0x80000000,0x0,0x0,0x4000000,0x3c000142,0x4000000,0x8000000,0x30000142,0x4000000,};
+      jj_la1_0 = new int[] {0x9bc1b00,0x0,0x9bc1b00,0x400000,0x1840000,0x8000000,0x30000042,0x0,0x4000000,0x4000000,0x4000000,0x9bc1b00,0x8,0x4000000,0x8,0x3c000042,0x4000000,0x0,0x4000000,0x4000000,0x0,0x4000000,0x4000000,0x8000000,0x30000042,0x4000000,0x8,0x3c000042,0x0,0x0,0x0,0x8300300,0x4000000,0x9bc1b00,0x0,0x0,0x0,0x9bc1b00,0x4000000,0x9bc1b00,0x4000000,0x4000000,0x40000000,0x0,0x0,0x0,0x0,0x0,0x0,0x80000000,0x80000000,0x0,0x0,0x4000000,0x3c000142,0x4000000,0x8000000,0x30000142,0x4000000,};
    }
    private static void jj_la1_1() {
-      jj_la1_1 = new int[] {0xc6348000,0x48000,0x86300000,0x0,0x42100000,0x200000,0x6000000,0x0,0x0,0x0,0xc6348000,0x0,0x0,0x0,0x40300000,0x0,0x40100000,0x0,0x0,0x40100000,0x0,0x0,0x100000,0x40200000,0x0,0x0,0x40300000,0x40000000,0x40000000,0x40000000,0x80300000,0x0,0xc6348000,0x10000,0x10000,0x20000,0xc6348000,0x0,0xc6348000,0x0,0x0,0x0,0x20,0x10,0xc00,0xc00,0x3c0,0x3c0,0x1,0x1,0xe,0xe,0x0,0x40300000,0x0,0x40100000,0x200000,0x0,};
+      jj_la1_1 = new int[] {0xc6348000,0x48000,0x86300000,0x0,0x0,0x42100000,0x200000,0x6000000,0x0,0x0,0x0,0xc6348000,0x0,0x0,0x0,0x40300000,0x0,0x40100000,0x0,0x0,0x40100000,0x0,0x0,0x100000,0x40200000,0x0,0x0,0x40300000,0x40000000,0x40000000,0x40000000,0x80300000,0x0,0xc6348000,0x10000,0x10000,0x20000,0xc6348000,0x0,0xc6348000,0x0,0x0,0x0,0x20,0x10,0xc00,0xc00,0x3c0,0x3c0,0x1,0x1,0xe,0xe,0x0,0x40300000,0x0,0x40100000,0x200000,0x0,};
    }
    private static void jj_la1_2() {
-      jj_la1_2 = new int[] {0x3,0x0,0x3,0x0,0x1,0x0,0x0,0x0,0x0,0x0,0x3,0x0,0x0,0x0,0x1,0x0,0x1,0x0,0x0,0x1,0x0,0x0,0x0,0x1,0x0,0x0,0x1,0x0,0x0,0x1,0x3,0x0,0x3,0x0,0x0,0x0,0x3,0x0,0x3,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0x0,0x0,};
+      jj_la1_2 = new int[] {0x3,0x0,0x3,0x0,0x0,0x1,0x0,0x0,0x0,0x0,0x0,0x3,0x0,0x0,0x0,0x1,0x0,0x1,0x0,0x0,0x1,0x0,0x0,0x0,0x1,0x0,0x0,0x1,0x0,0x0,0x1,0x3,0x0,0x3,0x0,0x0,0x0,0x3,0x0,0x3,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0x0,0x0,};
    }
   final private JJCalls[] jj_2_rtns = new JJCalls[12];
   private boolean jj_rescan = false;
@@ -3155,7 +3163,7 @@
     token = new Token();
     jj_ntk = -1;
     jj_gen = 0;
-    for (int i = 0; i < 58; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 59; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
   }
 
@@ -3165,7 +3173,7 @@
     jj_ntk = -1;
     jjtree.reset();
     jj_gen = 0;
-    for (int i = 0; i < 58; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 59; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
   }
 
@@ -3174,7 +3182,7 @@
     token = new Token();
     jj_ntk = -1;
     jj_gen = 0;
-    for (int i = 0; i < 58; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 59; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
   }
 
@@ -3184,7 +3192,7 @@
     jj_ntk = -1;
     jjtree.reset();
     jj_gen = 0;
-    for (int i = 0; i < 58; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 59; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
   }
 
@@ -3303,7 +3311,7 @@
       la1tokens[jj_kind] = true;
       jj_kind = -1;
     }
-    for (int i = 0; i < 58; i++) {
+    for (int i = 0; i < 59; i++) {
       if (jj_la1[i] == jj_gen) {
         for (int j = 0; j < 32; j++) {
           if ((jj_la1_0[i] & (1<<j)) != 0) {

Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jj
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jj?rev=306522&r1=306521&r2=306522&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jj (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jj Wed Oct  5 21:25:59 2005
@@ -630,22 +630,6 @@
         }
     }
 
-|   "##"
-   {
-        if (!inComment)
-        {
-            if (curLexState == REFERENCE)
-            {
-                inReference = false;
-                stateStackPop();
-            }
-
-            inComment = true;
-            stateStackPush();
-            SwitchTo(IN_SINGLE_LINE_COMMENT);
-        }
-     }
-
 |   <"#**" ~["#"]>
     {
         input_stream.backup(1);
@@ -689,6 +673,29 @@
     }
 }
 
+
+// treat the single line comment case separately 
+// to avoid ##<EOF> errors
+<*>
+TOKEN : 
+{
+   <SINGLE_LINE_COMMENT_START: "##">
+   {
+        if (!inComment)
+        {
+            if (curLexState == REFERENCE)
+            {
+                inReference = false;
+                stateStackPop();
+            }
+
+            inComment = true;
+            stateStackPush();
+            SwitchTo(IN_SINGLE_LINE_COMMENT);
+        }
+     }
+}
+
 TOKEN :
 {
     <DOUBLE_ESCAPE : "\\\\">
@@ -704,7 +711,7 @@
 <IN_SINGLE_LINE_COMMENT>
 TOKEN :
 {
-  <SINGLE_LINE_COMMENT: "\n" | "\r" | "\r\n" >
+  <SINGLE_LINE_COMMENT: "\n" | "\r" | "\r\n">
   {
      inComment = false;
      stateStackPop();
@@ -1212,16 +1219,16 @@
   jjtree.openNodeScope(jjtn000);
 /*@egen*/}
 {/*@bgen(jjtree) Comment */
-    try {
+        try {
 /*@egen*/
-    <SINGLE_LINE_COMMENT>
+	<SINGLE_LINE_COMMENT_START> ( <SINGLE_LINE_COMMENT> ) ?
 |   <MULTI_LINE_COMMENT>
 |   <FORMAL_COMMENT>/*@bgen(jjtree)*/
-    } finally {
-      if (jjtc000) {
-        jjtree.closeNodeScope(jjtn000, true);
-      }
-    }
+        } finally {
+          if (jjtc000) {
+            jjtree.closeNodeScope(jjtn000, true);
+          }
+        }
 /*@egen*/
 }
 

Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jjt
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jjt?rev=306522&r1=306521&r2=306522&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jjt (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jjt Wed Oct  5 21:25:59 2005
@@ -651,22 +651,6 @@
         }
     }
 
-|   "##"
-   {
-        if (!inComment)
-        {
-            if (curLexState == REFERENCE)
-            {
-                inReference = false;
-                stateStackPop();
-            }
-
-            inComment = true;
-            stateStackPush();
-            SwitchTo(IN_SINGLE_LINE_COMMENT);
-        }
-     }
-
 |   <"#**" ~["#"]>
     {
         input_stream.backup(1);
@@ -710,6 +694,29 @@
     }
 }
 
+
+// treat the single line comment case separately 
+// to avoid ##<EOF> errors
+<*>
+TOKEN : 
+{
+   <SINGLE_LINE_COMMENT_START: "##">
+   {
+        if (!inComment)
+        {
+            if (curLexState == REFERENCE)
+            {
+                inReference = false;
+                stateStackPop();
+            }
+
+            inComment = true;
+            stateStackPush();
+            SwitchTo(IN_SINGLE_LINE_COMMENT);
+        }
+     }
+}
+
 TOKEN :
 {
     <DOUBLE_ESCAPE : "\\\\">
@@ -725,7 +732,7 @@
 <IN_SINGLE_LINE_COMMENT>
 TOKEN :
 {
-  <SINGLE_LINE_COMMENT: "\n" | "\r" | "\r\n" >
+  <SINGLE_LINE_COMMENT: "\n" | "\r" | "\r\n">
   {
      inComment = false;
      stateStackPop();
@@ -1164,7 +1171,7 @@
 
 void Comment() : {}
 {
-    <SINGLE_LINE_COMMENT>
+	<SINGLE_LINE_COMMENT_START> ( <SINGLE_LINE_COMMENT> ) ?
 |   <MULTI_LINE_COMMENT>
 |   <FORMAL_COMMENT>
 }

Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/ParserConstants.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/ParserConstants.java?rev=306522&r1=306521&r2=306522&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/ParserConstants.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/ParserConstants.java Wed Oct  5 21:25:59 2005
@@ -18,7 +18,8 @@
   int SET_DIRECTIVE = 12;
   int DOLLAR = 13;
   int DOLLARBANG = 14;
-  int HASH = 18;
+  int HASH = 17;
+  int SINGLE_LINE_COMMENT_START = 18;
   int DOUBLE_ESCAPE = 19;
   int ESCAPE = 20;
   int TEXT = 21;
@@ -94,10 +95,10 @@
     "<SET_DIRECTIVE>",
     "<DOLLAR>",
     "<DOLLARBANG>",
-    "\"##\"",
-    "<token of kind 16>",
+    "<token of kind 15>",
     "\"#*\"",
     "\"#\"",
+    "\"##\"",
     "\"\\\\\\\\\"",
     "\"\\\\\"",
     "<TEXT>",

Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java?rev=306522&r1=306521&r2=306522&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java Wed Oct  5 21:25:59 2005
@@ -178,7 +178,7 @@
             return 60;
          if ((active0 & 0x80000000L) != 0L)
             return 96;
-         if ((active0 & 0x68000L) != 0L)
+         if ((active0 & 0x70000L) != 0L)
             return 7;
          return -1;
       case 1:
@@ -188,7 +188,7 @@
             jjmatchedPos = 1;
             return 58;
          }
-         if ((active0 & 0x20000L) != 0L)
+         if ((active0 & 0x10000L) != 0L)
             return 5;
          return -1;
       case 2:
@@ -236,8 +236,8 @@
    switch(curChar)
    {
       case 35:
-         jjmatchedKind = 18;
-         return jjMoveStringLiteralDfa1_0(0x28000L);
+         jjmatchedKind = 17;
+         return jjMoveStringLiteralDfa1_0(0x50000L);
       case 37:
          return jjStopAtPos(0, 35);
       case 40:
@@ -284,12 +284,12 @@
    switch(curChar)
    {
       case 35:
-         if ((active0 & 0x8000L) != 0L)
-            return jjStopAtPos(1, 15);
+         if ((active0 & 0x40000L) != 0L)
+            return jjStopAtPos(1, 18);
          break;
       case 42:
-         if ((active0 & 0x20000L) != 0L)
-            return jjStartNfaWithStates_0(1, 17, 5);
+         if ((active0 & 0x10000L) != 0L)
+            return jjStartNfaWithStates_0(1, 16, 5);
          break;
       case 46:
          if ((active0 & 0x10L) != 0L)
@@ -524,8 +524,8 @@
                      jjstateSet[jjnewStateCnt++] = 6;
                   break;
                case 6:
-                  if ((0xfffffff7ffffffffL & l) != 0L && kind > 16)
-                     kind = 16;
+                  if ((0xfffffff7ffffffffL & l) != 0L && kind > 15)
+                     kind = 15;
                   break;
                case 7:
                   if (curChar == 42)
@@ -826,8 +826,8 @@
                      jjstateSet[jjnewStateCnt++] = 33;
                   break;
                case 6:
-                  if (kind > 16)
-                     kind = 16;
+                  if (kind > 15)
+                     kind = 15;
                   break;
                case 11:
                   if ((0xffffffffefffffffL & l) != 0L)
@@ -989,8 +989,8 @@
             switch(jjstateSet[--i])
             {
                case 6:
-                  if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 16)
-                     kind = 16;
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 15)
+                     kind = 15;
                   break;
                case 11:
                   if (jjCanMove_0(hiByte, i1, i2, l1, l2))
@@ -1022,7 +1022,7 @@
    switch (pos)
    {
       case 0:
-         if ((active0 & 0x68000L) != 0L)
+         if ((active0 & 0x70000L) != 0L)
             return 2;
          return -1;
       default :
@@ -1046,8 +1046,8 @@
    switch(curChar)
    {
       case 35:
-         jjmatchedKind = 18;
-         return jjMoveStringLiteralDfa1_6(0x28000L);
+         jjmatchedKind = 17;
+         return jjMoveStringLiteralDfa1_6(0x50000L);
       case 42:
          return jjMoveStringLiteralDfa1_6(0x1000000L);
       default :
@@ -1064,14 +1064,14 @@
    switch(curChar)
    {
       case 35:
-         if ((active0 & 0x8000L) != 0L)
-            return jjStopAtPos(1, 15);
+         if ((active0 & 0x40000L) != 0L)
+            return jjStopAtPos(1, 18);
          else if ((active0 & 0x1000000L) != 0L)
             return jjStopAtPos(1, 24);
          break;
       case 42:
-         if ((active0 & 0x20000L) != 0L)
-            return jjStartNfaWithStates_6(1, 17, 0);
+         if ((active0 & 0x10000L) != 0L)
+            return jjStartNfaWithStates_6(1, 16, 0);
          break;
       default :
          break;
@@ -1112,8 +1112,8 @@
                      jjstateSet[jjnewStateCnt++] = 1;
                   break;
                case 1:
-                  if ((0xfffffff7ffffffffL & l) != 0L && kind > 16)
-                     kind = 16;
+                  if ((0xfffffff7ffffffffL & l) != 0L && kind > 15)
+                     kind = 15;
                   break;
                case 2:
                   if (curChar == 42)
@@ -1154,8 +1154,8 @@
                      jjCheckNAddStates(52, 55);
                   break;
                case 1:
-                  if (kind > 16)
-                     kind = 16;
+                  if (kind > 15)
+                     kind = 15;
                   break;
                case 5:
                   if (curChar == 92)
@@ -1185,8 +1185,8 @@
             switch(jjstateSet[--i])
             {
                case 1:
-                  if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 16)
-                     kind = 16;
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 15)
+                     kind = 15;
                   break;
                default : break;
             }
@@ -1210,7 +1210,7 @@
    switch (pos)
    {
       case 0:
-         if ((active0 & 0x68000L) != 0L)
+         if ((active0 & 0x70000L) != 0L)
             return 2;
          return -1;
       default :
@@ -1234,8 +1234,8 @@
    switch(curChar)
    {
       case 35:
-         jjmatchedKind = 18;
-         return jjMoveStringLiteralDfa1_4(0x28000L);
+         jjmatchedKind = 17;
+         return jjMoveStringLiteralDfa1_4(0x50000L);
       default :
          return jjMoveNfa_4(3, 0);
    }
@@ -1250,12 +1250,12 @@
    switch(curChar)
    {
       case 35:
-         if ((active0 & 0x8000L) != 0L)
-            return jjStopAtPos(1, 15);
+         if ((active0 & 0x40000L) != 0L)
+            return jjStopAtPos(1, 18);
          break;
       case 42:
-         if ((active0 & 0x20000L) != 0L)
-            return jjStartNfaWithStates_4(1, 17, 0);
+         if ((active0 & 0x10000L) != 0L)
+            return jjStartNfaWithStates_4(1, 16, 0);
          break;
       default :
          break;
@@ -1306,8 +1306,8 @@
                      jjstateSet[jjnewStateCnt++] = 1;
                   break;
                case 1:
-                  if ((0xfffffff7ffffffffL & l) != 0L && kind > 16)
-                     kind = 16;
+                  if ((0xfffffff7ffffffffL & l) != 0L && kind > 15)
+                     kind = 15;
                   break;
                case 2:
                   if (curChar == 42)
@@ -1509,8 +1509,8 @@
                      jjstateSet[jjnewStateCnt++] = 4;
                   break;
                case 1:
-                  if (kind > 16)
-                     kind = 16;
+                  if (kind > 15)
+                     kind = 15;
                   break;
                case 4:
                   if (curChar == 102 && kind > 47)
@@ -1757,8 +1757,8 @@
             switch(jjstateSet[--i])
             {
                case 1:
-                  if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 16)
-                     kind = 16;
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 15)
+                     kind = 15;
                   break;
                default : break;
             }
@@ -1784,7 +1784,7 @@
       case 0:
          if ((active0 & 0x180000L) != 0L)
             return 14;
-         if ((active0 & 0x68000L) != 0L)
+         if ((active0 & 0x70000L) != 0L)
             return 29;
          return -1;
       default :
@@ -1808,8 +1808,8 @@
    switch(curChar)
    {
       case 35:
-         jjmatchedKind = 18;
-         return jjMoveStringLiteralDfa1_3(0x28000L);
+         jjmatchedKind = 17;
+         return jjMoveStringLiteralDfa1_3(0x50000L);
       case 92:
          jjmatchedKind = 20;
          return jjMoveStringLiteralDfa1_3(0x80000L);
@@ -1827,12 +1827,12 @@
    switch(curChar)
    {
       case 35:
-         if ((active0 & 0x8000L) != 0L)
-            return jjStopAtPos(1, 15);
+         if ((active0 & 0x40000L) != 0L)
+            return jjStopAtPos(1, 18);
          break;
       case 42:
-         if ((active0 & 0x20000L) != 0L)
-            return jjStartNfaWithStates_3(1, 17, 27);
+         if ((active0 & 0x10000L) != 0L)
+            return jjStartNfaWithStates_3(1, 16, 27);
          break;
       case 92:
          if ((active0 & 0x80000L) != 0L)
@@ -1966,8 +1966,8 @@
                      jjstateSet[jjnewStateCnt++] = 28;
                   break;
                case 28:
-                  if ((0xfffffff7ffffffffL & l) != 0L && kind > 16)
-                     kind = 16;
+                  if ((0xfffffff7ffffffffL & l) != 0L && kind > 15)
+                     kind = 15;
                   break;
                default : break;
             }
@@ -2078,8 +2078,8 @@
                      jjAddStates(109, 110);
                   break;
                case 28:
-                  if (kind > 16)
-                     kind = 16;
+                  if (kind > 15)
+                     kind = 15;
                   break;
                default : break;
             }
@@ -2105,8 +2105,8 @@
                   jjCheckNAdd(12);
                   break;
                case 28:
-                  if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 16)
-                     kind = 16;
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 15)
+                     kind = 15;
                   break;
                default : break;
             }
@@ -2130,7 +2130,7 @@
    switch (pos)
    {
       case 0:
-         if ((active0 & 0x68000L) != 0L)
+         if ((active0 & 0x70000L) != 0L)
             return 2;
          return -1;
       default :
@@ -2154,8 +2154,8 @@
    switch(curChar)
    {
       case 35:
-         jjmatchedKind = 18;
-         return jjMoveStringLiteralDfa1_7(0x28000L);
+         jjmatchedKind = 17;
+         return jjMoveStringLiteralDfa1_7(0x50000L);
       case 42:
          return jjMoveStringLiteralDfa1_7(0x800000L);
       default :
@@ -2172,14 +2172,14 @@
    switch(curChar)
    {
       case 35:
-         if ((active0 & 0x8000L) != 0L)
-            return jjStopAtPos(1, 15);
+         if ((active0 & 0x40000L) != 0L)
+            return jjStopAtPos(1, 18);
          else if ((active0 & 0x800000L) != 0L)
             return jjStopAtPos(1, 23);
          break;
       case 42:
-         if ((active0 & 0x20000L) != 0L)
-            return jjStartNfaWithStates_7(1, 17, 0);
+         if ((active0 & 0x10000L) != 0L)
+            return jjStartNfaWithStates_7(1, 16, 0);
          break;
       default :
          break;
@@ -2220,8 +2220,8 @@
                      jjstateSet[jjnewStateCnt++] = 1;
                   break;
                case 1:
-                  if ((0xfffffff7ffffffffL & l) != 0L && kind > 16)
-                     kind = 16;
+                  if ((0xfffffff7ffffffffL & l) != 0L && kind > 15)
+                     kind = 15;
                   break;
                case 2:
                   if (curChar == 42)
@@ -2262,8 +2262,8 @@
                      jjCheckNAddStates(52, 55);
                   break;
                case 1:
-                  if (kind > 16)
-                     kind = 16;
+                  if (kind > 15)
+                     kind = 15;
                   break;
                case 5:
                   if (curChar == 92)
@@ -2293,8 +2293,8 @@
             switch(jjstateSet[--i])
             {
                case 1:
-                  if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 16)
-                     kind = 16;
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 15)
+                     kind = 15;
                   break;
                default : break;
             }
@@ -2318,7 +2318,7 @@
    switch (pos)
    {
       case 0:
-         if ((active0 & 0x68000L) != 0L)
+         if ((active0 & 0x70000L) != 0L)
             return 2;
          return -1;
       default :
@@ -2342,8 +2342,8 @@
    switch(curChar)
    {
       case 35:
-         jjmatchedKind = 18;
-         return jjMoveStringLiteralDfa1_8(0x28000L);
+         jjmatchedKind = 17;
+         return jjMoveStringLiteralDfa1_8(0x50000L);
       default :
          return jjMoveNfa_8(3, 0);
    }
@@ -2358,12 +2358,12 @@
    switch(curChar)
    {
       case 35:
-         if ((active0 & 0x8000L) != 0L)
-            return jjStopAtPos(1, 15);
+         if ((active0 & 0x40000L) != 0L)
+            return jjStopAtPos(1, 18);
          break;
       case 42:
-         if ((active0 & 0x20000L) != 0L)
-            return jjStartNfaWithStates_8(1, 17, 0);
+         if ((active0 & 0x10000L) != 0L)
+            return jjStartNfaWithStates_8(1, 16, 0);
          break;
       default :
          break;
@@ -2411,8 +2411,8 @@
                      jjstateSet[jjnewStateCnt++] = 1;
                   break;
                case 1:
-                  if ((0xfffffff7ffffffffL & l) != 0L && kind > 16)
-                     kind = 16;
+                  if ((0xfffffff7ffffffffL & l) != 0L && kind > 15)
+                     kind = 15;
                   break;
                case 2:
                   if (curChar == 42)
@@ -2465,8 +2465,8 @@
                      jjCheckNAddStates(111, 114);
                   break;
                case 1:
-                  if (kind > 16)
-                     kind = 16;
+                  if (kind > 15)
+                     kind = 15;
                   break;
                case 8:
                   if (curChar == 92)
@@ -2496,8 +2496,8 @@
             switch(jjstateSet[--i])
             {
                case 1:
-                  if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 16)
-                     kind = 16;
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 15)
+                     kind = 15;
                   break;
                default : break;
             }
@@ -2521,7 +2521,7 @@
    switch (pos)
    {
       case 0:
-         if ((active0 & 0x68000L) != 0L)
+         if ((active0 & 0x70000L) != 0L)
             return 2;
          if ((active0 & 0x30000000L) != 0L)
          {
@@ -2530,7 +2530,7 @@
          }
          return -1;
       case 1:
-         if ((active0 & 0x20000L) != 0L)
+         if ((active0 & 0x10000L) != 0L)
             return 0;
          if ((active0 & 0x30000000L) != 0L)
          {
@@ -2578,8 +2578,8 @@
    switch(curChar)
    {
       case 35:
-         jjmatchedKind = 18;
-         return jjMoveStringLiteralDfa1_5(0x28000L);
+         jjmatchedKind = 17;
+         return jjMoveStringLiteralDfa1_5(0x50000L);
       case 102:
          return jjMoveStringLiteralDfa1_5(0x20000000L);
       case 116:
@@ -2602,12 +2602,12 @@
    switch(curChar)
    {
       case 35:
-         if ((active0 & 0x8000L) != 0L)
-            return jjStopAtPos(1, 15);
+         if ((active0 & 0x40000L) != 0L)
+            return jjStopAtPos(1, 18);
          break;
       case 42:
-         if ((active0 & 0x20000L) != 0L)
-            return jjStartNfaWithStates_5(1, 17, 0);
+         if ((active0 & 0x10000L) != 0L)
+            return jjStartNfaWithStates_5(1, 16, 0);
          break;
       case 97:
          return jjMoveStringLiteralDfa2_5(active0, 0x20000000L);
@@ -2716,8 +2716,8 @@
                      jjstateSet[jjnewStateCnt++] = 1;
                   break;
                case 1:
-                  if ((0xfffffff7ffffffffL & l) != 0L && kind > 16)
-                     kind = 16;
+                  if ((0xfffffff7ffffffffL & l) != 0L && kind > 15)
+                     kind = 15;
                   break;
                case 2:
                   if (curChar == 42)
@@ -2775,8 +2775,8 @@
                      jjCheckNAddStates(117, 120);
                   break;
                case 1:
-                  if (kind > 16)
-                     kind = 16;
+                  if (kind > 15)
+                     kind = 15;
                   break;
                case 4:
                case 5:
@@ -2822,8 +2822,8 @@
             switch(jjstateSet[--i])
             {
                case 1:
-                  if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 16)
-                     kind = 16;
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 15)
+                     kind = 15;
                   break;
                default : break;
             }
@@ -2847,7 +2847,7 @@
    switch (pos)
    {
       case 0:
-         if ((active0 & 0x68000L) != 0L)
+         if ((active0 & 0x70000L) != 0L)
             return 2;
          if ((active0 & 0x10L) != 0L)
             return 53;
@@ -2858,7 +2858,7 @@
          }
          return -1;
       case 1:
-         if ((active0 & 0x20000L) != 0L)
+         if ((active0 & 0x10000L) != 0L)
             return 0;
          if ((active0 & 0x30000000L) != 0L)
          {
@@ -2906,8 +2906,8 @@
    switch(curChar)
    {
       case 35:
-         jjmatchedKind = 18;
-         return jjMoveStringLiteralDfa1_1(0x28000L);
+         jjmatchedKind = 17;
+         return jjMoveStringLiteralDfa1_1(0x50000L);
       case 41:
          return jjStopAtPos(0, 10);
       case 44:
@@ -2942,12 +2942,12 @@
    switch(curChar)
    {
       case 35:
-         if ((active0 & 0x8000L) != 0L)
-            return jjStopAtPos(1, 15);
+         if ((active0 & 0x40000L) != 0L)
+            return jjStopAtPos(1, 18);
          break;
       case 42:
-         if ((active0 & 0x20000L) != 0L)
-            return jjStartNfaWithStates_1(1, 17, 0);
+         if ((active0 & 0x10000L) != 0L)
+            return jjStartNfaWithStates_1(1, 16, 0);
          break;
       case 46:
          if ((active0 & 0x10L) != 0L)
@@ -3086,8 +3086,8 @@
                      jjstateSet[jjnewStateCnt++] = 1;
                   break;
                case 1:
-                  if ((0xfffffff7ffffffffL & l) != 0L && kind > 16)
-                     kind = 16;
+                  if ((0xfffffff7ffffffffL & l) != 0L && kind > 15)
+                     kind = 15;
                   break;
                case 2:
                   if (curChar == 42)
@@ -3301,8 +3301,8 @@
                      kind = 63;
                   break;
                case 1:
-                  if (kind > 16)
-                     kind = 16;
+                  if (kind > 15)
+                     kind = 15;
                   break;
                case 6:
                   if ((0xffffffffefffffffL & l) != 0L)
@@ -3375,8 +3375,8 @@
             switch(jjstateSet[--i])
             {
                case 1:
-                  if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 16)
-                     kind = 16;
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 15)
+                     kind = 15;
                   break;
                case 6:
                   if (jjCanMove_0(hiByte, i1, i2, l1, l2))
@@ -3408,7 +3408,7 @@
    switch (pos)
    {
       case 0:
-         if ((active0 & 0x68000L) != 0L)
+         if ((active0 & 0x70000L) != 0L)
             return 2;
          if ((active0 & 0x30000000L) != 0L)
          {
@@ -3417,7 +3417,7 @@
          }
          return -1;
       case 1:
-         if ((active0 & 0x20000L) != 0L)
+         if ((active0 & 0x10000L) != 0L)
             return 0;
          if ((active0 & 0x30000000L) != 0L)
          {
@@ -3465,8 +3465,8 @@
    switch(curChar)
    {
       case 35:
-         jjmatchedKind = 18;
-         return jjMoveStringLiteralDfa1_2(0x28000L);
+         jjmatchedKind = 17;
+         return jjMoveStringLiteralDfa1_2(0x50000L);
       case 40:
          return jjStopAtPos(0, 8);
       case 102:
@@ -3491,12 +3491,12 @@
    switch(curChar)
    {
       case 35:
-         if ((active0 & 0x8000L) != 0L)
-            return jjStopAtPos(1, 15);
+         if ((active0 & 0x40000L) != 0L)
+            return jjStopAtPos(1, 18);
          break;
       case 42:
-         if ((active0 & 0x20000L) != 0L)
-            return jjStartNfaWithStates_2(1, 17, 0);
+         if ((active0 & 0x10000L) != 0L)
+            return jjStartNfaWithStates_2(1, 16, 0);
          break;
       case 97:
          return jjMoveStringLiteralDfa2_2(active0, 0x20000000L);
@@ -3605,8 +3605,8 @@
                      jjstateSet[jjnewStateCnt++] = 1;
                   break;
                case 1:
-                  if ((0xfffffff7ffffffffL & l) != 0L && kind > 16)
-                     kind = 16;
+                  if ((0xfffffff7ffffffffL & l) != 0L && kind > 15)
+                     kind = 15;
                   break;
                case 2:
                   if (curChar == 42)
@@ -3664,8 +3664,8 @@
                      jjCheckNAddStates(117, 120);
                   break;
                case 1:
-                  if (kind > 16)
-                     kind = 16;
+                  if (kind > 15)
+                     kind = 15;
                   break;
                case 4:
                case 5:
@@ -3711,8 +3711,8 @@
             switch(jjstateSet[--i])
             {
                case 1:
-                  if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 16)
-                     kind = 16;
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 15)
+                     kind = 15;
                   break;
                default : break;
             }
@@ -3778,7 +3778,7 @@
    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
 };
 static final long[] jjtoToken = {
-   0xc637fffffdf81fffL, 0x3L,
+   0xc637fffffdfc1fffL, 0x3L,
 };
 static final long[] jjtoSkip = {
    0x2000000L, 0xcL,
@@ -3787,7 +3787,7 @@
    0x0L, 0xcL,
 };
 static final long[] jjtoMore = {
-   0x7e000L, 0x0L,
+   0x3e000L, 0x0L,
 };
 protected CharStream input_stream;
 private final int[] jjrounds = new int[96];
@@ -4127,31 +4127,12 @@
          else
             image.append(input_stream.GetSuffix(jjimageLen));
          jjimageLen = 0;
-        if (!inComment)
-        {
-            if (curLexState == REFERENCE)
-            {
-                inReference = false;
-                stateStackPop();
-            }
-
-            inComment = true;
-            stateStackPush();
-            SwitchTo(IN_SINGLE_LINE_COMMENT);
-        }
-         break;
-      case 16 :
-         if (image == null)
-              image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen)));
-         else
-            image.append(input_stream.GetSuffix(jjimageLen));
-         jjimageLen = 0;
         input_stream.backup(1);
         inComment = true;
         stateStackPush();
         SwitchTo( IN_FORMAL_COMMENT);
          break;
-      case 17 :
+      case 16 :
          if (image == null)
               image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen)));
          else
@@ -4161,7 +4142,7 @@
         stateStackPush();
         SwitchTo( IN_MULTI_LINE_COMMENT );
          break;
-      case 18 :
+      case 17 :
          if (image == null)
               image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen)));
          else
@@ -4267,6 +4248,24 @@
 
             if (curLexState == REFMODIFIER )
                 SwitchTo( REFMOD2 );
+        }
+         break;
+      case 18 :
+        if (image == null)
+            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))));
+         else
+            image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1)));
+        if (!inComment)
+        {
+            if (curLexState == REFERENCE)
+            {
+                inReference = false;
+                stateStackPop();
+            }
+
+            inComment = true;
+            stateStackPush();
+            SwitchTo(IN_SINGLE_LINE_COMMENT);
         }
          break;
       case 22 :

Added: jakarta/velocity/core/trunk/test/templates/comment-eof.vm
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/test/templates/comment-eof.vm?rev=306522&view=auto
==============================================================================
--- jakarta/velocity/core/trunk/test/templates/comment-eof.vm (added)
+++ jakarta/velocity/core/trunk/test/templates/comment-eof.vm Wed Oct  5 21:25:59 2005
@@ -0,0 +1,3 @@
+## Test to see if ##EOF gives an error
+test
+##
\ No newline at end of file

Added: jakarta/velocity/core/trunk/test/templates/compare/comment-eof.cmp
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/test/templates/compare/comment-eof.cmp?rev=306522&view=auto
==============================================================================
--- jakarta/velocity/core/trunk/test/templates/compare/comment-eof.cmp (added)
+++ jakarta/velocity/core/trunk/test/templates/compare/comment-eof.cmp Wed Oct  5 21:25:59 2005
@@ -0,0 +1 @@
+test

Modified: jakarta/velocity/core/trunk/test/templates/templates.properties
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/test/templates/templates.properties?rev=306522&r1=306521&r2=306522&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/test/templates/templates.properties (original)
+++ jakarta/velocity/core/trunk/test/templates/templates.properties Wed Oct  5 21:25:59 2005
@@ -1,4 +1,4 @@
-# Base names of templates to add to the VelocityTestSuite
+# Base names of templates to add to the VelocitytestSuite
 
 test.template.1  = arithmetic
 test.template.2  = array
@@ -45,4 +45,5 @@
 test.template.43 = stop1
 test.template.44 = stop2
 test.template.45 = foreach-null-list
-test.template.46 = curly-directive
\ No newline at end of file
+test.template.46 = curly-directive
+test.template.47 = comment-eof
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: eol-style

Posted by Nathan Bubna <nb...@gmail.com>.
<speculation>i wonder if this is because the source files for the
generated code have non-native line endings.  i could see javacc (or
hibernate) preserving those that it just copies while generating new
ones that are native.  this could explain the mixed line endings
then.</speculation>

On 10/16/05, Will Glass-Husain <wg...@forio.com> wrote:
> Thanks for the note.
>
> I've had some problems making that work (on Windows) with javacc output and
> (on a different project) hibernate generated java files.  They still give me
> an error when committing. (which at the moment I solve by opening/closing
> the file in Textpad to force PC-style newlines).
>
> I'll play around with this some more and report back.
>
> WILL
>
> ----- Original Message -----
> From: "Incze Lajos" <in...@axelero.hu>
> To: "Velocity Developers List" <ve...@jakarta.apache.org>
> Sent: Sunday, October 16, 2005 3:14 PM
> Subject: Re: eol-style
>
>
> > On Sun, Oct 16, 2005 at 09:44:45PM -0000, Marinó A. Jónsson wrote:
> >> Hi,
> >>
> >> Just wanted to point out the auto-props feature in the svn client config
> >> file (at a glance it seems no one else has):
> >
> > There is a recommendation at
> >
> > http://www.apache.org/dev/svn-eol-style.txt
> >
> > incze
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: velocity-dev-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-dev-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: eol-style

Posted by Will Glass-Husain <wg...@forio.com>.
Thanks for the note.

I've had some problems making that work (on Windows) with javacc output and 
(on a different project) hibernate generated java files.  They still give me 
an error when committing. (which at the moment I solve by opening/closing 
the file in Textpad to force PC-style newlines).

I'll play around with this some more and report back.

WILL

----- Original Message ----- 
From: "Incze Lajos" <in...@axelero.hu>
To: "Velocity Developers List" <ve...@jakarta.apache.org>
Sent: Sunday, October 16, 2005 3:14 PM
Subject: Re: eol-style


> On Sun, Oct 16, 2005 at 09:44:45PM -0000, Marinó A. Jónsson wrote:
>> Hi,
>>
>> Just wanted to point out the auto-props feature in the svn client config
>> file (at a glance it seems no one else has):
>
> There is a recommendation at
>
> http://www.apache.org/dev/svn-eol-style.txt
>
> incze
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-dev-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: eol-style

Posted by Incze Lajos <in...@axelero.hu>.
On Sun, Oct 16, 2005 at 09:44:45PM -0000, Marinó A. Jónsson wrote:
> Hi,
> 
> Just wanted to point out the auto-props feature in the svn client config
> file (at a glance it seems no one else has):

There is a recommendation at

http://www.apache.org/dev/svn-eol-style.txt

incze

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


RE: eol-style

Posted by "Marinó A. Jónsson" <ma...@centrum.is>.
Hi,

Just wanted to point out the auto-props feature in the svn client config
file (at a glance it seems no one else has):

http://svnbook.red-bean.com/en/1.1/ch07s02.html#svn-ch-7-sect-2.4

I use it to ensure that all text files have svn:eol-style set to native -
instead of relying on Subversion's "guesswork" when I add files to version
control :)

Here are my settings:

[miscellany]
enable-auto-props = yes

[auto-props]
*.java = svn:eol-style=native
*.xml = svn:eol-style=native
*.wsdd = svn:eol-style=native
*.wsdl = svn:eol-style=native
*.properties = svn:eol-style=native
*.txt = svn:eol-style=native
*.vm = svn:eol-style=native
*.htm = svn:eol-style=native
*.html = svn:eol-style=native
*.js = svn:eol-style=native
*.css = svn:eol-style=native
*.sh = svn:eol-style=native
*.bat = svn:eol-style=native
*.conf = svn:eol-style=native

cheers,
Marinó

-----Original Message-----
From: Nathan Bubna [mailto:nbubna@gmail.com] 
Sent: 15. október 2005 18:30
To: Velocity Developers List
Subject: Re: eol-style

On 10/14/05, Will Glass-Husain <wg...@forio.com> wrote:
> Hi Henning,
>
> Actually, this still doesn't work for ParserTokenManager (setting 
> eol-style to native).  It appears that the line endings are 
> inconsistent (when javacc is run on Windows).  Probably similar to the 
> earlier Anakia problem (which we fixed).
>
> svn: File 'C:/Documents and Settings/wglass/My 
>
Documents/GAWE/velocity/trunk/src/java/org/apache/velocity/runtime/parser/Pa
rserTokenManager.java'
> has inconsistent newlines
>
> The solution for me is to open and close in Textpad, which has an 
> option for force PC style newlines.

nice tip.  Textpad rocks.

> WILL
>
> ----- Original Message -----
> From: "Henning P. Schmiedehausen" <hp...@intermeta.de>
> Newsgroups: hometree.jakarta.velocity.dev
> To: <ve...@jakarta.apache.org>
> Sent: Friday, October 07, 2005 2:04 AM
> Subject: Re: svn commit: r306522 - in /jakarta/velocity/core/trunk:
> src/java/org/apache/velocity/runtime/parser/ test/templates/ 
> test/templates/compare/
>
>
> > "Will Glass-Husain" <wg...@forio.com> writes:
> >
> >>3) If necessary, convert the line endings for 
> >>ParserTokenManager.java to your native platform (other files are ok 
> >>- for some reason this is always Unix).
> >
> > You shouldn't have to do this. As the eol-style is part of the 
> > Subversion meta-information, it will be converted automatically, 
> > once you check your changes in. Just do a "svn up" after checking 
> > in, it should work.
> >
> > The Java platform itself should not care about the line endings when 
> > compiling on Windows.
> >
> > Best regards
> > Henning
> >
> > --
> > Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
> > hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/
> >
> > RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for
hire
> >   Linux, Java, perl, Solaris -- Consulting, Training, Development
> >
> >       4 - 8 - 15 - 16 - 23 - 42
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: 
> > velocity-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: 
> > velocity-dev-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-dev-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: eol-style

Posted by Nathan Bubna <nb...@gmail.com>.
On 10/14/05, Will Glass-Husain <wg...@forio.com> wrote:
> Hi Henning,
>
> Actually, this still doesn't work for ParserTokenManager (setting eol-style
> to native).  It appears that the line endings are inconsistent (when javacc
> is run on Windows).  Probably similar to the earlier Anakia problem (which
> we fixed).
>
> svn: File 'C:/Documents and Settings/wglass/My
> Documents/GAWE/velocity/trunk/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java'
> has inconsistent newlines
>
> The solution for me is to open and close in Textpad, which has an option for
> force PC style newlines.

nice tip.  Textpad rocks.

> WILL
>
> ----- Original Message -----
> From: "Henning P. Schmiedehausen" <hp...@intermeta.de>
> Newsgroups: hometree.jakarta.velocity.dev
> To: <ve...@jakarta.apache.org>
> Sent: Friday, October 07, 2005 2:04 AM
> Subject: Re: svn commit: r306522 - in /jakarta/velocity/core/trunk:
> src/java/org/apache/velocity/runtime/parser/ test/templates/
> test/templates/compare/
>
>
> > "Will Glass-Husain" <wg...@forio.com> writes:
> >
> >>3) If necessary, convert the line endings for ParserTokenManager.java to
> >>your native platform
> >>(other files are ok - for some reason this is always Unix).
> >
> > You shouldn't have to do this. As the eol-style is part of the
> > Subversion meta-information, it will be converted automatically, once
> > you check your changes in. Just do a "svn up" after checking in, it
> > should work.
> >
> > The Java platform itself should not care about the line endings when
> > compiling on Windows.
> >
> > Best regards
> > Henning
> >
> > --
> > Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
> > hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/
> >
> > RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for hire
> >   Linux, Java, perl, Solaris -- Consulting, Training, Development
> >
> >       4 - 8 - 15 - 16 - 23 - 42
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: velocity-dev-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-dev-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: eol-style

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
"Will Glass-Husain" <wg...@forio.com> writes:

>Hi Henning,

>Actually, this still doesn't work for ParserTokenManager (setting eol-style 
>to native).  It appears that the line endings are inconsistent (when javacc 
>is run on Windows).  Probably similar to the earlier Anakia problem (which 
>we fixed).

Hi,

(sorry, I was switching jobs lately so I didn't really listen for a while).

well, I will test. It might be possible that you have to do a "svn up" after the commit. I'll come back
to you on that issue.

	Best regards
		Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for hire
   Linux, Java, perl, Solaris -- Consulting, Training, Development

		      4 - 8 - 15 - 16 - 23 - 42

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: eol-style

Posted by Will Glass-Husain <wg...@forio.com>.
Hi Henning,

Actually, this still doesn't work for ParserTokenManager (setting eol-style 
to native).  It appears that the line endings are inconsistent (when javacc 
is run on Windows).  Probably similar to the earlier Anakia problem (which 
we fixed).

svn: File 'C:/Documents and Settings/wglass/My 
Documents/GAWE/velocity/trunk/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java' 
has inconsistent newlines

The solution for me is to open and close in Textpad, which has an option for 
force PC style newlines.

WILL

----- Original Message ----- 
From: "Henning P. Schmiedehausen" <hp...@intermeta.de>
Newsgroups: hometree.jakarta.velocity.dev
To: <ve...@jakarta.apache.org>
Sent: Friday, October 07, 2005 2:04 AM
Subject: Re: svn commit: r306522 - in /jakarta/velocity/core/trunk: 
src/java/org/apache/velocity/runtime/parser/ test/templates/ 
test/templates/compare/


> "Will Glass-Husain" <wg...@forio.com> writes:
>
>>3) If necessary, convert the line endings for ParserTokenManager.java to
>>your native platform
>>(other files are ok - for some reason this is always Unix).
>
> You shouldn't have to do this. As the eol-style is part of the
> Subversion meta-information, it will be converted automatically, once
> you check your changes in. Just do a "svn up" after checking in, it
> should work.
>
> The Java platform itself should not care about the line endings when
> compiling on Windows.
>
> Best regards
> Henning
>
> -- 
> Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
> hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/
>
> RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for hire
>   Linux, Java, perl, Solaris -- Consulting, Training, Development
>
>       4 - 8 - 15 - 16 - 23 - 42
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-dev-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: svn commit: r306522 - in /jakarta/velocity/core/trunk: src/java/org/apache/velocity/runtime/parser/ test/templates/ test/templates/compare/

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
"Will Glass-Husain" <wg...@forio.com> writes:

>3) If necessary, convert the line endings for ParserTokenManager.java to 
>your native platform
>(other files are ok - for some reason this is always Unix).

You shouldn't have to do this. As the eol-style is part of the
Subversion meta-information, it will be converted automatically, once
you check your changes in. Just do a "svn up" after checking in, it
should work.

The Java platform itself should not care about the line endings when
compiling on Windows.

	Best regards
		Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for hire
   Linux, Java, perl, Solaris -- Consulting, Training, Development

		      4 - 8 - 15 - 16 - 23 - 42

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: svn commit: r306522 - in /jakarta/velocity/core/trunk: src/java/org/apache/velocity/runtime/parser/ test/templates/ test/templates/compare/

Posted by Will Glass-Husain <wg...@forio.com>.
Hi Nathan,

Good catch.

You probably knew this but here's how to edit this code.

1) Edit build.xml to point to your copy of javacc.  (must be 3.2 or later).
1) Edit parser.jjt
2) Run "ant parser" -> generates 5 files.
3) If necessary, convert the line endings for ParserTokenManager.java to 
your native platform
(other files are ok - for some reason this is always Unix).
4) Compile, run ant test, and check in

Best,
WILL

----- Original Message ----- 
From: "Nathan Bubna" <nb...@gmail.com>
To: "Velocity Developers List" <ve...@jakarta.apache.org>
Sent: Thursday, October 06, 2005 9:15 AM
Subject: Re: svn commit: r306522 - in /jakarta/velocity/core/trunk: 
src/java/org/apache/velocity/runtime/parser/ test/templates/ 
test/templates/compare/


On 10/6/05, Nathan Bubna <nb...@gmail.com> wrote:
> On 10/5/05, wglass@apache.org <wg...@apache.org> wrote:
> > Author: wglass
> > Date: Wed Oct  5 21:25:59 2005
> > New Revision: 306522
> >
> > URL: http://svn.apache.org/viewcvs?rev=306522&view=rev
> > Log:
> > fixed bug with parse error when comment was last line of file. 
> > VELOCITY-272
> >
> > Added:
> >     jakarta/velocity/core/trunk/test/templates/comment-eof.vm
> >     jakarta/velocity/core/trunk/test/templates/compare/comment-eof.cmp
> > Modified:
> > 
> > jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java
> > 
> > jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jj
> > 
> > jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jjt
> > 
> > jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/ParserConstants.java
> > 
> > jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java
> >     jakarta/velocity/core/trunk/test/templates/templates.properties
> >
> > Modified: 
> > jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java
> > URL: 
> > http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java?rev=306522&r1=306521&r2=306522&view=diff
> > ==============================================================================
> > ---  
> > jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java 
> > (original)
> > +++ 
> > jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java 
> > Wed Oct  5 21:25:59 2005
> > @@ -109,12 +109,12 @@
> >               *  thrown by the Macro class when something is amiss in 
> > the
> >               *  Macro specification
> >               */
> > -            rsvc.getLog().error("Parser Error: #macro() : " + 
> > templateName, mee);
> > +            rsvc.error ("Parser Error:  #macro() : " + templateName + " 
> > : " + StringUtils.stackTrace(mee));
>
> can we not revert to using deprecated methods? :)
>

ah ha.  just noticed that Parser.java is generated.  i missed that
when speeding through my logging upgrades...  i'll see if i can figure
out how to fix this myself. :)

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: svn commit: r306522 - in /jakarta/velocity/core/trunk: src/java/org/apache/velocity/runtime/parser/ test/templates/ test/templates/compare/

Posted by Nathan Bubna <nb...@gmail.com>.
On 10/6/05, Nathan Bubna <nb...@gmail.com> wrote:
> On 10/5/05, wglass@apache.org <wg...@apache.org> wrote:
> > Author: wglass
> > Date: Wed Oct  5 21:25:59 2005
> > New Revision: 306522
> >
> > URL: http://svn.apache.org/viewcvs?rev=306522&view=rev
> > Log:
> > fixed bug with parse error when comment was last line of file.  VELOCITY-272
> >
> > Added:
> >     jakarta/velocity/core/trunk/test/templates/comment-eof.vm
> >     jakarta/velocity/core/trunk/test/templates/compare/comment-eof.cmp
> > Modified:
> >     jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java
> >     jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jj
> >     jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jjt
> >     jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/ParserConstants.java
> >     jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java
> >     jakarta/velocity/core/trunk/test/templates/templates.properties
> >
> > Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java
> > URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java?rev=306522&r1=306521&r2=306522&view=diff
> > ==============================================================================
> > --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java (original)
> > +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java Wed Oct  5 21:25:59 2005
> > @@ -109,12 +109,12 @@
> >               *  thrown by the Macro class when something is amiss in the
> >               *  Macro specification
> >               */
> > -            rsvc.getLog().error("Parser Error: #macro() : " + templateName, mee);
> > +            rsvc.error ("Parser Error:  #macro() : " + templateName + " : " + StringUtils.stackTrace(mee));
>
> can we not revert to using deprecated methods? :)
>

ah ha.  just noticed that Parser.java is generated.  i missed that
when speeding through my logging upgrades...  i'll see if i can figure
out how to fix this myself. :)

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: svn commit: r306522 - in /jakarta/velocity/core/trunk: src/java/org/apache/velocity/runtime/parser/ test/templates/ test/templates/compare/

Posted by Nathan Bubna <nb...@gmail.com>.
On 10/5/05, wglass@apache.org <wg...@apache.org> wrote:
> Author: wglass
> Date: Wed Oct  5 21:25:59 2005
> New Revision: 306522
>
> URL: http://svn.apache.org/viewcvs?rev=306522&view=rev
> Log:
> fixed bug with parse error when comment was last line of file.  VELOCITY-272
>
> Added:
>     jakarta/velocity/core/trunk/test/templates/comment-eof.vm
>     jakarta/velocity/core/trunk/test/templates/compare/comment-eof.cmp
> Modified:
>     jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java
>     jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jj
>     jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jjt
>     jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/ParserConstants.java
>     jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java
>     jakarta/velocity/core/trunk/test/templates/templates.properties
>
> Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java
> URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java?rev=306522&r1=306521&r2=306522&view=diff
> ==============================================================================
> --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java (original)
> +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java Wed Oct  5 21:25:59 2005
> @@ -109,12 +109,12 @@
>               *  thrown by the Macro class when something is amiss in the
>               *  Macro specification
>               */
> -            rsvc.getLog().error("Parser Error: #macro() : " + templateName, mee);
> +            rsvc.error ("Parser Error:  #macro() : " + templateName + " : " + StringUtils.stackTrace(mee));

can we not revert to using deprecated methods? :)

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org