commit 5d3d1c7f53aeacff01a6f2dfc48b1346b4521f13
parent 3c3519cf7dd91ec3032782a511c3f970d0302963
Author: Sebastian <sebastian@sebsite.pw>
Date: Fri, 11 Mar 2022 18:31:22 -0500
lex: remove TODO in ncmp
Prior to the sort function being called, checks have already been done
to guarantee that the identifiers will be valid ASCII, so there's no
need to handle any failure here (except by aborting).
Signed-off-by: Sebastian <sebastian@sebsite.pw>
Diffstat:
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/hare/lex/lex.ha b/hare/lex/lex.ha
@@ -149,12 +149,7 @@ fn is_name(r: rune, num: bool) bool =
fn ncmp(a: const *void, b: const *void) int = {
let a = a: const *str, b = b: const *str;
- match (ascii::strcmp(*a, *b)) {
- case void =>
- abort("non-ascii name"); // TODO: Bubble me up
- case let i: int =>
- return i;
- };
+ return strings::strcmp(*a, *b);
};
fn lex_unicode(lex: *lexer, loc: location, n: size) (rune | error) = {