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};

pub struct ModuleLevelTest {
    output: String,
    indent_level: usize,
    count: i32,
}

impl Visit for ModuleLevelTest {}

impl ModuleLevelTest {
    pub fn new() -> Self {
        Self {
            output: String::new(),
            indent_level: 0,
            count: 0,
        }
    }
    
    fn append(&mut self, s: &str) {
        self.output.push_str(s);
    }
    
    fn newline(&mut self) {
        self.output.push('\n');
    }
    
    pub fn to_string(&self) -> String {
        self.output.clone()
    }
    
    fn visit_mut_jsx_element(&mut self, node: &JSXElement) {
        if Self::is_valid_element(node) {
            self.count = (self.count + 1)
        }
    }
    
    // Exit-hook
    pub fn finish(self: &Self) -> i32 {
        self.count
    }
    
    fn is_valid_element(node: &JSXElement) -> bool {
        true
    }
    
}