// Validator for template(...) private void ValidateTemplateFunction(Expression expression) { ExpressionFunctions.ValidateAtLeastOne(expression); var children0 = expression.Children[0]; if (children0.ReturnType != ReturnType.Object && children0.ReturnType != ReturnType.String) { throw new Exception(TemplateErrors.ErrorTemplateNameformat(children0.ToString())); } // Validate more if the name is string constant if (children0.Type == ExpressionType.Constant) { var templateName = (children0 as Constant).Value.ToString(); CheckTemplateReference(templateName, expression.Children.Skip(1)); } }