mirror of
https://github.com/danbulant/oxc
synced 2026-05-25 12:51:57 +00:00
16 lines
527 B
Rust
16 lines
527 B
Rust
mod inject_global_variables;
|
|
mod replace_global_defines;
|
|
|
|
use oxc_allocator::Allocator;
|
|
use oxc_codegen::{CodeGenerator, CodegenOptions};
|
|
use oxc_parser::Parser;
|
|
use oxc_span::SourceType;
|
|
|
|
fn run(source_text: &str, source_type: SourceType) -> String {
|
|
let allocator = Allocator::default();
|
|
let ret = Parser::new(&allocator, source_text, source_type).parse();
|
|
CodeGenerator::new()
|
|
.with_options(CodegenOptions { single_quote: true, ..CodegenOptions::default() })
|
|
.build(&ret.program)
|
|
.code
|
|
}
|