reluxscript 0.1.4

Write AST transformations once. Compile to Babel, SWC, and beyond.
Documentation
// Generated by ReluxScript compiler
// Do not edit manually

use swc_common::{Span, DUMMY_SP, SyntaxContext};
use swc_ecma_ast::*;
use swc_ecma_visit::{Visit, VisitMut, VisitMutWith, VisitWith};

#[derive(Clone, Debug)]
struct __InlineVisitor_0 {
    count: i32,
}

impl VisitMut for __InlineVisitor_0 {
    fn visit_mut_expr(&mut self, e: &mut Expr) {
        self.count = (self.count + 1);
    }
    
}

#[derive(Clone, Debug)]
struct State {
    expr_count: i32,
}

pub struct TraverseTest {
    pub state: State,
}

impl VisitMut for TraverseTest {
    fn visit_mut_jsx_element(&mut self, node: &mut JSXElement) {
        node.visit_mut_with(&mut __InlineVisitor_0 { count: 0 });
        self.state.expr_count = (self.state.expr_count + 1);
    }
    
}

impl TraverseTest {
    pub fn new() -> Self {
        Self {
            state: State {
                expr_count: 0,
            },
        }
    }
    
}