implemented globbing and tilde expansions

This commit is contained in:
2025-03-28 12:02:34 -04:00
parent 9989663c97
commit 1eb19092cc
10 changed files with 137 additions and 161 deletions

View File

@@ -596,10 +596,7 @@ impl ParseStream {
}
node_tks.push(self.next_tk().unwrap());
let Some(pat_tk) = self.next_tk() else {
self.panic_mode(&mut node_tks);
return Err(
parse_err_full(
let pat_err = parse_err_full(
"Expected a pattern after 'case' keyword", &node_tks.get_span().unwrap()
)
.with_note(
@@ -607,10 +604,17 @@ impl ParseStream {
.with_sub_notes(vec![
"This includes variables like '$foo' or command substitutions like '$(echo foo)'"
])
)
);
);
let Some(pat_tk) = self.next_tk() else {
self.panic_mode(&mut node_tks);
return Err(pat_err);
};
if pat_tk.span.as_str() == "in" {
return Err(pat_err)
}
pattern = pat_tk;
node_tks.push(pattern.clone());