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

Generator doesn't honor Python 3 minor versions using typing.io imports #477

Closed
PeterTillema opened this issue Sep 8, 2021 · 1 comment

Comments

@PeterTillema
Copy link

PeterTillema commented Sep 8, 2021

When you run "Generate ANTLR Recognizer..." the lexer output file has

from typing.io import TextIO

in its header, while doing it yourself yields

if sys.version_info[1] > 5:
	from typing import TextIO
else:
	from typing.io import TextIO

The upper one is clearly wrong, as it's dependent on the minor version of Python 3.

@bjansen
Copy link
Collaborator

bjansen commented Oct 5, 2021

This looks like a different version between what's shipped in the plugin and what you're using when you generate the parser yourself. The header you're mentioning was introduced in february and released in ANTLR 4.9.2 according to GitHub.
The IntelliJ plugin is still shipping ANTLR 4.9.1, I'll prepare a new version with the latest ANTLR.

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

No branches or pull requests

2 participants