xp-framework / compiler

Compiles future PHP to today's PHP.
19 stars 0 forks source link

Transform multiple nodes without creating statements #175

Closed thekid closed 1 year ago

thekid commented 1 year ago

Otherwise the following would generate a ; following a method, which is a syntax error.

// Transform one method to two
$emitter->transform('method', function($codegen, $node) {
  yield null => new Method(...);
  yield null => new Method(...);
});

This can be considered a workaround, it would be better to have Statement nodes, but this would be a significant refactoring!

thekid commented 1 year ago

Released in https://github.com/xp-framework/compiler/releases/tag/v8.16.0