-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Rewrite SubContext* rules and update tests #4621
base: dev
Are you sure you want to change the base?
Rewrite SubContext* rules and update tests #4621
Conversation
Signed-off-by: Jean-Christophe Jaskula <[email protected]>
Hi @parrt, would it be possible to get someone to review this PR? I could not find a better way to ask for a review. Thank you! |
Unfortunately I can't accept any more new targets to main repo; it's hard enough managing what I've got. especially since I just don't have time for this project at the moment. So, as it is on the way to accepting a new target, probably not worth me digging into this. Sorry!! |
I have seen previous messages mentioning you don't want to add new target. I was not expecting the Julia target to be added to the main repo and I totally understand why. However, these changes are minor (essentially 2-line modifications repeated across several targets) and they are eventually target-agnostic. It would help me keeping a sane repository that would contain only the Julia target and no antlr4 patch such that I can rebase with no conflict. This could be reviewed by any co-maintainer that is in charge of targets so I'll leave this PR open. But I'm also ready to disagree and commit if this change is really a no-no. |
I took a look and it seems fairly innocuous, but before I look further, I would like to know a bit more about why you have to do this for Julia and cannot find any other way? Also, hard coding for tests isn't the end of the world. But can you add a comment here that explains exactly why you have to do this? It may be a quirk of Julia, but requiring changes in other target templates usually does not pass the sniff test. But right now, there is no context for me to see why this is the only solution in Julia. |
Hey @jimidle, thanks for your reply. Let me take a different perspective on
AFAIU, the tests that I modified are supposed to be target- and implementation-agnostic but they are not eventually. More specifically,
implies that (i) That said, Julia is not oriented object and it is not natural to attach functions to
to
Ultimately, I could potentially find a way to make Worth mentioning I am not requesting changes of the other target generators but only test generators (I would have been much more uncomfortable to request changes on the |
I will need to look at why you need test changes for other targets though. It does not seem natural. I will try to give it some time and give Terence my recommendation. |
Sure, feel free to take your time. There is no rush as I won't probably be able to release the Julia target within weeks. |
I added an additional argument to
SubContextLocal
andSubContextMember
to avoid hardcoding indices in the test, i.e.To give more context, I have been able to create a runtime/generator for Julia. This is the only modification I need to push to the main Antlr4 repos to keep my implementation "standalone". The change will help me release my Julia runtime/generator eventually and I believe that it is transparent for all other target languages.
FYI, in Julia, I need to write
SubContextLocal
as: