private static string ProcessSegment(PathSegment node) { switch (node.Type) { case GlobNodeType.Root: return ProcessRoot((Root)node); case GlobNodeType.DirectoryWildcard: return ProcessDirectoryWildcard((DirectoryWildcard)node); case GlobNodeType.PathSegment: return ProcessPathSegment(node); default: throw new InvalidOperationException(); } }
private static string ProcessPathSegment(PathSegment node) { return string.Join("", node.SubSegments.Select(ProcessSubSegment)); }