/* Generated By:JJTree: Do not edit this line. ASTText.java */

package org.apache.velocity.runtime.parser.node;

import java.io.Writer;
import java.io.IOException;

import org.apache.velocity.Context;
import org.apache.velocity.runtime.parser.*;

public class ASTText extends SimpleNode
{
    private String text;

    public ASTText(int id)
    {
        super(id);
    }

    public ASTText(Parser p, int id)
    {
        super(p, id);
    }

    /** Accept the visitor. **/
    public Object jjtAccept(ParserVisitor visitor, Object data)
    {
        return visitor.visit(this, data);
    }

    public Object init(Context context, Object data) throws Exception
    {
        // 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;
    }

    public boolean render(Context context, Writer writer)
        throws IOException
    {
        writer.write(text);
        return true;
    }    
}

@@ -1070,10 +1070,10 @@
 %22$%22)
- 
 )
+ 
 %0A   
@@ -1100,16 +1100,122 @@
 + text;%0A
+        else if ( NodeUtils.specialText(getFirstToken()).startsWith(%22#%22) )%0A            text = %22#%22 + text;%0A
         

Support for symmetrization of DIRECTIVE and REFERENCE. See the 1.20 Parser.jjt