mxmlextrema_as3parser/tree/
for_statement.rs

1use crate::ns::*;
2use serde::{Serialize, Deserialize};
3
4#[derive(Debug, Clone, Serialize, Deserialize)]
5pub struct ForStatement {
6    pub location: Location,
7    pub init: Option<ForInitializer>,
8    pub test: Option<Rc<Expression>>,
9    pub update: Option<Rc<Expression>>,
10    pub body: Rc<Directive>,
11}
12
13#[derive(Debug, Clone, Serialize, Deserialize)]
14pub enum ForInitializer {
15    Expression(Rc<Expression>),
16    VariableDefinition(Rc<SimpleVariableDefinition>),
17}
18
19#[derive(Debug, Clone, Serialize, Deserialize)]
20pub struct ForInStatement {
21    pub location: Location,
22    pub each: bool,
23    pub left: ForInBinding,
24    pub right: Rc<Expression>,
25    pub body: Rc<Directive>,
26}
27
28#[derive(Debug, Clone, Serialize, Deserialize)]
29pub enum ForInBinding {
30    Expression(Rc<Expression>),
31    VariableDefinition(Rc<SimpleVariableDefinition>),
32}