diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-04-10 13:23:49 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-04-10 13:23:49 -0400 |
| commit | e6f78f1d89acb038cf7893c325ee9acf61a555ad (patch) | |
| tree | 77995a17758c8dc6599033ba4f7dccfb8fc42244 /environment.c | |
| parent | ccb9e367047148f5b15316b667a139106858ab61 (diff) | |
Add from_text() method for ints/nums
Diffstat (limited to 'environment.c')
| -rw-r--r-- | environment.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/environment.c b/environment.c index 6de8fb21..e86de364 100644 --- a/environment.c +++ b/environment.c @@ -55,6 +55,7 @@ env_t *new_compilation_unit(void) {"hex", "Int$hex", "func(i:Int, digits=0, uppercase=yes, prefix=yes)->Text"}, {"octal", "Int$octal", "func(i:Int, digits=0, prefix=yes)->Text"}, {"random", "Int$random", "func(min=0, max=0xffffffff)->Int"}, + {"from_text", "Int$from_text", "func(text:Text, the_rest=!Text)->Int"}, {"bits", "Int$bits", "func(x:Int)->[Bool]"}, {"abs", "labs", "func(i:Int)->Int"}, {"min", "Int$min", "Int"}, @@ -65,6 +66,7 @@ env_t *new_compilation_unit(void) {"hex", "Int32$hex", "func(i:Int32, digits=0, uppercase=yes, prefix=yes)->Text"}, {"octal", "Int32$octal", "func(i:Int32, digits=0, prefix=yes)->Text"}, {"random", "Int32$random", "func(min=0, max=0xffffffff)->Int32"}, + {"from_text", "Int$from_text", "func(text:Text, the_rest=!Text)->Int32"}, {"bits", "Int32$bits", "func(x:Int32)->[Bool]"}, {"abs", "abs", "func(i:Int32)->Int32"}, {"min", "Int32$min", "Int32"}, @@ -75,6 +77,7 @@ env_t *new_compilation_unit(void) {"hex", "Int16$hex", "func(i:Int16, digits=0, uppercase=yes, prefix=yes)->Text"}, {"octal", "Int16$octal", "func(i:Int16, digits=0, prefix=yes)->Text"}, {"random", "Int16$random", "func(min=0, max=0xffffffff)->Int16"}, + {"from_text", "Int$from_text", "func(text:Text, the_rest=!Text)->Int16"}, {"bits", "Int16$bits", "func(x:Int16)->[Bool]"}, {"abs", "abs", "func(i:Int16)->Int16"}, {"min", "Int16$min", "Int16"}, @@ -85,6 +88,7 @@ env_t *new_compilation_unit(void) {"hex", "Int8$hex", "func(i:Int8, digits=0, uppercase=yes, prefix=yes)->Text"}, {"octal", "Int8$octal", "func(i:Int8, digits=0, prefix=yes)->Text"}, {"random", "Int8$random", "func(min=0, max=0xffffffff)->Int8"}, + {"from_text", "Int$from_text", "func(text:Text, the_rest=!Text)->Int8"}, {"bits", "Int8$bits", "func(x:Int8)->[Bool]"}, {"abs", "abs", "func(i:Int8)->Int8"}, {"min", "Int8$min", "Int8"}, @@ -106,6 +110,7 @@ env_t *new_compilation_unit(void) {"INF", "INFINITY", "Num"}, {"TAU", "(2.*M_PI)", "Num"}, {"random", "Num$random", "func()->Num"}, + {"from_text", "Num$from_text", "func(text:Text, the_rest=!Text)->Num"}, {"abs", "fabs", "func(n:Num)->Num"}, F(acos), F(acosh), F(asin), F(asinh), F(atan), F(atanh), F(cbrt), F(ceil), F(cos), F(cosh), F(erf), F(erfc), F(exp), F(exp2), F(expm1), F(floor), F(j0), F(j1), F(log), F(log10), F(log1p), F(log2), F(logb), @@ -132,6 +137,7 @@ env_t *new_compilation_unit(void) {"INF", "(Num32_t)(INFINITY)", "Num32"}, {"TAU", "(Num32_t)(2.f*M_PI)", "Num32"}, {"random", "Num32$random", "func()->Num32"}, + {"from_text", "Num32$from_text", "func(text:Text, the_rest=!Text)->Num32"}, {"abs", "fabsf", "func(n:Num32)->Num32"}, F(acos), F(acosh), F(asin), F(asinh), F(atan), F(atanh), F(cbrt), F(ceil), F(cos), F(cosh), F(erf), F(erfc), F(exp), F(exp2), F(expm1), F(floor), F(j0), F(j1), F(log), F(log10), F(log1p), F(log2), F(logb), |
