mirror of
https://github.com/ziglang/zig.git
synced 2024-11-27 07:32:44 +00:00
fix assuming multiline string tokens end with '\n'
This commit is contained in:
parent
a92b144260
commit
5d8f8cdca5
@ -990,9 +990,15 @@ fn tokenizeAndPrintRaw(
|
||||
},
|
||||
|
||||
.multiline_string_literal_line => {
|
||||
if (src[token.loc.end - 1] == '\n') {
|
||||
try out.writeAll("<span class=\"tok-str\">");
|
||||
try writeEscaped(out, src[token.loc.start .. token.loc.end - 1]);
|
||||
try out.writeAll("</span>" ++ end_line ++ "\n" ++ start_line);
|
||||
} else {
|
||||
try out.writeAll("<span class=\"tok-str\">");
|
||||
try writeEscaped(out, src[token.loc.start..token.loc.end]);
|
||||
try out.writeAll("</span>");
|
||||
}
|
||||
},
|
||||
|
||||
.builtin => {
|
||||
|
Loading…
Reference in New Issue
Block a user