Skip to main content

Module convert_ast_reverse

Module convert_ast_reverse 

Source
Expand description

Reverse AST converter: react_compiler_ast (Babel format) → SWC AST.

This is the inverse of convert_ast.rs. It takes a react_compiler_ast::File (which represents the compiler’s Babel-compatible output) and produces SWC AST nodes suitable for code generation via swc_codegen.

Structs§

SwcConversionResult
Result of converting a Babel AST back to SWC, including extracted comments.

Functions§

convert_program_to_swc
Convert a react_compiler_ast::File into an SWC Module and extracted comments.
convert_program_to_swc_with_source
Convert a react_compiler_ast::File into an SWC Module and extracted comments. When source_text is provided, type declarations can be extracted from the original source for perfect fidelity.