hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 89d0aa44455c10eee999798103f46cb1fb3a58d1
parent 450bb249bc646113c24d74b498d01a1f3664d970
Author: Sebastian <sebastian@sebsite.pw>
Date:   Tue, 17 Oct 2023 21:09:10 -0400

bufio: document that scan result omits delimiter

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Mbufio/scanner.ha | 14++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/bufio/scanner.ha b/bufio/scanner.ha @@ -147,9 +147,10 @@ export fn scan_byte(scan: *scanner) (u8 | io::EOF | io::error) = { return scan_consume(scan, 1)[0]; }; -// Reads the next token from a [[scanner]], delimited by delim. The return value -// is borrowed from the internal scanner buffer, which is invalidated during -// subsequent operations which use this scanner. +// Reads the next token from a [[scanner]], delimited by delim. The delimiter is +// read from the source handle but not included in the returned slice. The +// return value is borrowed from the internal scanner buffer, which is +// invalidated during subsequent operations which use this scanner. export fn scan_bytes( scan: *scanner, delim: (u8 | []u8), @@ -233,9 +234,10 @@ export fn scan_rune( }; }; -// Scans a string of text from a [[scanner]] up to some delimiter. The return -// value is borrowed from the internal scanner buffer, which is invalidated -// during subsequent operations which use this scanner. +// Scans a string of text from a [[scanner]] up to some delimiter. The delimiter +// is read from the source handle but not included in the returned string. The +// return value is borrowed from the internal scanner buffer, which is +// invalidated during subsequent operations which use this scanner. export fn scan_string( scan: *scanner, delim: str,