Merge pull request #2116 from rtfeldman/str_to_num

Str.toNum
This commit is contained in:
Richard Feldman 2021-12-09 09:48:38 -05:00 committed by GitHub
commit 1ce648ac27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 771 additions and 55 deletions

View file

@ -10,6 +10,7 @@ const STR = "str";
const dec = @import("dec.zig");
comptime {
exportDecFn(dec.fromStr, "from_str");
exportDecFn(dec.fromF64C, "from_f64");
exportDecFn(dec.eqC, "eq");
exportDecFn(dec.neqC, "neq");
@ -131,6 +132,11 @@ comptime {
inline for (INTEGERS) |T| {
str.exportFromInt(T, ROC_BUILTINS ++ "." ++ STR ++ ".from_int.");
num.exportParseInt(T, ROC_BUILTINS ++ "." ++ STR ++ ".to_int.");
}
inline for (FLOATS) |T| {
num.exportParseFloat(T, ROC_BUILTINS ++ "." ++ STR ++ ".to_float.");
}
}