Skip to content
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

Fixes for #3539--clean up of python3 grammars #3540

Merged
merged 21 commits into from
Jul 8, 2023
Merged

Fixes for #3539--clean up of python3 grammars #3540

merged 21 commits into from
Jul 8, 2023

Conversation

kaby76
Copy link
Contributor

@kaby76 kaby76 commented Jun 19, 2023

This PR is a fix for #3539, or at least partially. The plan is to make additional changes later on. For now, the focus is making sure we have most of the targets for the python/python3 grammar, and remove as many of the "python3-*" forked grammars. The whole point is to try to get the Python3 grammars in less of a chaotic state, and easier to maintain.

python/python3 grammar

  • All tests in examples/ were partitioned into "large/" and "small/" piles because the parser for some targets is slow. It is likely caused by problems in the grammar, but I haven't focused on fixing the grammar yet.
  • The Cpp target works. I moved some of the code from the python3-cpp to the target source and deleted the fork.
  • The CSharp target works. The source code was reformatted.
  • The Dart target works, but ... it is not in the Github Actions CI testing because the Antlr Dart runtime needs to be fixed, likely only when Antlr 4.14.0 is released in the late fall 2023. [Dart] Fix for #4320--export additional types antlr4#4340
  • The PHP target does not work.
  • The Java target works. No changes.
  • The JavaScript target works.
  • The Python3 target works. The forked grammar python3-py was deleted.
  • The Typescript target works. The original code in python3-ts used a different Antlr4 Typescript runtime. The code now uses the official Antl4 Typescript runtime. Although the code is usable now, there is a minor problem in the API that should be fixed in Antlr 4.14.0. [typescript] Runtime declares CommonToken(source, .....) wrong. antlr4#4318
  • The Go target works, but requires a fix to the Go Antlr runtime. [Go] Fix for #4342--EmitToken(token) in Go target needs to be exported antlr4#4343

All other "python3" grammars

kaby76 added 3 commits July 1, 2023 22:12
This port works but only if the Go runtime is fixed, and "Virt" is assigned in the driver. See antlr/antlr4#4343 antlr/antlr4#4342
@kaby76 kaby76 marked this pull request as ready for review July 3, 2023 15:07
@kaby76 kaby76 changed the title Fixes for #3539 Fixes for #3539--clean up of python3 grammars Jul 3, 2023
@teverett
Copy link
Member

teverett commented Jul 8, 2023

@kaby76 thanks!

@teverett teverett merged commit d586ae8 into antlr:master Jul 8, 2023
@KvanTTT KvanTTT added the python2 label Jul 9, 2023
@KvanTTT KvanTTT added the python3 label Jul 9, 2023
rvrooman-codelogic pushed a commit to CodeLogicIncEngineering/grammars-v4-public-fork that referenced this pull request Jul 27, 2023
* Fixes for antlr#3539

Typescript cannot work because the declaration of the constructor for CommonToken() is wrong.

* Fix python/python3/TypeScript

* Remove grammars that only add to confusion.

* Update Dart port, but this cannot work because Antlr 4.13.0 Dart runtime missing types.

* Add Dart port for python3 grammar.

This base class for Dart works, but requires changes to Antlr. antlr/antlr4#4321

* Updates, but incomplete, for Cpp.

* Additional changes.

* Updates to get Cpp target to link.

* Changes for working Cpp target.

* Add in Cpp to workflow.

* Updates.

* Adjust to for rebuild.

* Remove bothersome tabs from source code.

* Rename tests into "small" and "large" tests to reflect that "slow parsers work on the small test suite".

* Fix names of test directories in desc.xml.

* Update for Go target. Remove python3-cpp.

* Getting Go target compiling--does not work yet.

* Fixes for Go target of python3 grammar.

This port works but only if the Go runtime is fixed, and "Virt" is assigned in the driver. See antlr/antlr4#4343 antlr/antlr4#4342

* Fix desc.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants