7 releases
0.1.10 | Dec 17, 2024 |
---|---|
0.1.9 | Dec 12, 2024 |
0.1.5 | Nov 29, 2024 |
#477 in Algorithms
723 downloads per month
415KB
11K
SLoC
backyard-generator
Convert AST node back to PHP code.
features
- Convert AST back to string (generate())
usage
let arena = bumpalo::Bump::new();
let code = r#"<?php
// leading comment
function hello_world($foo) {
var_dump($foo);
}"#;
let parsed = backyard_parser::parse(&arena, code).unwrap();
let generated = backyard_generator::generate(&parsed).unwrap();
println!("{:?}", generated);
Resulting this code:
// leading comment
function hello_world($foo) {
var_dump($foo);
}
ecosystem
- backyard-nodes (Node / AST, with builder, walker and printer)
- backyard-lexer (Tokenizer)
- backyard-parser
heavily inspired by
license
Dependencies
~1–1.8MB
~34K SLoC