return;
}
// Check for the function node with the function "remainder()".
if (exprRootNode.getChild(0) instanceof FunctionNode) {
FunctionNode functionNode = (FunctionNode) exprRootNode.getChild(0);
if (functionNode.getFunctionName().equals("remainder")) {
if (currPluralNode == null) {
// 'remainder' outside 'plural'. Bad!
throw SoySyntaxExceptionUtils.createWithNode(
"The special function 'remainder' is for use in plural messages" +
" (tag " + node.toSourceString() + ").",
node);
}
// 'remainder' with no parameters or more than one parameter. Bad!
if (functionNode.numChildren() != 1) {
throw SoySyntaxExceptionUtils.createWithNode(
"The function 'remainder' has to have exactly one argument" +
" (tag " + node.toSourceString() + ").",
node);
}
// 'remainder' with a different expression than the enclosing 'plural'. Bad!
if (! functionNode.getChild(0).toSourceString().equals(
currPluralNode.getExpr().toSourceString())) {
throw SoySyntaxExceptionUtils.createWithNode(
"The parameter to 'remainder' has to be the same as the 'plural' variable" +
" (tag " + node.toSourceString() + ").",
node);