pub enum DecodedOp {
Show 27 variants
End,
LineNo(u32),
List {
list_type: u32,
is_end: bool,
ops: Vec<DecodedOp>,
},
Sublist {
sublist_type: u32,
negated: bool,
ops: Vec<DecodedOp>,
},
Pipe {
lineno: u32,
ops: Vec<DecodedOp>,
},
Redir {
redir_type: u32,
fd: i32,
target: String,
varid: Option<String>,
},
Assign {
name: String,
value: String,
},
AssignArray {
name: String,
values: Vec<String>,
},
Simple {
args: Vec<String>,
},
Typeset {
args: Vec<String>,
assigns: Vec<DecodedOp>,
},
Subsh {
ops: Vec<DecodedOp>,
},
Cursh {
ops: Vec<DecodedOp>,
},
Timed {
cmd: Option<Box<DecodedOp>>,
},
FuncDef {
name: String,
body: Vec<DecodedOp>,
},
For {
var: String,
list: Vec<String>,
body: Vec<DecodedOp>,
},
ForCond {
init: String,
cond: String,
step: String,
body: Vec<DecodedOp>,
},
Select {
var: String,
list: Vec<String>,
body: Vec<DecodedOp>,
},
While {
cond: Vec<DecodedOp>,
body: Vec<DecodedOp>,
is_until: bool,
},
Repeat {
count: String,
body: Vec<DecodedOp>,
},
Case {
word: String,
cases: Vec<(String, Vec<DecodedOp>)>,
},
CaseItem {
pattern: String,
terminator: u32,
body: Vec<DecodedOp>,
},
If {
if_type: u32,
conditions: Vec<(Vec<DecodedOp>, Vec<DecodedOp>)>,
else_body: Option<Vec<DecodedOp>>,
},
Cond {
cond_type: u32,
args: Vec<String>,
},
Arith {
expr: String,
},
AutoFn,
Try {
try_body: Vec<DecodedOp>,
always_body: Vec<DecodedOp>,
},
Unknown {
code: u32,
data: u32,
},
}Variants§
End
LineNo(u32)
List
Sublist
Pipe
Redir
Assign
AssignArray
Simple
Typeset
Subsh
Cursh
Timed
FuncDef
For
ForCond
Select
While
Repeat
Case
CaseItem
If
Fields
Cond
Arith
AutoFn
Try
Unknown
Implementations§
Source§impl DecodedOp
Convert decoded ZWC ops to our shell AST for execution
impl DecodedOp
Convert decoded ZWC ops to our shell AST for execution
pub fn to_shell_command(&self) -> Option<ShellCommand>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DecodedOp
impl RefUnwindSafe for DecodedOp
impl Send for DecodedOp
impl Sync for DecodedOp
impl Unpin for DecodedOp
impl UnsafeUnpin for DecodedOp
impl UnwindSafe for DecodedOp
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more