Skip to content

Commit 706e067

Browse files
committed
Fix
2 parents 8e2221c + 34f2381 commit 706e067

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/elements/command/simple/parser.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,27 @@ impl SimpleCommand {
2121
}
2222
}
2323

24-
fn eat_word(feeder: &mut Feeder, ans: &mut SimpleCommand, core: &mut ShellCore)
25-
-> Result<bool, ParseError> {
24+
fn eat_word(&mut self, feeder: &mut Feeder, core: &mut ShellCore)
25+
-> Result<bool, ParseError> {
2626
let w = match Word::parse(feeder, core)? {
2727
Some(w) => w,
2828
_ => return Ok(false),
2929
};
3030

31-
if ans.words.is_empty() {
31+
if self.words.is_empty() {
3232
if utils::reserved(&w.text) {
3333
return Ok(false);
3434
}
3535

36-
ans.command_name = w.text.clone();
36+
self.command_name = w.text.clone();
3737
}
38-
ans.text += &w.text;
39-
ans.words.push(w);
38+
self.text += &w.text;
39+
self.words.push(w);
4040
Ok(true)
4141
}
4242

4343
pub fn parse(feeder: &mut Feeder, core: &mut ShellCore)
44-
-> Result<Option<Self>, ParseError> {
44+
-> Result<Option<Self>, ParseError> {
4545
let mut ans = Self::default();
4646
feeder.set_backup();
4747

@@ -54,7 +54,7 @@ impl SimpleCommand {
5454

5555
loop {
5656
command::eat_redirects(feeder, core, &mut ans.redirects, &mut ans.text)?;
57-
if ! Self::eat_word(feeder, &mut ans, core)? {
57+
if ! ans.eat_word(feeder, core)? {
5858
break;
5959
}
6060
}

0 commit comments

Comments
 (0)