diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-12-11 14:09:04 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-12-11 14:09:04 -0500 |
| commit | 4aa983f2505264560c526b5a8987579ae4d5c734 (patch) | |
| tree | 4d4337b2eddc7a3246ef713570797afe6e43232b | |
| parent | 4614be0edcf234278ee5aedd6479b52f739d73ad (diff) | |
Fix merge issues
| -rw-r--r-- | src/compile/functions.c | 1 | ||||
| -rw-r--r-- | src/stdlib/cli.c | 7 | ||||
| -rw-r--r-- | src/stdlib/reals.c | 5 |
3 files changed, 7 insertions, 6 deletions
diff --git a/src/compile/functions.c b/src/compile/functions.c index 46acd780..77393ab2 100644 --- a/src/compile/functions.c +++ b/src/compile/functions.c @@ -7,7 +7,6 @@ #include "../stdlib/datatypes.h" #include "../stdlib/floats.h" #include "../stdlib/integers.h" -#include "../stdlib/nums.h" #include "../stdlib/optionals.h" #include "../stdlib/tables.h" #include "../stdlib/text.h" diff --git a/src/stdlib/cli.c b/src/stdlib/cli.c index cc2fa0b8..50b378a5 100644 --- a/src/stdlib/cli.c +++ b/src/stdlib/cli.c @@ -15,12 +15,13 @@ #include "bytes.h" #include "c_strings.h" #include "cli.h" +#include "floats.h" #include "integers.h" #include "metamethods.h" -#include "floats.h" #include "optionals.h" #include "paths.h" #include "print.h" +#include "reals.h" #include "stdlib.h" #include "tables.h" #include "text.h" @@ -215,8 +216,8 @@ static List_t parse_arg_list(List_t args, const char *flag, void *dest, const Ty return List$from(args, I(2)); } else { args = parse_arg_list(args, flag, dest, nonnull, allow_dashes); - if (nonnull == &Int$info || nonnull == &Path$info || nonnull == &Num$info || nonnull == &Num32$info - || nonnull->tag == TextInfo || nonnull->tag == EnumInfo) + if (nonnull == &Int$info || nonnull == &Path$info || nonnull == &Float64$info || nonnull == &Float32$info + || nonnull == &Real$info || nonnull->tag == TextInfo || nonnull->tag == EnumInfo) return args; else if (nonnull == &Int64$info) ((OptionalInt64_t *)dest)->has_value = true; else if (nonnull == &Int32$info) ((OptionalInt32_t *)dest)->has_value = true; diff --git a/src/stdlib/reals.c b/src/stdlib/reals.c index cfa027d1..9389fcb4 100644 --- a/src/stdlib/reals.c +++ b/src/stdlib/reals.c @@ -7,6 +7,7 @@ #include "bigint.h" #include "datatypes.h" #include "floats.h" +#include "optionals.h" #include "reals.h" #include "text.h" #include "types.h" @@ -68,12 +69,12 @@ static Int_t Real$compute_double(Real_t r, int64_t precision) { public OptionalReal_t Real$parse(Text_t text, Text_t *remainder) { Text_t decimal_onwards = EMPTY_TEXT; - OptionalInt_t int_component = Int$parse(text, &decimal_onwards); + OptionalInt_t int_component = Int$parse(text, NONE_INT, &decimal_onwards); if (int_component.small == 0) int_component = I(0); Text_t fraction_text = EMPTY_TEXT; if (Text$starts_with(decimal_onwards, Text("."), &fraction_text)) { fraction_text = Text$replace(fraction_text, Text("_"), EMPTY_TEXT); - OptionalInt_t fraction = Int$parse(fraction_text, remainder); + OptionalInt_t fraction = Int$parse(fraction_text, NONE_INT, remainder); if (fraction.small == 0) return NONE_REAL; int64_t shift = fraction_text.length; Int_t scale = Int$power(I(10), I(shift)); |
