diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-11-09 15:11:11 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-11-09 15:11:11 -0500 |
| commit | 7a4f2e73addf6dfcde2a6b17b62b961608e556a0 (patch) | |
| tree | c03e4758e5725a4a6d352f5bb7d323796ed99947 /stdlib/integers.c | |
| parent | 5d35f286336878a3529dabdb3f7800b6f84712eb (diff) | |
Rename `from_text()` to `parse()`
Diffstat (limited to 'stdlib/integers.c')
| -rw-r--r-- | stdlib/integers.c | 6 |
1 files changed, 3 insertions, 3 deletions
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}; \ |
