Permit both versions 3.4 and 3.11 of ply - #455
Open
mandolaerik wants to merge 3 commits into
Open
Conversation
mandolaerik
commented
Sep 7, 2026
Contributor
- Rip out vestigial grammar rules
- Demand Ply 3.11 -- SIMICS-23703
- Permit both versions 3.4 and 3.11 of ply
These are unreachable with how ply 3.4 handles shift/reduce conflicts
Contributor
|
PR Verification: ❌ failure |
mandolaerik
force-pushed
the
pr/permit-both-versions-3-4-and-3-11-of-ply
branch
from
September 7, 2026 20:44
7ef495d to
83cc05a
Compare
Contributor
|
PR Verification: ✅ success |
mandolaerik
commented
Sep 8, 2026
Comment on lines
+57
to
+71
| tabmodule = "_dml%s_parsetab" % (''.join(map(str, version))) | ||
| tabfile = tabmodule + '.py' | ||
| if not os.path.isfile(tabfile): | ||
| # crude good-enough caching: | ||
| import tempfile | ||
| with tempfile.TemporaryDirectory(dir='.') as d: | ||
| parser = yacc.yacc( | ||
| module = dml.dmlparse.grammars[version], | ||
| tabmodule=tabmodule, | ||
| debug=False, | ||
| optimize=0, | ||
| outputdir=d) | ||
| import shutil | ||
| shutil.move(os.path.join(d, tabfile), tabfile) | ||
| sys.path.append('.') |
Contributor
Author
There was a problem hiding this comment.
The idea here is to write something horrible that is good enough to not cause any trouble until the definitive 3.11 bump. E.g., the move can probably cause a race on Windows, and in theory it is not sound to assume . is writable. But we will get away with it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.