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,
},
}Expand description
Decoded wordcode op variants.
Mirrors the WC_* opcode dispatch tree the C source uses
across Src/exec.c (exectree()) and Src/text.c
(gettext2()). Each variant corresponds to one of the C
source’s WC_* opcodes.
Variants§
End
End variant.
LineNo(u32)
LineNo variant.
List
List variant.
Sublist
Sublist variant.
Pipe
Pipe variant.
Redir
Redir variant.
Assign
Assign variant.
AssignArray
AssignArray variant.
Simple
Simple variant.
Typeset
Typeset variant.
Subsh
Subsh variant.
Cursh
Cursh variant.
Timed
Timed variant.
FuncDef
FuncDef variant.
For
For variant.
ForCond
ForCond variant.
Select
Select variant.
While
While variant.
Repeat
Repeat variant.
Case
Case variant.
CaseItem
CaseItem variant.
If
If variant.
Fields
Cond
Cond variant.
Arith
Arith variant.
AutoFn
AutoFn variant.
Try
Try variant.
Unknown
Unknown variant.
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
Sourcepub fn to_shell_command(&self) -> Option<ShellCommand>
pub fn to_shell_command(&self) -> Option<ShellCommand>
to_shell_command — see implementation.
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> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.