@@ -21,27 +21,27 @@ impl SimpleCommand {
21
21
}
22
22
}
23
23
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 > {
26
26
let w = match Word :: parse ( feeder, core) ? {
27
27
Some ( w) => w,
28
28
_ => return Ok ( false ) ,
29
29
} ;
30
30
31
- if ans . words . is_empty ( ) {
31
+ if self . words . is_empty ( ) {
32
32
if utils:: reserved ( & w. text ) {
33
33
return Ok ( false ) ;
34
34
}
35
35
36
- ans . command_name = w. text . clone ( ) ;
36
+ self . command_name = w. text . clone ( ) ;
37
37
}
38
- ans . text += & w. text ;
39
- ans . words . push ( w) ;
38
+ self . text += & w. text ;
39
+ self . words . push ( w) ;
40
40
Ok ( true )
41
41
}
42
42
43
43
pub fn parse ( feeder : & mut Feeder , core : & mut ShellCore )
44
- -> Result < Option < Self > , ParseError > {
44
+ -> Result < Option < Self > , ParseError > {
45
45
let mut ans = Self :: default ( ) ;
46
46
feeder. set_backup ( ) ;
47
47
@@ -54,7 +54,7 @@ impl SimpleCommand {
54
54
55
55
loop {
56
56
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) ? {
58
58
break ;
59
59
}
60
60
}
0 commit comments