public static IEnumerable <INode> GetFlattenedNodes(this NodeArrayNode arrayNode) { return(arrayNode .Nodes .SelectMany(t => (t is NodeArrayNode array) ? array.GetFlattenedNodes() : new[] { t })); }
protected FunctionNode(SerializationInfo info, StreamingContext context) { if (info == null) { throw new ArgumentNullException(nameof(info)); } Arguments = (NodeArrayNode)info.GetValue(nameof(Arguments).ToCamelCase(), typeof(NodeArrayNode)); FunctionName = info.GetString(nameof(FunctionName).ToCamelCase()); }
public FunctionNode(string functionName, IEnumerable <INode> arguments) { FunctionName = functionName; Arguments = new NodeArrayNode(arguments); }