antlr4 icon indicating copy to clipboard operation
antlr4 copied to clipboard

Export runtime version in Python3 runtime

Open xrmx opened this issue 2 years ago • 5 comments

To make it easier for runtime user to choose a generated parser compatible for the runtime. Runtime 4.10 broke compatibility with parser compiled with 4.7.2 that were working till 4.9.X and so a way to have the version is handy if one want to support multiple runtime in the same codebase.

Signed-off-by: Riccardo Magliocchetti [email protected]

xrmx avatar Apr 14 '22 18:04 xrmx

It makes sense for an end user. But it should be fixed for all runtimes, not only Python.

KvanTTT avatar Apr 14 '22 19:04 KvanTTT

I can add the same for Python2 and javascript easily, i can try to hack something for the rest of the runtimes but it'll take a bit.

xrmx avatar Apr 15 '22 07:04 xrmx

Since you've moved the version to a different file, you'll have to update this as well: https://github.com/antlr/antlr4/blob/master/scripts/files-to-update.txt

lbisceglia avatar Apr 18 '22 22:04 lbisceglia

Created a PR for Golang support: https://github.com/antlr/antlr4/pull/3671

lbisceglia avatar Apr 22 '22 16:04 lbisceglia

I think a lot of the runtimes already have the version information in the runtime metadata. E.g., https://github.com/antlr/antlr4/blob/master/runtime/Java/src/org/antlr/v4/runtime/RuntimeMetaData.java#L70

parrt avatar Jun 25 '22 17:06 parrt