renamed fern.rs back to main.rs

This commit is contained in:
2026-01-28 19:57:14 -05:00
parent ad0e4277cb
commit 7f3e1cfcee
15 changed files with 52 additions and 119 deletions

View File

@@ -118,12 +118,7 @@ impl ExecArgs {
pub fn exec_input(input: String, io_stack: Option<IoStack>) -> ShResult<()> {
write_meta(|m| m.start_timer());
let log_tab = {
let fern = FERN.read().unwrap();
// TODO: Is there a better way to do this?
// The goal is mainly to not be holding a lock while executing input
fern.read_logic().clone()
};
let log_tab = read_logic(|l| l.clone());
let input = expand_aliases(input, HashSet::new(), &log_tab);
let mut parser = ParsedSrc::new(Arc::new(input));
if let Err(errors) = parser.parse_src() {

View File

@@ -317,17 +317,16 @@ impl LexStream {
let slice = self.slice_from_cursor().unwrap().to_string();
let mut pos = self.cursor;
let mut chars = slice.chars().peekable();
let mut can_be_subshell = chars.peek() == Some(&'(');
let can_be_subshell = chars.peek() == Some(&'(');
if self.flags.contains(LexFlags::IN_CASE) {
if let Some(count) = case_pat_lookahead(chars.clone()) {
if self.flags.contains(LexFlags::IN_CASE)
&& let Some(count) = case_pat_lookahead(chars.clone()) {
pos += count;
let casepat_tk = self.get_token(self.cursor..pos, TkRule::CasePattern);
self.cursor = pos;
self.set_next_is_cmd(true);
return Ok(casepat_tk);
}
}
while let Some(ch) = chars.next() {
match ch {