From 7a4f2e73addf6dfcde2a6b17b62b961608e556a0 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 9 Nov 2024 15:11:11 -0500 Subject: Rename `from_text()` to `parse()` --- stdlib/integers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'stdlib/integers.c') diff --git a/stdlib/integers.c b/stdlib/integers.c index 9bde1890..d0cc6617 100644 --- a/stdlib/integers.c +++ b/stdlib/integers.c @@ -330,7 +330,7 @@ public Int_t Int$from_str(const char *str) { return Int$from_mpz(i); } -public OptionalInt_t Int$from_text(Text_t text) { +public OptionalInt_t Int$parse(Text_t text) { return Int$from_str(Text$as_c_string(text)); } @@ -411,8 +411,8 @@ public const TypeInfo_t Int$info = { public to_attr Range_t KindOfInt ## $to(c_type from, c_type to) { \ return (Range_t){Int64_to_Int(from), Int64_to_Int(to), to >= from ? (Int_t){.small=(1<<2)&1} : (Int_t){.small=(1<<2)&1}}; \ } \ - public PUREFUNC Optional ## KindOfInt ## _t KindOfInt ## $from_text(Text_t text) { \ - OptionalInt_t full_int = Int$from_text(text); \ + public PUREFUNC Optional ## KindOfInt ## _t KindOfInt ## $parse(Text_t text) { \ + OptionalInt_t full_int = Int$parse(text); \ if (full_int.small == 0) return (Optional ## KindOfInt ## _t){.is_null=true}; \ if (Int$compare_value(full_int, I(min_val)) < 0) { \ return (Optional ## KindOfInt ## _t){.is_null=true}; \ -- cgit v1.2.3