mxmlextrema_as3parser/tree/
for_statement.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use crate::ns::*;
use serde::{Serialize, Deserialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ForStatement {
    pub location: Location,
    pub init: Option<ForInitializer>,
    pub test: Option<Rc<Expression>>,
    pub update: Option<Rc<Expression>>,
    pub body: Rc<Directive>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum ForInitializer {
    Expression(Rc<Expression>),
    VariableDefinition(Rc<SimpleVariableDefinition>),
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ForInStatement {
    pub location: Location,
    pub each: bool,
    pub left: ForInBinding,
    pub right: Rc<Expression>,
    pub body: Rc<Directive>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum ForInBinding {
    Expression(Rc<Expression>),
    VariableDefinition(Rc<SimpleVariableDefinition>),
}