hare

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

commit b184120fce117a3ced5f5340514541d74eb909f4
parent 46989986af14e7345f85b3f481030f8c7fe07dc4
Author: Sebastian <sebastian@sebsite.pw>
Date:   Sat, 14 May 2022 22:46:16 -0400

encoding::json: don't treat formfeed as whitespace

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

Diffstat:
Mencoding/json/lex.ha | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/encoding/json/lex.ha b/encoding/json/lex.ha @@ -334,7 +334,7 @@ fn nextrunews(lex: *lexer) (rune | io::EOF | error) = { for (true) { match (nextrune(lex)?) { case let rn: rune => - if (ascii::isspace(rn)) { + if (isspace(rn)) { continue; }; return rn; @@ -351,3 +351,5 @@ fn unget(lex: *lexer, r: rune) void = { }; fn iscntrl(r: rune) bool = r: u32 < 0x20; + +fn isspace(r: rune) bool = ascii::isspace(r) && r != '\f';