nx_glob.nx
buildroot/runtime/nx_glob.nx
about
nx_glob.nx -- POSIX-style glob pattern matching.
Used by toolchain CLI wrappers that take "*.nx", "tests/*.s",
"runtime/nx_dwarf_*.nx" arguments. Today each tool that wants
glob support either calls out to a shell or implements its own
matcher. This module provides a single canonical matcher.
Supported syntax (POSIX subset):
* match zero or more chars (NEVER crosses '/')
? match exactly one char
[abc] character class
[a-z] character range
[^abc] negated class
\\x literal escape
Out of scope:
** (recursive wildcard)
{a,b,c} brace expansion
~ home-dir expansion
Matcher is recursive (textbook NFA-style); for the pattern lengths
real CLIs use (< 100 chars) the depth is fine.
dependencies 1 imports · 0 importers
imports: syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 36 | func nx_glob_match_class(pat: *u8, i: i64, ch: i64, matched_out: *i64) -> i64 called by 1: nx_glob_match |
| 80 | func nx_glob_match(pat: *u8, text: *u8) -> i64 |
| 154 | func main() -> i64 calls 1: nx_glob_match |