A pretty printer for MoonBit AST - converts parsed AST back to source code
Dependencies
{
"deps": {
"mizchi/ast_printer": "0.1.0"
}
}let source = "fn hello() -> String { \"hello\" }"
let parsed = @moonbitlang/parser.parse_string(source)
// Print back to source code (returns None if parse errors)
let result : String? = @mizchi/ast_printer.print_code(parsed)
// Or print AST directly
let (impls, _) = parsed
let code : String = @mizchi/ast_printer.print_impls(impls)A pretty printer for MoonBit AST - converts parsed AST back to source code
Dependencies