Skip to content

WIP: fix: multiline string literals - #2032

Closed
mnemnion wants to merge 1 commit into
zigtools:masterfrom
mnemnion:fix-21358-21360
Closed

WIP: fix: multiline string literals#2032
mnemnion wants to merge 1 commit into
zigtools:masterfrom
mnemnion:fix-21358-21360

Conversation

@mnemnion

Copy link
Copy Markdown
Contributor

Fix for Zig #21358, #21360, which change tokenizing of multiline string literals to not include newlines. See ziglang/zig#21371.

This just changes the tokenizer, ZLS no longer SIGKILLs immediately, the integer underflow is gone from the tests, but several tests don't pass (which is to be expected).

I wanted to get some eyes on the fix, since I'm unfamiliar with the codebase, before trying to modify the tests to pass. Changing tests to pass a newly introduced bug would be unfriendly, after all.

Also, the fix includes doc comments, I don't think that affects ZLS the same way, but I could be wrong and it seemed worth mentioning.

Fix for Zig #21358, #21360, which change tokenizing of multiline
string literals to not include newlines.
@Techatrix

Techatrix commented Sep 15, 2024

Copy link
Copy Markdown
Member

I think you missed #2031. Note that the newline is not longer included when calling tokenSlice but it still needs to be included when calculating the length of the multi-line string. The - 2 is included because of the \\.

@mnemnion

Copy link
Copy Markdown
ContributorAuthor

Yes, I was on a commit from yesterday (last week actually dd78968), it looks like you got the fix in right when I started looking into it.

Since there's no need for this branch, I'll close it.

@mnemnion
mnemnion deleted the fix-21358-21360 branch September 15, 2024 17:27
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@mnemnion@Techatrix