1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
use ast::{AndOr, RedirectOrCmdWord, RedirectOrEnvVar};
use ast::builder::*;
use void::Void;
#[derive(Debug, Copy, Clone)]
pub struct EmptyBuilder;
impl Default for EmptyBuilder {
fn default() -> Self {
EmptyBuilder::new()
}
}
impl EmptyBuilder {
pub fn new() -> Self {
EmptyBuilder
}
}
impl Builder for EmptyBuilder {
type Command = ();
type CommandList = ();
type ListableCommand = ();
type PipeableCommand = ();
type CompoundCommand = ();
type Word = ();
type Redirect = ();
type Error = Void;
fn complete_command(&mut self,
_pre_cmd_comments: Vec<Newline>,
_cmd: Self::Command,
_separator: SeparatorKind,
_cmd_comment: Option<Newline>)
-> Result<Self::Command, Self::Error>
{
Ok(())
}
fn and_or_list(&mut self,
_first: Self::ListableCommand,
_rest: Vec<(Vec<Newline>, AndOr<Self::ListableCommand>)>)
-> Result<Self::CommandList, Self::Error>
{
Ok(())
}
fn pipeline(&mut self,
_bang: bool,
_cmds: Vec<(Vec<Newline>, Self::Command)>)
-> Result<Self::Command, Self::Error>
{
Ok(())
}
fn simple_command(
&mut self,
_redirects_or_env_vars: Vec<RedirectOrEnvVar<Self::Redirect, String, Self::Word>>,
_redirects_or_cmd_words: Vec<RedirectOrCmdWord<Self::Redirect, Self::Word>>
) -> Result<Self::PipeableCommand, Self::Error>
{
Ok(())
}
fn brace_group(&mut self,
_cmds: CommandGroup<Self::Command>,
_redirects: Vec<Self::Redirect>)
-> Result<Self::Command, Self::Error>
{
Ok(())
}
fn subshell(&mut self,
_cmds: CommandGroup<Self::Command>,
_redirects: Vec<Self::Redirect>)
-> Result<Self::Command, Self::Error>
{
Ok(())
}
fn loop_command(&mut self,
__kind: LoopKind,
__guard_body_pair: GuardBodyPairGroup<Self::Command>,
__redirects: Vec<Self::Redirect>)
-> Result<Self::CompoundCommand, Self::Error>
{
Ok(())
}
fn if_command(&mut self,
_fragments: IfFragments<Self::Command>,
_redirects: Vec<Self::Redirect>)
-> Result<Self::Command, Self::Error>
{
Ok(())
}
fn for_command(&mut self,
_fragments: ForFragments<Self::Word, Self::Command>,
_redirects: Vec<Self::Redirect>)
-> Result<Self::Command, Self::Error>
{
Ok(())
}
fn case_command(&mut self,
_fragments: CaseFragments<Self::Word, Self::Command>,
_redirects: Vec<Self::Redirect>)
-> Result<Self::Command, Self::Error>
{
Ok(())
}
fn function_declaration(&mut self,
_name: String,
_post_name_comments: Vec<Newline>,
_body: Self::CompoundCommand)
-> Result<Self::Command, Self::Error>
{
Ok(())
}
fn comments(&mut self,
_comments: Vec<Newline>)
-> Result<(), Self::Error>
{
Ok(())
}
fn word(&mut self,
_kind: ComplexWordKind<Self::Command>)
-> Result<Self::Word, Self::Error>
{
Ok(())
}
fn redirect(&mut self,
_kind: RedirectKind<Self::Word>)
-> Result<Self::Redirect, Self::Error>
{
Ok(())
}
fn compound_command_into_pipeable(&mut self,
_cmd: Self::CompoundCommand)
-> Result<Self::PipeableCommand, Self::Error>
{
Ok(())
}
}