S_parse_ident: Apply flag only to first loop iteration #23863
Merged
+17
−2
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.
Fixes #23861
This special case of an all numeric identifier doesn't apply to a multi-component package variable. In "Swish::3::", the 3 is not the first component, and so should not be special cased. Therefore turn off the special handling before looping for a subsequent component.
In d2a0fb8, I moved some code into a called function, adding a flag for the function to specially treat this case as the caller had done. It was my intent that there be no change in behavior. But, the called function differs from the original, in that it can loop, gathering each component of a package variable. I overlooked that possibility, and our test suite lacked a test for this situation.
The called function is not an exact fit with what the caller did; hence the new flag. But it had enough overlap that it avoided some duplication of code; and allowed for the caller to be simplified. And there is another case in the caller that repeated nearly duplicate code so that a later commit changed to use this function, further simplifying things.