aboutsummaryrefslogtreecommitdiff
path: root/src/RangeSet.zig
diff options
context:
space:
mode:
authorTom Read Cutting <moosichu@users.noreply.github.com>2023-02-19 12:14:03 +0000
committerGitHub <noreply@github.com>2023-02-19 14:14:03 +0200
commit346ec15c5005e523c2a1d4b967ee7a4e5d1e9775 (patch)
tree16f8b1bc34b30421f40c7d3b2aae5a770fe732b4 /src/RangeSet.zig
parent281d4c0ff6f95de0090f3621b4bdb651cd3d0330 (diff)
downloadzig-346ec15c5005e523c2a1d4b967ee7a4e5d1e9775.tar.gz
zig-346ec15c5005e523c2a1d4b967ee7a4e5d1e9775.zip
Correctly handle carriage return characters according to the spec (#12661)
* Scan from line start when finding tag in tokenizer This resolves a crash that can occur for invalid bytes like carriage returns that are valid characters when not parsed from within literals. There are potentially other edge cases this could resolve as well, as the calling code for this function didn't account for any potential 'pending_invalid_tokens' that could be queued up by the tokenizer from within another state. * Fix carriage return crash in multiline string Follow the guidance of #38: > However CR directly before NL is interpreted as only a newline and not part of the multiline string. zig fmt will delete the CR. Zig fmt already had code for deleting carriage returns, but would still crash - now it no longer does so. Carriage returns encountered before line-feeds are now appropriately removed on program compilation as well. * Only accept carriage returns before line feeds Previous commit was much less strict about this, this more closely matches the desired spec of only allow CR characters in a CRLF pair, but not otherwise. * Fix CR being rejected when used as whitespace Missed this comment from ziglang/zig-spec#83: > CR used as whitespace, whether directly preceding NL or stray, is still unambiguously whitespace. It is accepted by the grammar and replaced by the canonical whitespace by zig fmt. * Add tests for carriage return handling
Diffstat (limited to 'src/RangeSet.zig')
0 files changed, 0 insertions, 0 deletions