hare

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

commit 6cdd397ddba871ec08b248586abe44ff8a7c2c27
parent 762926142712b609a448c08eb4e07291107718af
Author: Sebastian <sebastian@sebsite.pw>
Date:   Fri,  8 Apr 2022 15:09:05 -0400

lex: more efficient comment building

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

Diffstat:
Mhare/lex/lex.ha | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hare/lex/lex.ha b/hare/lex/lex.ha @@ -368,9 +368,9 @@ fn lex_comment(lexr: *lexer) (void | error) = { break; }; }; - let new = strings::concat(lexr.comment, strio::string(&buf)); - free(lexr.comment); - lexr.comment = new; + let bytes = strings::toutf8(lexr.comment); + append(bytes, strings::toutf8(strio::string(&buf))...); + lexr.comment = strings::fromutf8(bytes); }; fn lex_literal(lex: *lexer) (token | error) = {