private RqlExpression VisitOperatorInNinAll(RqlFunctionCallExpression node) { if (node.Arguments.Count != 2) { ThrowError(node, String.Format("{0} needs two arguments", node.Name)); } RqlIdentifierExpression identifier = node.Arguments[0] as RqlIdentifierExpression; if (identifier == null) { ThrowError(node.Arguments[0], "First argument must be a field identifier"); } RqlTupleExpression tuple = node.Arguments[1] as RqlTupleExpression; RqlFunctionCallExpression funcCall = node.Arguments[1] as RqlFunctionCallExpression; // TODO: Need a way to find the return types of operators if (tuple == null && !(funcCall != null && (funcCall.Name == "where" || funcCall.Name == "ids"))) { ThrowError(node.Arguments[1], "Second argument must be a tuple or an expression returning a tuple"); } sb.Append("{"); VisitIdentifier(identifier); sb.Append("{$"); sb.Append(node.Name); sb.Append(": "); Visit(node.Arguments[1]); sb.Append("}"); sb.Append("}"); return(node); }
protected override RqlExpression VisitTuple(RqlTupleExpression node) { sb.Append("["); var list = node.Constants; for (int i = 0; i < list.Count; i++) { VisitConstant(list[i]); sb.Append(i < list.Count - 1 ? "," : ""); } sb.Append("]"); return(node); }
protected override RqlExpression VisitTuple(RqlTupleExpression node) { var list = node.Constants; s += "("; for (int i = 0; i < list.Count; i++) { VisitConstant(list[i]); s += (i < list.Count - 1 ? "," : ""); } s += ")"; return(node); }