Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
astgen: forbid trailing whitespace in multiline strings
Trailing whitespace in multiline strings is annoying for all the usual reasons trailing whitespace is annoying (unrelated line changes). However, in this case it even can leak into whatever the string literal is used for. For example, in the previous commit there is trailing whitespace leaking into the help messages. So it makes sense to forbid this outright. `zig fmt` intentionally doesn't try to clean up here --- if there's a trailing whitespace in a multiline literal, it is _ambiguous_ whether the user added that by accident, or whether they _intended_ to have a space there. If you need to have trailing whitespace, you can contatenate `\\` and `"` strings with `++`: const S = \\hello ++ " \n" ++ \\world \\ ; Closes: ziglang#19299
- Loading branch information