pub enum MatlabStmt {
Show 21 variants
Assign {
lhs: Vec<String>,
rhs: MatlabExpr,
suppress: bool,
},
AssignIndex {
obj: MatlabExpr,
indices: Vec<MatlabExpr>,
cell_index: bool,
rhs: MatlabExpr,
suppress: bool,
},
AssignField {
obj: String,
field: String,
rhs: MatlabExpr,
suppress: bool,
},
ForLoop {
var: String,
range: MatlabExpr,
body: Vec<MatlabStmt>,
},
WhileLoop {
cond: MatlabExpr,
body: Vec<MatlabStmt>,
},
IfElseIf {
cond: MatlabExpr,
then_body: Vec<MatlabStmt>,
elseif_branches: Vec<(MatlabExpr, Vec<MatlabStmt>)>,
else_body: Option<Vec<MatlabStmt>>,
},
SwitchCase {
expr: MatlabExpr,
cases: Vec<(MatlabExpr, Vec<MatlabStmt>)>,
otherwise: Option<Vec<MatlabStmt>>,
},
Return,
Break,
Continue,
Error(MatlabExpr, Vec<MatlabExpr>),
Warning(MatlabExpr, Vec<MatlabExpr>),
Disp(MatlabExpr),
FunctionDef(MatlabFunction),
TryCatch {
body: Vec<MatlabStmt>,
catch_var: Option<String>,
catch_body: Vec<MatlabStmt>,
},
ValidateProp(String, MatlabExpr),
Expr(MatlabExpr, bool),
Comment(String),
Global(Vec<String>),
Persistent(Vec<String>),
ClassdefStmt(String),
}Expand description
MATLAB statement.
Variants§
Assign
Assignment: [a, b] = f(x) or a = expr
AssignIndex
Complex left-hand side: A(i,j) = expr
AssignField
Struct field assignment: s.field = expr
ForLoop
for var = range; body; end
WhileLoop
while cond; body; end
IfElseIf
if cond; ... elseif ...; else ...; end
Fields
§
cond: MatlabExpr§
then_body: Vec<MatlabStmt>§
elseif_branches: Vec<(MatlabExpr, Vec<MatlabStmt>)>§
else_body: Option<Vec<MatlabStmt>>SwitchCase
switch expr; case val; ...; otherwise; ...; end
Fields
§
expr: MatlabExpr§
cases: Vec<(MatlabExpr, Vec<MatlabStmt>)>§
otherwise: Option<Vec<MatlabStmt>>Return
return
Break
break
Continue
continue
Error(MatlabExpr, Vec<MatlabExpr>)
error(msg, args...)
Warning(MatlabExpr, Vec<MatlabExpr>)
warning(msg, args...)
Disp(MatlabExpr)
disp(expr) or fprintf(...)
FunctionDef(MatlabFunction)
Function definition block
TryCatch
try; ...; catch e; ...; end
ValidateProp(String, MatlabExpr)
Class property validation
Expr(MatlabExpr, bool)
Expression statement (with or without semicolon suppression)
Comment(String)
Comment: % text
Global(Vec<String>)
global x y z
Persistent(Vec<String>)
persistent x
ClassdefStmt(String)
classdef inner block statement
Trait Implementations§
Source§impl Clone for MatlabStmt
impl Clone for MatlabStmt
Source§fn clone(&self) -> MatlabStmt
fn clone(&self) -> MatlabStmt
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MatlabStmt
impl Debug for MatlabStmt
Source§impl PartialEq for MatlabStmt
impl PartialEq for MatlabStmt
impl StructuralPartialEq for MatlabStmt
Auto Trait Implementations§
impl Freeze for MatlabStmt
impl RefUnwindSafe for MatlabStmt
impl Send for MatlabStmt
impl Sync for MatlabStmt
impl Unpin for MatlabStmt
impl UnsafeUnpin for MatlabStmt
impl UnwindSafe for MatlabStmt
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