0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/lib/std
Ian Johnson 9007534551 std.zig.tokenizer: simplify line-based tokens
Closes #21358
Closes #21360

This commit modifies the `multiline_string_literal_line`, `doc_comment`,
and `container_doc_comment` tokens to no longer include the line ending
as part of the token. This makes it easier to handle line endings (which
may be LF, CRLF, or in edge cases possibly nonexistent) consistently.

In the two issues linked above, Autodoc was already assuming this for
doc comments, and yielding incorrect results when handling files with
CRLF line endings (both in Markdown parsing and source rendering).

Applying the same simplification for multiline string literals also
brings `zig fmt` into conformance with
https://github.com/ziglang/zig-spec/issues/38 regarding formatting of
multiline strings with CRLF line endings: the spec says that `zig fmt`
should remove the CR from such line endings, but this was not previously
the case.
History 2024-09-10 13:34:33 +03:00
..
Build Merge pull request #21173 from mrjbq7/writeStackTrace 2024-08-31 20:57:27 -07:00
c std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
compress std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
crypto std.crypto.ml_kem: Reduce test iteration counts from 100 to 10. (#21285) 2024-09-02 23:20:48 +00:00
debug std.pdb: obey naming conventions 2024-08-29 23:43:52 +01:00
dwarf Dwarf: fix and test allowzero pointers 2024-08-17 05:57:45 -04:00
fmt std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
fs std.fs: Disable file operations on directories test on WASI. 2024-08-23 22:43:03 -07:00
hash std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
heap std: deprecate some incorrect default initializations 2024-09-01 17:34:07 +01:00
http add std.http.WebSocket 2024-08-07 00:48:32 -07:00
io std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
json Support stringifying non-exhaustive enum to json (#21228) 2024-09-07 11:06:41 -04:00
math std.math.big.int: fix shiftRight sign handling 2024-09-06 10:36:12 -07:00
mem std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
meta std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
net std.net, std.http: simplify 2024-02-23 02:37:11 -07:00
os std: Fix assembler comment syntax for sparc. 2024-09-07 13:16:22 -07:00
posix std.posix: Skip a couple of tests that use fstat()/fstatat() on riscv32. 2024-09-06 20:03:15 +02:00
process std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
Random add std.testing.random_seed 2024-07-23 11:43:12 -07:00
sort compiler,lib,test,langref: migrate @setCold to @branchHint 2024-08-27 00:44:35 +01:00
tar std.tar: add writer (#19603) 2024-08-15 22:05:53 -07:00
Target std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
testing std: enable FailingAllocator to fail on resize 2023-09-06 19:06:32 +03:00
Thread compiler,lib,test,langref: migrate @setCold to @branchHint 2024-08-27 00:44:35 +01:00
time std.time.epoch: Fix comments referring to epoch as 1970-10-01 2024-08-15 17:54:27 -07:00
tz Support legacy TZ format, expose header struct to a potential writer 2022-01-01 12:47:08 +00:00
unicode all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
valgrind port cachegrind.h to zig (#19241) 2024-08-23 22:59:30 -07:00
zig std.zig.tokenizer: simplify line-based tokens 2024-09-10 13:34:33 +03:00
zip std: Convert deprecated aliases to compile errors and fix usages 2024-06-13 10:18:59 -04:00
array_hash_map.zig std: deprecate some incorrect default initializations 2024-09-01 17:34:07 +01:00
array_list.zig std: deprecate some incorrect default initializations 2024-09-01 17:34:07 +01:00
ascii.zig Rename isASCII to isAscii 2024-07-02 16:31:15 +02:00
atomic.zig Merge pull request #20870 from alexrp/target-cleanup-3 2024-08-01 01:32:32 -07:00
base64.zig stdlib : base64 encode to writer (#20961) 2024-09-04 08:10:12 +00:00
bit_set.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
BitStack.zig std: fix typos (#20560) 2024-07-09 14:25:42 -07:00
bounded_array.zig Revert "Smaller memory footprint for BoundedArray (#16299)" 2024-08-23 22:30:10 -07:00
buf_map.zig lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
buf_set.zig Change many test blocks to doctests/decltests 2024-02-26 15:18:31 -08:00
Build.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
builtin.zig Merge pull request #21173 from mrjbq7/writeStackTrace 2024-08-31 20:57:27 -07:00
c.zig std.c: fix pthread_mutex_t size for x86_64-linux-gnu 2024-09-01 00:44:09 -07:00
coff.zig std.{coff,elf}: Remove the {MachineType,EM}.toTargetCpuArch() functions. 2024-08-23 19:56:24 +02:00
compress.zig improve documentation in std 2024-03-10 18:13:30 -07:00
crypto.zig Rename the namespace for ml_kem variants of Kyber to nist 2024-08-22 07:54:12 +02:00
debug.zig std: make debug.dumpStackPointerAddr compile 2024-09-01 00:45:31 -07:00
dwarf.zig Dwarf: cleanup emitted debug info 2024-08-22 08:44:08 +02:00
dynamic_library.zig std.DynLib: Prefer std.fs.File.stat() over posix.fstat(). 2024-09-06 20:03:15 +02:00
elf.zig std.elf: Bring the EM enum up to date. 2024-09-03 17:44:01 -07:00
enums.zig std: avoid field/decl name conflicts 2024-08-29 20:39:11 +01:00
fifo.zig std: promote tests to doctests 2024-03-21 14:11:46 -07:00
fmt.zig std.fmt: Update casing of a few functions to match naming style guide 2024-09-08 11:30:20 -07:00
fs.zig std.fs.Dir: Refactor atomicSymLink from std.fs 2024-07-28 20:08:52 -07:00
gpu.zig std: add gpu namespace 2024-02-05 11:55:14 +03:30
hash.zig XXH3 Implementation for Zig STD (#17530) 2023-10-17 13:55:01 -05:00
hash_map.zig std.hash_map: fix error message in getAutoHashFn 2024-09-02 12:09:10 +03:00
heap.zig std.c reorganization 2024-07-19 00:30:32 -07:00
http.zig add std.http.WebSocket 2024-08-07 00:48:32 -07:00
io.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
json.zig Delete compile errors for deprecated decls 2024-05-03 13:27:30 -07:00
leb128.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
linked_list.zig Revert "std.SinglyLinkedList: add sort function" 2023-11-24 22:33:50 -07:00
log.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
macho.zig remove hard tabs from source code 2024-07-31 16:57:42 -07:00
math.zig std.math: rename make_f80 to F80.toFloat and break_f80 to F80.fromFloat 2024-09-02 00:10:22 +03:00
mem.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
meta.zig std: avoid field/decl name conflicts 2024-08-29 20:39:11 +01:00
multi_array_list.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
net.zig std.c reorganization 2024-07-19 00:30:32 -07:00
once.zig compiler,lib,test,langref: migrate @setCold to @branchHint 2024-08-27 00:44:35 +01:00
os.zig std.c reorganization 2024-07-19 00:30:32 -07:00
packed_int_array.zig chore: correct non-standard comments. 2024-07-28 21:34:14 -07:00
pdb.zig std.pdb: obey naming conventions 2024-08-29 23:43:52 +01:00
posix.zig remove length assertion from mprotect 2024-08-31 20:59:47 -07:00
priority_dequeue.zig add std.testing.random_seed 2024-07-23 11:43:12 -07:00
priority_queue.zig std: fix typos (#20560) 2024-07-09 14:25:42 -07:00
process.zig move std.zig.fatal to std.process.fatal 2024-07-20 01:06:28 -07:00
Progress.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
Random.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
RingBuffer.zig std.RingBuffer: use sliceAt/sliceFirst in read*AssumeLength 2024-03-10 18:17:23 +11:00
segmented_list.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
SemanticVersion.zig Change many test blocks to doctests/decltests 2024-02-26 15:18:31 -08:00
simd.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
sort.zig std.sort: Remove key argument from binary-search-like functions (#20927) 2024-08-04 22:02:15 +00:00
start.zig start: Fix arm stack alignment code to work for thumb too. 2024-08-31 03:38:35 +02:00
static_string_map.zig std.static_string_map: Cast length of input for runtime initialization 2024-06-20 23:22:39 +00:00
std.zig std: Convert deprecated aliases to compile errors and fix usages 2024-06-13 10:18:59 -04:00
tar.zig std.tar: add writer (#19603) 2024-08-15 22:05:53 -07:00
Target.zig std.elf: Bring the EM enum up to date. 2024-09-03 17:44:01 -07:00
testing.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
Thread.zig std: Fix assembler comment syntax for sparc. 2024-09-07 13:16:22 -07:00
time.zig std.time: Use clock_nanosleep() to implement sleep() on Linux. 2024-09-06 20:03:12 +02:00
treap.zig Condense and extend std.Treap's traversal functionalities. (#20002) 2024-07-28 19:47:55 -07:00
tz.zig std.builtin.Endian: make the tags lower case 2023-10-31 21:37:35 -04:00
unicode.zig std: update eval branch quotas after bdbc485 2024-08-21 01:30:46 +01:00
Uri.zig std.http.Client: always omit port when it matches default 2024-04-12 22:37:07 -07:00
valgrind.zig port cachegrind.h to zig (#19241) 2024-08-23 22:59:30 -07:00
wasm.zig Remove redundant test name prefixes now that test names are fully qualified 2024-02-26 15:18:31 -08:00
zig.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
zip.zig std.zip: Fix typo in doc comments 2024-06-17 16:12:19 -04:00