Expand description
Pretty printer for PHP AST — converts parsed AST back to PHP source code.
§Example
let arena = bumpalo::Bump::new();
let result = php_rs_parser::parse(&arena, "<?php echo 1 + 2;");
let output = php_printer::pretty_print(&result.program);
assert_eq!(output, "echo 1 + 2;");Structs§
- Printer
Config - Configuration for the pretty printer.
Enums§
- Indent
- Indentation style.
Functions§
- pretty_
print - Pretty-print a program’s statements (without
<?phpheader). - pretty_
print_ file - Pretty-print a complete PHP file (prepends
<?php\n\n). - pretty_
print_ with_ config - Pretty-print with custom configuration.