geirm 00/11/04 19:18:24
Modified: src/java/org/apache/velocity/runtime/parser/node
ASTText.java NodeUtils.java
Log:
For my REF_TERM fix. NodeUtils : removed the \n special case (that I put in there
last week...)
ASTText : reflecting changes to Parser.jjt, the specialToken() is needed only for
'$' and only until I find a
way to change that.
Revision Changes Path
1.3 +12 -2
jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTText.java
Index: ASTText.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTText.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ASTText.java 2000/10/21 01:36:49 1.2
+++ ASTText.java 2000/11/05 03:18:24 1.3
@@ -30,8 +30,18 @@
public Object init(Context context, Object data) throws Exception
{
- text = NodeUtils.specialText(getFirstToken()) +
- getFirstToken().image;
+ // text = NodeUtils.specialText(getFirstToken()) +
+ // getFirstToken().image;
+
+ /*
+ * there is only one special case we care about now : if the specialToken
leads with a $
+ * Everything else seems to be working right now
+ */
+
+ text = getFirstToken().image;
+
+ if (NodeUtils.specialText(getFirstToken()).startsWith("$") )
+ text = "$" + text;
return data;
}
1.3 +2 -6
jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/NodeUtils.java
Index: NodeUtils.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/NodeUtils.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- NodeUtils.java 2000/10/31 15:58:02 1.2
+++ NodeUtils.java 2000/11/05 03:18:24 1.3
@@ -57,7 +57,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
- * @version $Id: NodeUtils.java,v 1.2 2000/10/31 15:58:02 geirm Exp $
+ * @version $Id: NodeUtils.java,v 1.3 2000/11/05 03:18:24 geirm Exp $
*/
package org.apache.velocity.runtime.parser.node;
@@ -70,11 +70,7 @@
{
String specialText = "";
- /*
- * adding \n as an exception also, because of the push-back we do for refs
et al
- */
-
- if (t.specialToken == null || t.specialToken.image.startsWith("##") ||
t.specialToken.image.equals("\n"))
+ if (t.specialToken == null || t.specialToken.image.startsWith("##") )
return specialText;
Token tmp_t = t.specialToken;