Kotlin / kotlin-spec

Kotlin Language Specification:
https://kotlinlang.org/spec
Apache License 2.0
387 stars 80 forks source link

Inconsistency in package declaration and actual filessytem folder #126

Closed simonegiacomelli closed 5 months ago

simonegiacomelli commented 5 months ago

Hello! Thank you for this great project! It allowed us to automate a very important piece of our i18n toolchain (more details below).

I noticed there is a discrepancy between the declared package: org.jetbrains.kotlin.spec.grammar and the actual generated source folder by anltr: File("${project.rootDir}/grammar/src/main/java/org/jetbrains/kotlin/spec/grammar/parser")

You can notice that the filesystem path has an additional parser at the end. This are the pertinent lines of build.gradle.kts

We are using this project to parse kotlin files to automatically generate i18n files from constants; in a similar way to the gnu gettext. What we do in our build files, after cloning this repo, is patching the above mentioned build file to reflect the actual path. Then we can proceed to parse all our kotlin sources in order to collect all string constants (that matches the gettext/i18n pattern).

I can provide a pull request for to fix this. It is a small change but I don't know if it will break some of your tests or scripts down the line.

Thanks!

ice-phoenix commented 5 months ago

Hi mate, thanks for finding this inconsistency! I do not think we actually rely on the .../grammar/parser path anywhere, and it would be relatively easy to check. If you could do the PR, we'll take a look. Thanks!

simonegiacomelli commented 5 months ago

I just created the pull request #127

ice-phoenix commented 5 months ago

Thanks for your contribution, looks like the change does not break anything :+1: