Skip to content

Commit

Permalink
Change field name
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuichiueda committed Jan 17, 2024
1 parent 1469357 commit e452de3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub struct ShellCore {
pub flags: String,
pub vars: HashMap<String, String>,
pub builtins: HashMap<String, fn(&mut ShellCore, &mut Vec<String>) -> i32>,
pub nest: Vec<(String, Vec<String>)>,
pub command_nest: Vec<(String, Vec<String>)>,
pub sigint: Arc<AtomicBool>,
pub is_subshell: bool,
pub tty_fd: RawFd,
Expand Down Expand Up @@ -54,7 +54,7 @@ impl ShellCore {
flags: String::new(),
vars: HashMap::new(),
builtins: HashMap::new(),
nest: vec![("".to_string(), vec![])],
command_nest: vec![("".to_string(), vec![])],
sigint: Arc::new(AtomicBool::new(false)),
is_subshell: false,
tty_fd: -1,
Expand Down
4 changes: 2 additions & 2 deletions src/elements/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ pub fn eat_inner_script(feeder: &mut Feeder, core: &mut ShellCore,
if ! feeder.starts_with(left) {
return false;
}
core.nest.push( (left.to_string(), right.iter().map(|e| e.to_string()).collect()) );
core.command_nest.push( (left.to_string(), right.iter().map(|e| e.to_string()).collect()) );
feeder.consume(left.len());
*ans = Script::parse(feeder, core);
core.nest.pop();
core.command_nest.pop();
! ans.is_none()
}

Expand Down
2 changes: 1 addition & 1 deletion src/elements/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl Script {
}

fn check_nest(feeder: &mut Feeder, core: &mut ShellCore, jobnum: usize) -> Status {
let nest = core.nest.last().expect("SUSHI INTERNAL ERROR (empty nest)");
let nest = core.command_nest.last().expect("SUSHI INTERNAL ERROR (empty nest)");

match ( nest.1.iter().find(|e| feeder.starts_with(e)), jobnum ) {
( Some(end), 0 ) => return Status::UnexpectedSymbol(end.to_string()),
Expand Down

0 comments on commit e452de3

Please sign in to comment.