pub fn diagnosed(expression: &'t str) -> DiagnosticResult<'t, Self> {
        parse_and_diagnose(expression).and_then_diagnose(|tree| {
            Glob::compile(tree.as_ref().tokens())
                .into_error_diagnostic()
                .map_output(|program| Glob { tree, program })
        })
    }
Constructs a [`Glob`] from a glob expression with diagnostics.

This function is the same as [`Glob::new`], but additionally returns
detailed diagnostics on both success and failure.

See [`Glob::diagnose`].

# Examples

```rust
use tardar::DiagnosticResultExt as _;
use wax::Glob;

let result = Glob::diagnosed("(?i)readme.{md,mkd,markdown}");
for diagnostic in result.diagnostics() {
eprintln!("{}", diagnostic);
}
if let Some(glob) = result.ok_output() { /* ... */ }
```

[`Glob`]: crate::Glob
[`Glob::diagnose`]: crate::Glob::diagnose
[`Glob::new`]: crate::Glob::new
crates/turborepo-wax/src/diagnostics/miette.rs