Allow version to accept the '=' token without activating lexer switch#32257
Merged
becker33 merged 50 commits intospack:developfrom Sep 14, 2022
psakievich:parser-work
Merged
Allow version to accept the '=' token without activating lexer switch#32257becker33 merged 50 commits intospack:developfrom psakievich:parser-work
becker33 merged 50 commits intospack:developfrom
psakievich:parser-work
Conversation
Contributor
Author
|
@spackbot fix style |
|
Let me see if I can fix that for you! |
|
I was able to run spack style --fix==> Running style checks on spack
selected: isort, mypy, black, flake8
==> Modified files
lib/spack/spack/spec.py
lib/spack/spack/test/spec_syntax.py
==> Running isort checks
isort checks were clean
==> Running mypy checks
Success: no issues found in 556 source files
mypy checks were clean
==> Running black checks
All done! ✨ 🍰 ✨
2 files left unchanged.
black checks were clean
==> Running flake8 checks
flake8 checks were clean
==> spack style checks were clean
I wasn't able to make any further changes, but please see the message above for remaining issues you can fix locally! |
psakievich
commented
Sep 2, 2022
Contributor
Author
Contributor
Author
|
@spackbot fix style |
|
Let me see if I can fix that for you! |
|
I was able to run spack style --fix==> Running style checks on spack
selected: isort, mypy, black, flake8
==> Modified files
lib/spack/spack/spec.py
lib/spack/spack/test/spec_syntax.py
==> Running isort checks
isort checks were clean
==> Running mypy checks
Success: no issues found in 558 source files
mypy checks were clean
==> Running black checks
reformatted lib/spack/spack/test/spec_syntax.py
All done! ✨ 🍰 ✨
1 file reformatted, 1 file left unchanged.
black checks were clean
==> Running flake8 checks
flake8 checks were clean
==> spack style checks were clean
I've updated the branch with isort fixes. |
Contributor
Author
|
@spackbot re-run pipeline |
|
I've started that pipeline for you! |
becker33
approved these changes
Sep 14, 2022
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.
Closes #32184. That PR seems to have been corrupted due to an unfortunate rebase.
This PR will address the issue of
GitVerionswith assigned refs that inspired the creation of #32184but it will also make the parser behave in a more targeted manner when dealing with the=token. This is done by giving higher precedent, targeted tokens for the cases where we want to glob several commands together (ldlibs, compiler flags and targets).This should make the parser behave more cleanly when the=token is encountered since it is only the targeted tokens that will trigger the switch in behavior.After back and forth it was decided that we should change the lexing specifically for versions to allow a version token to accept the entire string. This adds additional complexity because there are two layers of lexing:
These two lexers treat spaces differently and so additional logic is required when there are spaces around the
@. Another side effect is that different combinations of tokens can ultimately parse the same spec. A fun exercise is to go through the git history of this PR and see how I discover this over time.The net result should be the same as #32437 minus the extra
@in the token. If this is acceptable then I will change #32437 to just be the fixes for submodules with GitRef versions and the other small bug fixes.@becker33 and @tgamblin