Add support for #@elif
clauses in Test
files
#5960
Merged
+405
−18
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.
This PR adds the behaviour requested in #5652 by supporting
#@elif
clauses in test files.Resolves #5652
Text for release notes
See title.
Further details
The behaviour is implemented by modifying the existing state machine used for parsing
#@if ... #@else ... #@fi
statements inParseTestInput
. This is done in a way where the state transitions are identical to what they were prior to this PR in tests using only#@if
and#@else
clauses. So, this change should be backwards compatible with existing test cases and shouldn't introduce new bugs in test cases that do not use#@elif
.The only other potential issue might be in test cases that have
#@elif
as an output line, e.g.is a valid test case prior to this PR, but after this PR it would lead to a test case syntax error when parsing. I was not able to find any such instances in the
gap
codebase, or the codebase of any packages we distribute. So I think its ok to call the change backwards compatible.