scalameta / scalagen

WIP - Scalameta powered code generation
Apache License 2.0
40 stars 5 forks source link

Add Owner Trees #52

Closed DavidDudson closed 6 years ago

DavidDudson commented 6 years ago

This is the basis of the new Runner.

I've added the cats dependency as I feel it will create a lot of value when it comes to transforming trees. In particular, fold right here is actually a post-order traversal, thus we can fold into the new scalameta.Tree in post order fashion. I probably should add law verification and tests for those instances.

I have not added Monad/Reduce/Travese instances yet.

The OwnerTree is using a plain scalameta tree here for testing purposes. In reality, for the runner, this tree would be a GeneratorContext or similar, containing all necessary information.