fix compiler error in 'std.fmt.Parser.until'#22129
Closed
saurabh-mish wants to merge 7 commits intoziglang:masterfrom
Closed
fix compiler error in 'std.fmt.Parser.until'#22129saurabh-mish wants to merge 7 commits intoziglang:masterfrom
saurabh-mish wants to merge 7 commits intoziglang:masterfrom
Conversation
Contributor
Author
Would it involve converting |
Member
|
No, it would look something like: pub fn until(self: *@This(), ch: u21) []const u8 {
const start = self.iter.i;
while (self.peek(0)) |code_point| {
if (code_point == ch)
break;
_ = self.iter.nextCodepoint();
}
return self.iter.bytes[start..self.iter.i];
} |
andrewrk
requested changes
Dec 10, 2024
Member
andrewrk
left a comment
There was a problem hiding this comment.
This kind of easily tested change should come with unit test coverage.
Member
|
Fair enough, none of the previous fixes in #20505 added any specific tests so I figured the existing usage as part of format strings would be sufficient. |
Contributor
Author
|
I've merged this PR with #22275 |
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.
Fixes
_ = &std.fmt.Parser.until;in #20505