-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Scala frontend #570
Add Scala frontend #570
Conversation
# Conflicts: # pom.xml
# Conflicts: # README.md # jplag/pom.xml # jplag/src/main/java/de/jplag/options/LanguageOption.java # pom.xml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some first comments.
jplag.frontend.scala/src/test/java/de/jplag/scala/ScalaFrontendTest.java
Outdated
Show resolved
Hide resolved
It turns out the IDE settings kept me from successfully upgrading to Scala 2.13, which I now succeeded in doing. Scalameta, the parser library used here, is in development for Scala 3, but not released yet, so it seems that we have to wait for that until Scala 3 can be fully supported. |
jplag.frontend.scala/src/main/scala/de/jplag/scala/ScalaToken.scala
Outdated
Show resolved
Hide resolved
jplag.frontend.scala/src/main/scala/de/jplag/scala/Language.scala
Outdated
Show resolved
Hide resolved
jplag.frontend.scala/src/test/java/de/jplag/scala/ScalaFrontendTest.java
Outdated
Show resolved
Hide resolved
…bbreviated identifiers
Kudos, SonarCloud Quality Gate passed! |
This PR adds a Scala frontend to JPlag. It comes with some test files and a README which explains various design choices that can be considered for maintenance.
The frontend only supports Scala 2.12 so far. Maybe it can be upgraded to Scala 3 easily in a collective effort, I certainly failed to do it! In that case, a few more token types might be necessary.
Besides the difficulties with the syntax discussed in the README, the token set and the abstraction are designed along the lines of other frontends.
As the parser takes a different approach that reduces code repetition, it should be considered if the parser mechanism is redesigned in the future.
Addressing #345, #568