-
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
C++ target: don't generate extra/duplicate semicolons #2806
Conversation
Ping @mike-lischke |
I have worked on that as well in past. The problem here is the recursive nature of these ST rules. I couldn't solve the double semicolons. I can promise you that the removal of the few semicolons as in your patch won't provide a complete solution. You will now end sometimes with no semicolon at all for certain statements. Unfortunately, I can't say for which. You should definitely test your patch with a complex grammar (say CPP14 or the complete MySQL grammars) to see if something is missing. |
Hi Mike, I tested with this C++14 grammar: https://github.com/antlr/grammars-v4/blob/master/cpp/CPP14.g4
And with this MySQL grammar: https://github.com/mysql/mysql-workbench/tree/8.0/library/parsers/grammars
|
OK, then let's hope we covered all relevant cases in the tests. |
Thanks for the positive feedback. |
some tests are failing but I think it is just DART. I added an issue for them to fix that so we can proceed. it might be hiding an error here. #2881 |
Okay, we have the fix. I think I have to kick off another build |
Hmm...i've pulled in a fix for dart from @lingyv-li but can't seem to kick off a new build for this PR. anybody know how? |
I just rebased my branch, that hopefully triggers a new build |
Thanks Terence! |
This change breaks the build, see https://travis-ci.org/github/antlr/antlr4/jobs/726751569 |
Now that's odd. Why has this PR no test run, actually? Looks like Travis never ran for this patch o_O And what's even worse is that this patch is already 24 days old. In the meantime we had quite a few other merges. |
It looks like the Github project is only configured to show the appveyor builds, not the travis builds... I'm fine with reverting this until I can investigate, if that's the quickest way to fix this. |
@parrt seems only you can fix the travis status no longer shown in GitHub PRs, cox it requires to be admin of the travis project |
I wondered why those builds weren't shown. shit. i revoked and now can't get travis back to github. ugh. |
suspect GitHub changed their security policies |
i'm very confused. seems they are migrating us to .com from .org or were we doing .com before? i can't find travis-ci.org -> github integration instructions. |
Builds show up on .org site so that's what we were using. |
we were definitely on .org |
ok, i think i have it reinstalled. |
I'm looking into the regression due to this PR. |
ok, can we kick off a build from a PR to see if it updates the github page? |
Started an empty PR here: #2907 |
Thanks @parrt ! |
Oh, can you please investigate. We had a patch recently which might have to do with that (just guessing here). |
Will do! The issue reported by @ericvergnaud should be fixed now with #2907. The travis build is not showing the other issues I mentioned / am experiencing locally (due to #2839 ?), probably because we're running an extremely old version of GCC (version 5) on an extremely old version of Ubuntu (14.04) for the travis build. I'll create a separate pull request to use newer versions for the travis build, we'll see if the issues show up then. |
Currently, the generated C++ source code contains sporadic duplicate semicolons, e.g.:
This requires the use of
-Wno-extra-semi
with-Werror
.This PR removes the duplicate semicolons.
(Full disclosure: I couldn't figure out where the second semicolon is generated...)