<commit_before>// Package glob implements globbing for elvish.
package glob

import (
	"io/ioutil"
	"os"
	"runtime"
	"unicode/utf8"
)

// TODO: Use native path separators (i.e., os.PathSeparator) instead of always using `/` when
// building a path. When parsing a path note that Windows supports both `/` and `\` so Elvish should
// as well. TBD is whether os.IsPathSeparator handles Windows correctly.

// PathInfo keeps a path resulting from glob expansion and its FileInfo. The
// FileInfo is useful for efficiently determining if a given pathname satisfies
// a particular constraint without doing an extra stat.
type PathInfo struct {
	// The generated path, consistent with the original glob pattern. It cannot
	// be replaced by Info.Name(), which is just the final path component.
	Path string
	Info os.FileInfo
}

// Glob returns a list of file names satisfying the given pattern.
func Glob(p string, cb func(PathInfo) bool) bool {
	return Parse(p).Glob(cb)
}
<commit_msg>pkg/glob: Update TODO about path separator on Windows.<commit_after>// Package glob implements globbing for elvish.
package glob

import (
	"io/ioutil"
	"os"
	"runtime"
	"unicode/utf8"
)

// TODO: On Windows, preserve the original path separator (/ or \) specified in
// the glob pattern.

// PathInfo keeps a path resulting from glob expansion and its FileInfo. The
// FileInfo is useful for efficiently determining if a given pathname satisfies
// a particular constraint without doing an extra stat.
type PathInfo struct {
	// The generated path, consistent with the original glob pattern. It cannot
	// be replaced by Info.Name(), which is just the final path component.
	Path string
	Info os.FileInfo
}

// Glob returns a list of file names satisfying the given pattern.
func Glob(p string, cb func(PathInfo) bool) bool {
	return Parse(p).Glob(cb)
}

{'fraction_non_alphanumeric': 0.08169934640522876, 'fraction_numerical': 0.0010893246187363835, 'mean_word_length': 3.8089005235602094, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3660743', 'n_tokens_mistral': 517, 'n_tokens_neox': 512, 'n_words': 248}