hare

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

commit 732383144a66c247b6c732b1ce7f46342d340019
parent 5bbe0cab224f1712d46a5a1cc8016e6d3d23ba31
Author: Alexey Yerin <yyp@disroot.org>
Date:   Thu, 28 Apr 2022 20:02:41 +0300

cmd/harec: display error even if it includes invalid UTF-8

To be paired with the previous hare::lex patch.

Signed-off-by: Alexey Yerin <yyp@disroot.org>

Diffstat:
Mcmd/harec/errors.ha | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/harec/errors.ha b/cmd/harec/errors.ha @@ -34,7 +34,7 @@ fn printerr_syntax(err: lex::syntax) void = { let line = bufio::scanline(file) as []u8; defer free(line); - let line = strings::fromutf8(line); + let line = strings::fromutf8_unsafe(line); fmt::errorfln("{}:{},{}: Syntax error: {}", location.path, location.line, location.col, details)!; fmt::errorln(line)!;