velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From by...@apache.org
Subject svn commit: r735709 - in /velocity/engine/trunk/src: java/org/apache/velocity/runtime/directive/ java/org/apache/velocity/runtime/parser/ parser/
Date Mon, 19 Jan 2009 14:30:03 GMT
Author: byron
Date: Mon Jan 19 06:30:03 2009
New Revision: 735709

URL: http://svn.apache.org/viewvc?rev=735709&view=rev
Log:
VELOCITY-667 fix so that #macro without parenthesis throws an exception

Modified:
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/MacroParseException.java
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParserTreeConstants.java
    velocity/engine/trunk/src/parser/Parser.jjt

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/MacroParseException.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/MacroParseException.java?rev=735709&r1=735708&r2=735709&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/MacroParseException.java
(original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/MacroParseException.java
Mon Jan 19 06:30:03 2009
@@ -77,6 +77,10 @@
         {
             return currentToken.next.beginLine;
         }
+        else if (currentToken != null)
+        {
+            return currentToken.beginLine;
+        }
         else
         {
             return -1;
@@ -94,6 +98,10 @@
         {
             return currentToken.next.beginColumn;
         }
+        else if (currentToken != null)
+        {
+            return currentToken.beginColumn;
+        }
         else
         {
             return -1;

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java?rev=735709&r1=735708&r2=735709&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java (original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java Mon Jan
19 06:30:03 2009
@@ -864,6 +864,14 @@
             {if (true) return jjtn000;}
         }
       } else {
+        if (doItNow)  // doItNow is true if the directive is "macro"
+        {
+            // VELOCITY-667 We get here if we have a "#macro" construct
+            // without parenthesis which is a parse error
+            {if (true) throw new MacroParseException("A macro declaration requires at least
a name argument"
+              , currentTemplateName, t);}
+        }
+
         /**
          * Not a directive
          */
@@ -2755,23 +2763,13 @@
     return false;
   }
 
-  final private boolean jj_3R_60() {
-    if (jj_scan_token(IDENTIFIER)) return true;
-    return false;
-  }
-
   final private boolean jj_3_10() {
     if (jj_3R_33()) return true;
     return false;
   }
 
-  final private boolean jj_3_4() {
-    Token xsp;
-    xsp = jj_scanpos;
-    if (jj_scan_token(31)) jj_scanpos = xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_27()) jj_scanpos = xsp;
-    if (jj_3R_28()) return true;
+  final private boolean jj_3R_60() {
+    if (jj_scan_token(IDENTIFIER)) return true;
     return false;
   }
 
@@ -2790,8 +2788,13 @@
     return false;
   }
 
-  final private boolean jj_3R_65() {
-    if (jj_scan_token(STRING_LITERAL)) return true;
+  final private boolean jj_3_4() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_scan_token(31)) jj_scanpos = xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_27()) jj_scanpos = xsp;
+    if (jj_3R_28()) return true;
     return false;
   }
 
@@ -2822,11 +2825,6 @@
     return false;
   }
 
-  final private boolean jj_3R_40() {
-    if (jj_scan_token(INTEGER_LITERAL)) return true;
-    return false;
-  }
-
   final private boolean jj_3R_63() {
     if (jj_3R_73()) return true;
     return false;
@@ -2847,6 +2845,11 @@
     return false;
   }
 
+  final private boolean jj_3R_65() {
+    if (jj_scan_token(STRING_LITERAL)) return true;
+    return false;
+  }
+
   final private boolean jj_3R_70() {
     if (jj_scan_token(TRUE)) return true;
     return false;
@@ -2877,11 +2880,6 @@
     return false;
   }
 
-  final private boolean jj_3R_67() {
-    if (jj_scan_token(FLOATING_POINT_LITERAL)) return true;
-    return false;
-  }
-
   final private boolean jj_3R_84() {
     if (jj_3R_68()) return true;
     return false;
@@ -2892,6 +2890,11 @@
     return false;
   }
 
+  final private boolean jj_3R_40() {
+    if (jj_scan_token(INTEGER_LITERAL)) return true;
+    return false;
+  }
+
   final private boolean jj_3R_82() {
     if (jj_3R_66()) return true;
     return false;
@@ -2953,6 +2956,11 @@
     return false;
   }
 
+  final private boolean jj_3R_67() {
+    if (jj_scan_token(FLOATING_POINT_LITERAL)) return true;
+    return false;
+  }
+
   final private boolean jj_3R_72() {
     Token xsp;
     xsp = jj_scanpos;
@@ -3115,11 +3123,6 @@
     return false;
   }
 
-  final private boolean jj_3_2() {
-    if (jj_scan_token(DOUBLE_ESCAPE)) return true;
-    return false;
-  }
-
   final private boolean jj_3R_29() {
     Token xsp;
     xsp = jj_scanpos;
@@ -3173,6 +3176,11 @@
     return false;
   }
 
+  final private boolean jj_3_2() {
+    if (jj_scan_token(DOUBLE_ESCAPE)) return true;
+    return false;
+  }
+
   final private boolean jj_3R_94() {
     if (jj_3R_70()) return true;
     return false;
@@ -3232,11 +3240,6 @@
     return false;
   }
 
-  final private boolean jj_3R_26() {
-    if (jj_3R_40()) return true;
-    return false;
-  }
-
   final private boolean jj_3R_75() {
     if (jj_3R_24()) return true;
     return false;
@@ -3278,8 +3281,8 @@
     return false;
   }
 
-  final private boolean jj_3R_25() {
-    if (jj_3R_24()) return true;
+  final private boolean jj_3R_26() {
+    if (jj_3R_40()) return true;
     return false;
   }
 
@@ -3292,7 +3295,7 @@
     return false;
   }
 
-  final private boolean jj_3_1() {
+  final private boolean jj_3R_25() {
     if (jj_3R_24()) return true;
     return false;
   }
@@ -3316,6 +3319,11 @@
     return false;
   }
 
+  final private boolean jj_3_1() {
+    if (jj_3R_24()) return true;
+    return false;
+  }
+
   final private boolean jj_3R_68() {
     if (jj_scan_token(LEFT_CURLEY)) return true;
     Token xsp;
@@ -3363,18 +3371,28 @@
     return false;
   }
 
+  final private boolean jj_3R_90() {
+    if (jj_3R_73()) return true;
+    return false;
+  }
+
   final private boolean jj_3R_47() {
     if (jj_3R_68()) return true;
     return false;
   }
 
+  final private boolean jj_3R_89() {
+    if (jj_3R_73()) return true;
+    return false;
+  }
+
   final private boolean jj_3R_46() {
     if (jj_3R_67()) return true;
     return false;
   }
 
-  final private boolean jj_3R_90() {
-    if (jj_3R_73()) return true;
+  final private boolean jj_3R_37() {
+    if (jj_3R_40()) return true;
     return false;
   }
 
@@ -3383,13 +3401,8 @@
     return false;
   }
 
-  final private boolean jj_3R_89() {
-    if (jj_3R_73()) return true;
-    return false;
-  }
-
-  final private boolean jj_3R_37() {
-    if (jj_3R_40()) return true;
+  final private boolean jj_3R_34() {
+    if (jj_3R_60()) return true;
     return false;
   }
 
@@ -3406,12 +3419,17 @@
     return false;
   }
 
+  final private boolean jj_3R_36() {
+    if (jj_3R_24()) return true;
+    return false;
+  }
+
   final private boolean jj_3R_43() {
     if (jj_3R_65()) return true;
     return false;
   }
 
-  final private boolean jj_3R_34() {
+  final private boolean jj_3R_32() {
     if (jj_3R_60()) return true;
     return false;
   }
@@ -3421,11 +3439,6 @@
     return false;
   }
 
-  final private boolean jj_3R_36() {
-    if (jj_3R_24()) return true;
-    return false;
-  }
-
   final private boolean jj_3R_41() {
     if (jj_3R_24()) return true;
     return false;
@@ -3465,11 +3478,6 @@
     return false;
   }
 
-  final private boolean jj_3R_32() {
-    if (jj_3R_60()) return true;
-    return false;
-  }
-
   public ParserTokenManager token_source;
   public Token token, jj_nt;
   private int jj_ntk;

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java?rev=735709&r1=735708&r2=735709&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java
(original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java
Mon Jan 19 06:30:03 2009
@@ -5225,7 +5225,7 @@
 protected CharStream input_stream;
 private final int[] jjrounds = new int[101];
 private final int[] jjstateSet = new int[202];
-StrBuilder image;
+StringBuffer image;
 int jjimageLen;
 int lengthOfMatch;
 protected char curChar;
@@ -5480,7 +5480,7 @@
    {
       case 71 :
          if (image == null)
-            image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
+            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
          else
             image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos
+ 1)));
         /*
@@ -5498,7 +5498,7 @@
          break;
       case 72 :
          if (image == null)
-            image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
+            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
          else
             image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos
+ 1)));
         if ( debugPrint )
@@ -5519,7 +5519,7 @@
    {
       case 15 :
          if (image == null)
-              image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen)));
+              image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen)));
          else
             image.append(input_stream.GetSuffix(jjimageLen));
          jjimageLen = 0;
@@ -5547,7 +5547,7 @@
          break;
       case 16 :
          if (image == null)
-              image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen)));
+              image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen)));
          else
             image.append(input_stream.GetSuffix(jjimageLen));
          jjimageLen = 0;
@@ -5575,7 +5575,7 @@
          break;
       case 17 :
          if (image == null)
-              image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen)));
+              image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen)));
          else
             image.append(input_stream.GetSuffix(jjimageLen));
          jjimageLen = 0;
@@ -5588,7 +5588,7 @@
          break;
       case 18 :
          if (image == null)
-              image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen)));
+              image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen)));
          else
             image.append(input_stream.GetSuffix(jjimageLen));
          jjimageLen = 0;
@@ -5602,7 +5602,7 @@
          break;
       case 19 :
          if (image == null)
-              image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen)));
+              image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen)));
          else
             image.append(input_stream.GetSuffix(jjimageLen));
          jjimageLen = 0;
@@ -5615,7 +5615,7 @@
          break;
       case 20 :
          if (image == null)
-              image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen)));
+              image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen)));
          else
             image.append(input_stream.GetSuffix(jjimageLen));
          jjimageLen = 0;
@@ -5653,7 +5653,7 @@
    {
       case 1 :
         if (image == null)
-            image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
+            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
          else
             image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos
+ 1)));
      stateStackPush();
@@ -5661,14 +5661,14 @@
          break;
       case 2 :
         if (image == null)
-            image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
+            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
          else
             image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos
+ 1)));
      stateStackPop();
          break;
       case 10 :
         if (image == null)
-            image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
+            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
          else
             image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos
+ 1)));
         if (!inComment)
@@ -5684,14 +5684,14 @@
          break;
       case 11 :
         if (image == null)
-            image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
+            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
          else
             image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos
+ 1)));
        RPARENHandler();
          break;
       case 12 :
         if (image == null)
-            image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
+            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
          else
             image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos
+ 1)));
         /*
@@ -5704,7 +5704,7 @@
          break;
       case 14 :
         if (image == null)
-            image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
+            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
          else
             image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos
+ 1)));
         if (! inComment)
@@ -5738,7 +5738,7 @@
          break;
       case 21 :
         if (image == null)
-            image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
+            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
          else
             image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos
+ 1)));
         if (!inComment)
@@ -5756,7 +5756,7 @@
          break;
       case 25 :
         if (image == null)
-            image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
+            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
          else
             image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos
+ 1)));
      inComment = false;
@@ -5764,7 +5764,7 @@
          break;
       case 26 :
         if (image == null)
-            image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
+            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
          else
             image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos
+ 1)));
     inComment = false;
@@ -5772,7 +5772,7 @@
          break;
       case 27 :
         if (image == null)
-            image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
+            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
          else
             image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos
+ 1)));
     inComment = false;
@@ -5780,7 +5780,7 @@
          break;
       case 28 :
         if (image == null)
-            image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
+            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
          else
             image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos
+ 1)));
     inComment = false;
@@ -5788,7 +5788,7 @@
          break;
       case 32 :
         if (image == null)
-            image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
+            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
          else
             image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos
+ 1)));
         /*
@@ -5802,7 +5802,7 @@
          break;
       case 35 :
         if (image == null)
-            image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
+            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
          else
             image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos
+ 1)));
         if ( debugPrint )
@@ -5818,7 +5818,7 @@
          break;
       case 51 :
         if (image == null)
-            image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
+            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
          else
             image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos
+ 1)));
         inDirective = false;
@@ -5826,21 +5826,21 @@
          break;
       case 52 :
         if (image == null)
-            image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
+            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
          else
             image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos
+ 1)));
         SwitchTo(DIRECTIVE);
          break;
       case 53 :
         if (image == null)
-            image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
+            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
          else
             image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos
+ 1)));
         SwitchTo(DIRECTIVE);
          break;
       case 54 :
         if (image == null)
-            image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
+            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
          else
             image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos
+ 1)));
         inDirective = false;
@@ -5848,7 +5848,7 @@
          break;
       case 55 :
         if (image == null)
-            image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
+            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
          else
             image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos
+ 1)));
         inDirective = false;
@@ -5856,7 +5856,7 @@
          break;
       case 57 :
         if (image == null)
-            image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
+            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
          else
             image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos
+ 1)));
         /*
@@ -5880,7 +5880,7 @@
          break;
       case 58 :
         if (image == null)
-            image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
+            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
          else
             image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos
+ 1)));
         /*
@@ -5896,7 +5896,7 @@
          break;
       case 68 :
         if (image == null)
-            image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
+            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
          else
             image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos
+ 1)));
         /*
@@ -5919,7 +5919,7 @@
          break;
       case 70 :
         if (image == null)
-            image = new StrBuilder(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
+            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch
= jjmatchedPos + 1))));
          else
             image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos
+ 1)));
         stateStackPop();

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParserTreeConstants.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParserTreeConstants.java?rev=735709&r1=735708&r2=735709&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParserTreeConstants.java
(original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParserTreeConstants.java
Mon Jan 19 06:30:03 2009
@@ -1,4 +1,4 @@
-/* Generated By:JJTree: Do not edit this line. /Users/bfoster/open/velocity/src/java/org/apache/velocity/runtime/parser/ParserTreeConstants.java
*/
+/* Generated By:JJTree: Do not edit this line. ParserTreeConstants.java */
 
 package org.apache.velocity.runtime.parser;
 

Modified: velocity/engine/trunk/src/parser/Parser.jjt
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/parser/Parser.jjt?rev=735709&r1=735708&r2=735709&view=diff
==============================================================================
--- velocity/engine/trunk/src/parser/Parser.jjt (original)
+++ velocity/engine/trunk/src/parser/Parser.jjt Mon Jan 19 06:30:03 2009
@@ -1552,6 +1552,14 @@
     }
     |
     {
+	if (doItNow)  // doItNow is true if the directive is "macro"
+	{
+            // VELOCITY-667 We get here if we have a "#macro" construct
+	    // without parenthesis which is a parse error
+            throw new MacroParseException("A macro declaration requires at least a name argument"
+              , currentTemplateName, t);
+	}
+	
         /**
          * Not a directive
          */



Mime
View raw message