velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wgl...@apache.org
Subject svn commit: r547528 - in /velocity/engine/trunk: src/java/org/apache/velocity/runtime/parser/ src/parser/ test/templates/ test/templates/compare/
Date Fri, 15 Jun 2007 05:11:06 GMT
Author: wglass
Date: Thu Jun 14 22:11:04 2007
New Revision: 547528

URL: http://svn.apache.org/viewvc?view=rev&rev=547528
Log:
allow map to end even when last item is a reference.  Fixes VELOCITY-538.

Modified:
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jj
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParserTreeConstants.java
    velocity/engine/trunk/src/parser/Parser.jjt
    velocity/engine/trunk/test/templates/compare/map.cmp
    velocity/engine/trunk/test/templates/map.vm

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?view=diff&rev=547528&r1=547527&r2=547528
==============================================================================
--- 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 Thu Jun
14 22:11:04 2007
@@ -924,7 +924,18 @@
           ;
         }
       }
-      jj_consume_token(RIGHT_CURLEY);
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case RIGHT_CURLEY:
+        jj_consume_token(RIGHT_CURLEY);
+        break;
+      case RCURLY:
+        jj_consume_token(RCURLY);
+        break;
+      default:
+        jj_la1[16] = jj_gen;
+        jj_consume_token(-1);
+        throw new ParseException();
+      }
     } catch (Throwable jjte000) {
       if (jjtc000) {
         jjtree.clearNodeScope(jjtn000);
@@ -972,7 +983,7 @@
             ;
             break;
           default:
-            jj_la1[16] = jj_gen;
+            jj_la1[17] = jj_gen;
             break label_6;
           }
           jj_consume_token(COMMA);
@@ -980,7 +991,7 @@
         }
         break;
       default:
-        jj_la1[17] = jj_gen;
+        jj_la1[18] = jj_gen;
         ;
       }
       jj_consume_token(RBRACKET);
@@ -1022,7 +1033,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) {
@@ -1034,7 +1045,7 @@
         IntegerLiteral();
         break;
       default:
-        jj_la1[19] = jj_gen;
+        jj_la1[20] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
       }
@@ -1043,7 +1054,7 @@
         jj_consume_token(WHITESPACE);
         break;
       default:
-        jj_la1[20] = jj_gen;
+        jj_la1[21] = jj_gen;
         ;
       }
       jj_consume_token(DOUBLEDOT);
@@ -1052,7 +1063,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) {
@@ -1064,7 +1075,7 @@
         IntegerLiteral();
         break;
       default:
-        jj_la1[22] = jj_gen;
+        jj_la1[23] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
       }
@@ -1073,7 +1084,7 @@
         jj_consume_token(WHITESPACE);
         break;
       default:
-        jj_la1[23] = jj_gen;
+        jj_la1[24] = jj_gen;
         ;
       }
       jj_consume_token(RBRACKET);
@@ -1109,7 +1120,7 @@
       jj_consume_token(WHITESPACE);
       break;
     default:
-      jj_la1[24] = jj_gen;
+      jj_la1[25] = jj_gen;
       ;
     }
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
@@ -1120,7 +1131,7 @@
       IntegerLiteral();
       break;
     default:
-      jj_la1[25] = jj_gen;
+      jj_la1[26] = jj_gen;
       if (jj_2_6(2147483647)) {
         IntegerRange();
       } else {
@@ -1145,7 +1156,7 @@
           FloatingPointLiteral();
           break;
         default:
-          jj_la1[26] = jj_gen;
+          jj_la1[27] = jj_gen;
           jj_consume_token(-1);
           throw new ParseException();
         }
@@ -1156,7 +1167,7 @@
       jj_consume_token(WHITESPACE);
       break;
     default:
-      jj_la1[27] = jj_gen;
+      jj_la1[28] = jj_gen;
       ;
     }
   }
@@ -1193,7 +1204,7 @@
             ;
             break;
           default:
-            jj_la1[28] = jj_gen;
+            jj_la1[29] = jj_gen;
             break label_7;
           }
           jj_consume_token(COMMA);
@@ -1201,7 +1212,7 @@
         }
         break;
       default:
-        jj_la1[29] = jj_gen;
+        jj_la1[30] = jj_gen;
         ;
       }
       jj_consume_token(REFMOD2_RPAREN);
@@ -1251,7 +1262,7 @@
               Identifier();
               break;
             default:
-              jj_la1[30] = jj_gen;
+              jj_la1[31] = jj_gen;
               jj_consume_token(-1);
               throw new ParseException();
             }
@@ -1277,7 +1288,7 @@
               Identifier();
               break;
             default:
-              jj_la1[31] = jj_gen;
+              jj_la1[32] = jj_gen;
               jj_consume_token(-1);
               throw new ParseException();
             }
@@ -1286,7 +1297,7 @@
         jj_consume_token(RCURLY);
         break;
       default:
-        jj_la1[32] = jj_gen;
+        jj_la1[33] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
       }
@@ -1382,7 +1393,7 @@
         jj_consume_token(RCURLY);
         break;
       default:
-        jj_la1[33] = jj_gen;
+        jj_la1[34] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
       }
@@ -1410,7 +1421,7 @@
         jj_consume_token(WHITESPACE);
         break;
       default:
-        jj_la1[34] = jj_gen;
+        jj_la1[35] = jj_gen;
         ;
       }
       jj_consume_token(LPAREN);
@@ -1447,7 +1458,7 @@
             ;
             break;
           default:
-            jj_la1[35] = jj_gen;
+            jj_la1[36] = jj_gen;
             break label_10;
           }
           Statement();
@@ -1481,13 +1492,13 @@
             ;
             break;
           default:
-            jj_la1[36] = jj_gen;
+            jj_la1[37] = jj_gen;
             break label_11;
           }
         }
         break;
       default:
-        jj_la1[37] = jj_gen;
+        jj_la1[38] = jj_gen;
         ;
       }
       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
@@ -1495,7 +1506,7 @@
         ElseStatement();
         break;
       default:
-        jj_la1[38] = jj_gen;
+        jj_la1[39] = jj_gen;
         ;
       }
       jj_consume_token(END);
@@ -1558,7 +1569,7 @@
             ;
             break;
           default:
-            jj_la1[39] = jj_gen;
+            jj_la1[40] = jj_gen;
             break label_12;
           }
           Statement();
@@ -1615,7 +1626,7 @@
         jj_consume_token(WHITESPACE);
         break;
       default:
-        jj_la1[40] = jj_gen;
+        jj_la1[41] = jj_gen;
         ;
       }
       jj_consume_token(LPAREN);
@@ -1652,7 +1663,7 @@
             ;
             break;
           default:
-            jj_la1[41] = jj_gen;
+            jj_la1[42] = jj_gen;
             break label_13;
           }
           Statement();
@@ -1714,7 +1725,7 @@
         jj_consume_token(WHITESPACE);
         break;
       default:
-        jj_la1[42] = jj_gen;
+        jj_la1[43] = jj_gen;
         ;
       }
       Reference();
@@ -1723,7 +1734,7 @@
         jj_consume_token(WHITESPACE);
         break;
       default:
-        jj_la1[43] = jj_gen;
+        jj_la1[44] = jj_gen;
         ;
       }
       jj_consume_token(EQUALS);
@@ -1739,7 +1750,7 @@
         jj_consume_token(NEWLINE);
         break;
       default:
-        jj_la1[44] = jj_gen;
+        jj_la1[45] = jj_gen;
         ;
       }
     } catch (Throwable jjte000) {
@@ -1856,7 +1867,7 @@
         ;
         break;
       default:
-        jj_la1[45] = jj_gen;
+        jj_la1[46] = jj_gen;
         break label_14;
       }
       jj_consume_token(LOGICAL_OR);
@@ -1896,7 +1907,7 @@
         ;
         break;
       default:
-        jj_la1[46] = jj_gen;
+        jj_la1[47] = jj_gen;
         break label_15;
       }
       jj_consume_token(LOGICAL_AND);
@@ -1937,7 +1948,7 @@
         ;
         break;
       default:
-        jj_la1[47] = jj_gen;
+        jj_la1[48] = jj_gen;
         break label_16;
       }
       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
@@ -1996,7 +2007,7 @@
         }
         break;
       default:
-        jj_la1[48] = jj_gen;
+        jj_la1[49] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
       }
@@ -2015,7 +2026,7 @@
         ;
         break;
       default:
-        jj_la1[49] = jj_gen;
+        jj_la1[50] = jj_gen;
         break label_17;
       }
       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
@@ -2128,7 +2139,7 @@
         }
         break;
       default:
-        jj_la1[50] = jj_gen;
+        jj_la1[51] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
       }
@@ -2145,7 +2156,7 @@
         ;
         break;
       default:
-        jj_la1[51] = jj_gen;
+        jj_la1[52] = jj_gen;
         break label_18;
       }
       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
@@ -2204,7 +2215,7 @@
         }
         break;
       default:
-        jj_la1[52] = jj_gen;
+        jj_la1[53] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
       }
@@ -2222,7 +2233,7 @@
         ;
         break;
       default:
-        jj_la1[53] = jj_gen;
+        jj_la1[54] = jj_gen;
         break label_19;
       }
       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
@@ -2308,7 +2319,7 @@
         }
         break;
       default:
-        jj_la1[54] = jj_gen;
+        jj_la1[55] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
       }
@@ -2322,7 +2333,7 @@
         jj_consume_token(WHITESPACE);
         break;
       default:
-        jj_la1[55] = jj_gen;
+        jj_la1[56] = jj_gen;
         ;
       }
       jj_consume_token(LOGICAL_NOT);
@@ -2366,7 +2377,7 @@
         PrimaryExpression();
         break;
       default:
-        jj_la1[56] = jj_gen;
+        jj_la1[57] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
       }
@@ -2379,7 +2390,7 @@
       jj_consume_token(WHITESPACE);
       break;
     default:
-      jj_la1[57] = jj_gen;
+      jj_la1[58] = jj_gen;
       ;
     }
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
@@ -2394,7 +2405,7 @@
       IntegerLiteral();
       break;
     default:
-      jj_la1[58] = jj_gen;
+      jj_la1[59] = jj_gen;
       if (jj_2_12(2147483647)) {
         IntegerRange();
       } else {
@@ -2420,7 +2431,7 @@
           jj_consume_token(RPAREN);
           break;
         default:
-          jj_la1[59] = jj_gen;
+          jj_la1[60] = jj_gen;
           jj_consume_token(-1);
           throw new ParseException();
         }
@@ -2431,7 +2442,7 @@
       jj_consume_token(WHITESPACE);
       break;
     default:
-      jj_la1[60] = jj_gen;
+      jj_la1[61] = jj_gen;
       ;
     }
   }
@@ -2578,11 +2589,6 @@
     return false;
   }
 
-  final private boolean jj_3_2() {
-    if (jj_scan_token(DOUBLE_ESCAPE)) return true;
-    return false;
-  }
-
   final private boolean jj_3R_35() {
     if (jj_scan_token(LCURLY)) return true;
     if (jj_scan_token(IDENTIFIER)) return true;
@@ -2611,6 +2617,11 @@
     return false;
   }
 
+  final private boolean jj_3_2() {
+    if (jj_scan_token(DOUBLE_ESCAPE)) return true;
+    return false;
+  }
+
   final private boolean jj_3R_34() {
     if (jj_scan_token(IDENTIFIER)) return true;
     Token xsp;
@@ -2758,14 +2769,6 @@
     return false;
   }
 
-  final private boolean jj_3R_85() {
-    if (jj_scan_token(COMMA)) return true;
-    if (jj_3R_25()) return true;
-    if (jj_scan_token(COLON)) return true;
-    if (jj_3R_25()) return true;
-    return false;
-  }
-
   final private boolean jj_3R_52() {
     if (jj_3R_65()) return true;
     return false;
@@ -2800,6 +2803,14 @@
     return false;
   }
 
+  final private boolean jj_3R_85() {
+    if (jj_scan_token(COMMA)) return true;
+    if (jj_3R_25()) return true;
+    if (jj_scan_token(COLON)) return true;
+    if (jj_3R_25()) return true;
+    return false;
+  }
+
   final private boolean jj_3R_50() {
     if (jj_3R_63()) return true;
     return false;
@@ -2820,12 +2831,12 @@
     return false;
   }
 
-  final private boolean jj_3R_22() {
+  final private boolean jj_3R_84() {
     if (jj_3R_36()) return true;
     return false;
   }
 
-  final private boolean jj_3R_84() {
+  final private boolean jj_3R_22() {
     if (jj_3R_36()) return true;
     return false;
   }
@@ -2876,17 +2887,17 @@
     return false;
   }
 
-  final private boolean jj_3_1() {
+  final private boolean jj_3R_83() {
     if (jj_3R_20()) return true;
     return false;
   }
 
-  final private boolean jj_3R_21() {
+  final private boolean jj_3_1() {
     if (jj_3R_20()) return true;
     return false;
   }
 
-  final private boolean jj_3R_83() {
+  final private boolean jj_3R_21() {
     if (jj_3R_20()) return true;
     return false;
   }
@@ -2978,7 +2989,11 @@
     jj_scanpos = xsp;
     if (jj_3R_70()) return true;
     }
-    if (jj_scan_token(RIGHT_CURLEY)) return true;
+    xsp = jj_scanpos;
+    if (jj_scan_token(7)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(65)) return true;
+    }
     return false;
   }
 
@@ -3120,13 +3135,13 @@
     return false;
   }
 
-  final private boolean jj_3R_62() {
-    if (jj_scan_token(FLOATING_POINT_LITERAL)) return true;
+  final private boolean jj_3R_33() {
+    if (jj_3R_36()) return true;
     return false;
   }
 
-  final private boolean jj_3R_33() {
-    if (jj_3R_36()) return true;
+  final private boolean jj_3R_62() {
+    if (jj_scan_token(FLOATING_POINT_LITERAL)) return true;
     return false;
   }
 
@@ -3153,7 +3168,7 @@
   public boolean lookingAhead = false;
   private boolean jj_semLA;
   private int jj_gen;
-  final private int[] jj_la1 = new int[61];
+  final private int[] jj_la1 = new int[62];
   static private int[] jj_la1_0;
   static private int[] jj_la1_1;
   static private int[] jj_la1_2;
@@ -3163,13 +3178,13 @@
       jj_la1_2();
    }
    private static void jj_la1_0() {
-      jj_la1_0 = new int[] {0x9bc1b00,0x0,0x9bc1b00,0x400000,0x1840000,0x8000000,0x30000042,0x0,0x4000000,0x4000000,0x4000000,0x8,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,};
+      jj_la1_0 = new int[] {0x9bc1b00,0x0,0x9bc1b00,0x400000,0x1840000,0x8000000,0x30000042,0x0,0x4000000,0x4000000,0x4000000,0x8,0x4000000,0x9bc1b00,0x8,0x4000000,0x80,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,0x0,0x42100000,0x200000,0x6000000,0x0,0x0,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,0x0,0x0,0xc6348000,0x0,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,0x0,0x1,0x0,0x0,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,0x0,0x0,0x3,0x0,0x0,0x2,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;
@@ -3180,7 +3195,7 @@
     token = new Token();
     jj_ntk = -1;
     jj_gen = 0;
-    for (int i = 0; i < 61; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 62; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
   }
 
@@ -3190,7 +3205,7 @@
     jj_ntk = -1;
     jjtree.reset();
     jj_gen = 0;
-    for (int i = 0; i < 61; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 62; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
   }
 
@@ -3199,7 +3214,7 @@
     token = new Token();
     jj_ntk = -1;
     jj_gen = 0;
-    for (int i = 0; i < 61; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 62; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
   }
 
@@ -3209,7 +3224,7 @@
     jj_ntk = -1;
     jjtree.reset();
     jj_gen = 0;
-    for (int i = 0; i < 61; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 62; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
   }
 
@@ -3328,7 +3343,7 @@
       la1tokens[jj_kind] = true;
       jj_kind = -1;
     }
-    for (int i = 0; i < 61; i++) {
+    for (int i = 0; i < 62; i++) {
       if (jj_la1[i] == jj_gen) {
         for (int j = 0; j < 32; j++) {
           if ((jj_la1_0[i] & (1<<j)) != 0) {

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jj
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jj?view=diff&rev=547528&r1=547527&r2=547528
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jj (original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jj Thu Jun 14
22:11:04 2007
@@ -1630,7 +1630,9 @@
       |
       [ <WHITESPACE> ]
      )
-     <RIGHT_CURLEY>/*@bgen(jjtree)*/
+     
+     /** note: need both tokens as they are generated in different states **/
+     ( <RIGHT_CURLEY> | <RCURLY> )/*@bgen(jjtree)*/
     } catch (Throwable jjte000) {
       if (jjtc000) {
         jjtree.clearNodeScope(jjtn000);

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?view=diff&rev=547528&r1=547527&r2=547528
==============================================================================
--- 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
Thu Jun 14 22:11:04 2007
@@ -1,4 +1,4 @@
-/* Generated By:JJTree: Do not edit this line. C:/java/apache/velocity/head/src/java/org/apache/velocity/runtime/parser\ParserTreeConstants.java
*/
+/* Generated By:JJTree: Do not edit this line. C:/Documents and Settings/wglass/My Documents/Workspace/misc/velocity/trunk/src/java/org/apache/velocity/runtime/parser\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?view=diff&rev=547528&r1=547527&r2=547528
==============================================================================
--- velocity/engine/trunk/src/parser/Parser.jjt (original)
+++ velocity/engine/trunk/src/parser/Parser.jjt Thu Jun 14 22:11:04 2007
@@ -1450,7 +1450,9 @@
       |
       [ <WHITESPACE> ]
      )
-     <RIGHT_CURLEY>
+     
+     /** note: need both tokens as they are generated in different states **/
+     ( <RIGHT_CURLEY> | <RCURLY> )
 }
 
 void ObjectArray() : {}

Modified: velocity/engine/trunk/test/templates/compare/map.cmp
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/test/templates/compare/map.cmp?view=diff&rev=547528&r1=547527&r2=547528
==============================================================================
--- velocity/engine/trunk/test/templates/compare/map.cmp (original)
+++ velocity/engine/trunk/test/templates/compare/map.cmp Thu Jun 14 22:11:04 2007
@@ -27,3 +27,10 @@
 0
 
 0
+
+
+aa
+bb
+bb
+aa
+aa

Modified: velocity/engine/trunk/test/templates/map.vm
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/test/templates/map.vm?view=diff&rev=547528&r1=547527&r2=547528
==============================================================================
--- velocity/engine/trunk/test/templates/map.vm (original)
+++ velocity/engine/trunk/test/templates/map.vm Thu Jun 14 22:11:04 2007
@@ -52,3 +52,17 @@
 
 #set($emptymap = { })
 $emptymap.size()
+
+##
+##  test for values given with reference
+##
+
+#set($object = "aa")
+#set($mapz = {"a" : $object, "b" : "bb" })
+#set($mapx = {"a" : "bb", "b" : $object })
+#set($mapy = {"key": $object})
+$mapz.a
+$mapz.b
+$mapx.a
+$mapx.b
+$mapy.key



Mime
View raw message