-
Notifications
You must be signed in to change notification settings - Fork 66
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
Use grammars from the TS project for C++ port testing #161
Conversation
Signed-off-by: vityaman <vityaman.dev@yandex.ru>
Signed-off-by: vityaman <vityaman.dev@yandex.ru>
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.
If you remove purespecifier
, is that still a valid C++ grammar? The keypoint for the tests was not to change the grammars but work around problems (to also demonstrate what to do if you cannot change a grammar).
@mike-lischke, hmm, I thought the purpose is just to show that c3 works even with such complex examples. Ok, then I will think how to reuse this grammar without changing it. Maybe will use some script to patch it or come up with some other solution. |
Signed-off-by: vityaman <vityaman.dev@yandex.ru>
@mike-lischke, I edited the Cpp14 grammar to workaround language dependency. |
Signed-off-by: vityaman <vityaman.dev@yandex.ru>
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.
There's no way to work with the C++ grammar unchanged? The point is not only having a complex example, but also to find a way to work around certain grammar rules which make it difficult to get candidates easily.
And then you remove some of the generated files (good!) but left in and changed some (why?).
And finally, why did you remove the whitebox grammar? I would expect you to implement the entire TS test suite.
@vityaman are you going to address my questions? |
@mike-lischke, sorry, currently overwhelmed with university tasks. I will continue working on this MR on January 29th. About C++ grammar. Originally it uses embedded code in TS, which is not valid C++ code and therefore requires patching to generate C++ parser. So I see only 2 options to deal with this state: either change the grammar or write some python script to patch it. About deletion of the Whitebox grammar. It seems to me, that I deleted all grammars from ports/cpp/tests, but left all grammars at TS tests. About added generated files. I made these changes before merging an MR with removal and ignorance of generated sources, so I need to rebase on the main branch. |
Signed-off-by: vityaman <vityaman.dev@yandex.ru>
Signed-off-by: vityaman <vityaman.dev@yandex.ru>
@mike-lischke, the MR is considered ready. Sorry for a long absence, I just forgot about this MR. I synced the branch with the main, so now diff looks as expected: just removed copy-pasted grammars from C++ port, changes in C++ port build configuration and C++ grammar changes. I left C++ grammar changed as it is still valid C++ grammar with the same semantics and leaving it like this is much more simpler than writing patches potentially for each language port. |
@vityaman Looks like you need to rebase first. |
@mike-lischke, GitHub says that there are no conflicts with the base branch. Can you just squash all commits from this MR into a single one on merge? |
Odd, but the squash merge worked. Thanks! |
Once, I was surprised with different ATN State numbers in program traces of C++ and TS ports, but the problem was in different grammar files usage, so I decided to share grammars between ports to prevent copy-paste problems in the future.