Module Path_glob.Glob

type fast_pattern

The type representing fast patterns. Do not attempt to compare them, as they get on-the-fly optimizations.

val fast_pattern_of_pattern : Ast.pattern -> fast_pattern
type globber = fast_pattern Ast.atom Formula.t

The type representing globbers. Do not attempt to compare them, as they get on-the-fly optimizations.

val parse : ?⁠dir:string -> string -> globber

parse ~dir pattern will parse the globber pattern pattern, optionally prefixing its patterns with dir.

exception Parse_error of string

A descriptive exception raised when an invalid glob pattern description is given.

val eval : globber -> string -> bool

eval g u returns true if and only if the string u matches the given glob expression. Avoid re-parsing the same pattern, since the automaton implementing the pattern is optimized on the fly. The first few evaluations are done using a time-inefficient but memory-efficient algorithm. It then compiles the pattern into an efficient but more memory-hungry data structure.