backyard-generator 0.1.10

Convert AST node back to PHP code.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use backyard_generator::generate;
use backyard_parser::parse_eval;

#[test]
fn basic() {
  let arena = bumpalo::Bump::new();
  let asts = parse_eval(
    &arena,
    "$a = match($a) {
  'ucs2', 'utf-16' => 2,
  default => 1
};"
  ).unwrap();
  insta::assert_yaml_snapshot!(generate(&asts).unwrap());
}