scalagen
scalagen copied to clipboard
Functional visitor, Java 8, comments
Hi @timowest,
I've dug much deeper than I initially planned and made quite some changes to scalagen, but I hope they pay off:
- I replaced the Maven build by an SBT one which gives much nicer compilation speed and other goodies and is the de facto standard for most Scala projects.
- I transformed the statefull
ScalaDumpVisitor
into a statelessScalaStringVisitor
which instead of modifying a localSourcePrinter
returnsString
s in allvisit
methods. - Formatting is now handled by Scalafmt which gives much more flexibility on how to format code and reduces the complexity of scalagen a little.
- The Java parser library is updated to a version that supports Java 8 and the corresponding
visit
methods implemented, so we should be able to transform Java 8 code (most likely there's some bugs in there, which we can fix as we discover them) - Comments are copied as good as possible. There's still some edge cases where they can get lost, especially when multiple comments occur in a row.
It would be great if you could have a look at this so we can start discussing on how to integrate and release this. If I have time, I'll publish a build on Bintray so that people can already start trying this out and finding bugs :wink:
Phew, that was a journey! :smile:
As the maintainer of JavaParser I would say: PLEASE merge this because your dependency is way out of date!