com.google.template.soy.parsepasses
Class RewriteRemainderNodesVisitor
java.lang.Object
com.google.template.soy.basetree.AbstractNodeVisitor<SoyNode,R>
com.google.template.soy.soytree.AbstractSoyNodeVisitor<Void>
com.google.template.soy.parsepasses.RewriteRemainderNodesVisitor
- All Implemented Interfaces:
- NodeVisitor<SoyNode,Void>
public class RewriteRemainderNodesVisitor
- extends AbstractSoyNodeVisitor<Void>
Visitor for finding 'print' nodes that are actually 'remainder' nodes, and replacing them with
the appropriate expression.
Important: Do not use outside of Soy code (treat as superpackage-private).
Important: This pass does not create any MsgPluralRemainderNodes. Instead, we simply
rewrite the PrintNodes to have the correct computation (subtract constant offset). This class is
to be used instead of InjectRemainderNodesVisitor.
AbstractNodeVisitor.exec(N) should be called on a full parse tree. There is no return value.
| Methods inherited from class com.google.template.soy.soytree.AbstractSoyNodeVisitor |
visit, visitCallBasicNode, visitCallDelegateNode, visitCallNode, visitCallParamContentNode, visitCallParamNode, visitCallParamValueNode, visitChildren, visitChildrenAllowingConcurrentModification, visitCssNode, visitDebuggerNode, visitForeachIfemptyNode, visitForeachNode, visitForeachNonemptyNode, visitForNode, visitGoogMsgNode, visitGoogMsgRefNode, visitIfCondNode, visitIfElseNode, visitIfNode, visitLetContentNode, visitLetNode, visitLetValueNode, visitLogNode, visitLoopNode, visitMsgHtmlTagNode, visitMsgNode, visitMsgPlaceholderNode, visitMsgPluralCaseNode, visitMsgPluralDefaultNode, visitMsgPluralRemainderNode, visitMsgSelectCaseNode, visitMsgSelectDefaultNode, visitMsgSelectNode, visitPrintDirectiveNode, visitRawTextNode, visitSoyFileNode, visitSoyFileSetNode, visitSwitchCaseNode, visitSwitchDefaultNode, visitSwitchNode, visitTemplateBasicNode, visitTemplateDelegateNode, visitTemplateNode |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RewriteRemainderNodesVisitor
public RewriteRemainderNodesVisitor()
visitPrintNode
protected void visitPrintNode(PrintNode node)
- Overrides:
visitPrintNode in class AbstractSoyNodeVisitor<Void>
visitMsgPluralNode
protected void visitMsgPluralNode(MsgPluralNode node)
- Overrides:
visitMsgPluralNode in class AbstractSoyNodeVisitor<Void>
visitSoyNode
protected void visitSoyNode(SoyNode node)
- Overrides:
visitSoyNode in class AbstractSoyNodeVisitor<Void>
- Parameters:
node - the visited node.