pub enum Stmt {
Show 18 variants
Expr(Expr),
Print {
args: Vec<Expr>,
output: Option<OutputRedirect>,
location: SourceLocation,
},
Printf {
format: Expr,
args: Vec<Expr>,
output: Option<OutputRedirect>,
location: SourceLocation,
},
If {
condition: Expr,
then_branch: Box<Stmt>,
else_branch: Option<Box<Stmt>>,
location: SourceLocation,
},
While {
condition: Expr,
body: Box<Stmt>,
location: SourceLocation,
},
DoWhile {
body: Box<Stmt>,
condition: Expr,
location: SourceLocation,
},
For {
init: Option<Box<Stmt>>,
condition: Option<Expr>,
update: Option<Expr>,
body: Box<Stmt>,
location: SourceLocation,
},
ForIn {
var: String,
array: String,
body: Box<Stmt>,
location: SourceLocation,
},
Block(Block),
Break {
location: SourceLocation,
},
Continue {
location: SourceLocation,
},
Next {
location: SourceLocation,
},
Nextfile {
location: SourceLocation,
},
Exit {
code: Option<Expr>,
location: SourceLocation,
},
Return {
value: Option<Expr>,
location: SourceLocation,
},
Delete {
array: String,
index: Vec<Expr>,
location: SourceLocation,
},
Getline {
var: Option<String>,
input: Option<GetlineInput>,
location: SourceLocation,
},
Empty,
}Expand description
Statement types
Variants§
Expr(Expr)
Expression statement (e.g., function call, assignment)
Print statement: print expr, expr, …
Printf
Printf statement: printf format, expr, …
If
If statement
Fields
§
location: SourceLocationWhile
While loop
DoWhile
Do-while loop
For
For loop (C-style)
Fields
§
location: SourceLocationForIn
For-in loop (array iteration)
Block(Block)
Block of statements
Break
Break statement
Fields
§
location: SourceLocationContinue
Continue statement
Fields
§
location: SourceLocationNext
Next statement (skip to next record)
Fields
§
location: SourceLocationNextfile
Nextfile statement (skip to next file)
Fields
§
location: SourceLocationExit
Exit statement
Return
Return statement
Delete
Delete statement: delete array[index]
Getline
Getline statement (various forms)
Empty
Empty statement (just a semicolon)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Stmt
impl RefUnwindSafe for Stmt
impl Send for Stmt
impl Sync for Stmt
impl Unpin for Stmt
impl UnwindSafe for Stmt
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