diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-09-04 16:08:34 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-09-04 16:08:34 -0400 |
| commit | 3513b94fc7505e48208814436a8d4bd6edcdd10c (patch) | |
| tree | 7c7632c58d8a975173369d84d3f9b02f7e2f7501 /environment.c | |
| parent | 973b1c55c209a8f91e8cfacb3ab4a053ef82939e (diff) | |
Unify parsing code to correctly handle parsing integers and numbers with
a &success boolean. Check for overflow as well.
Diffstat (limited to 'environment.c')
| -rw-r--r-- | environment.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/environment.c b/environment.c index 32e3f7f6..8f5de0de 100644 --- a/environment.c +++ b/environment.c @@ -117,7 +117,7 @@ env_t *new_compilation_unit(CORD *libname) {"clamped", "Int64$clamped", "func(x:Int64,low:Int64,high:Int64)->Int64"}, {"divided_by", "Int64$divided_by", "func(x:Int64,y:Int64)->Int64"}, {"format", "Int64$format", "func(i:Int64, digits=0)->Text"}, - {"from_text", "Int64$from_text", "func(text:Text, the_rest=!&Text)->Int64"}, + {"from_text", "Int64$from_text", "func(text:Text, success=!&Bool)->Int64"}, {"hex", "Int64$hex", "func(i:Int64, digits=0, uppercase=yes, prefix=yes)->Text"}, {"max", "Int64$max", "Int64"}, {"min", "Int64$min", "Int64"}, @@ -133,7 +133,7 @@ env_t *new_compilation_unit(CORD *libname) {"clamped", "Int32$clamped", "func(x:Int32,low:Int32,high:Int32)->Int32"}, {"divided_by", "Int32$divided_by", "func(x:Int32,y:Int32)->Int32"}, {"format", "Int32$format", "func(i:Int32, digits=0)->Text"}, - {"from_text", "Int32$from_text", "func(text:Text, the_rest=!&Text)->Int32"}, + {"from_text", "Int32$from_text", "func(text:Text, success=!&Bool)->Int32"}, {"hex", "Int32$hex", "func(i:Int32, digits=0, uppercase=yes, prefix=yes)->Text"}, {"max", "Int32$max", "Int32"}, {"min", "Int32$min", "Int32"}, @@ -149,7 +149,7 @@ env_t *new_compilation_unit(CORD *libname) {"clamped", "Int16$clamped", "func(x:Int16,low:Int16,high:Int16)->Int16"}, {"divided_by", "Int16$divided_by", "func(x:Int16,y:Int16)->Int16"}, {"format", "Int16$format", "func(i:Int16, digits=0)->Text"}, - {"from_text", "Int16$from_text", "func(text:Text, the_rest=!&Text)->Int16"}, + {"from_text", "Int16$from_text", "func(text:Text, success=!&Bool)->Int16"}, {"hex", "Int16$hex", "func(i:Int16, digits=0, uppercase=yes, prefix=yes)->Text"}, {"max", "Int16$max", "Int16"}, {"min", "Int16$min", "Int16"}, @@ -165,7 +165,7 @@ env_t *new_compilation_unit(CORD *libname) {"clamped", "Int8$clamped", "func(x:Int8,low:Int8,high:Int8)->Int8"}, {"divided_by", "Int8$divided_by", "func(x:Int8,y:Int8)->Int8"}, {"format", "Int8$format", "func(i:Int8, digits=0)->Text"}, - {"from_text", "Int8$from_text", "func(text:Text, the_rest=!&Text)->Int8"}, + {"from_text", "Int8$from_text", "func(text:Text, success=!&Bool)->Int8"}, {"hex", "Int8$hex", "func(i:Int8, digits=0, uppercase=yes, prefix=yes)->Text"}, {"max", "Int8$max", "Int8"}, {"min", "Int8$min", "Int8"}, @@ -193,7 +193,7 @@ env_t *new_compilation_unit(CORD *libname) {"TAU", "(Num_t)(2.*M_PI)", "Num"}, {"random", "Num$random", "func()->Num"}, {"mix", "Num$mix", "func(amount:Num, x:Num, y:Num)->Num"}, - {"from_text", "Num$from_text", "func(text:Text, the_rest=!&Text)->Num"}, + {"from_text", "Num$from_text", "func(text:Text, success=!&Bool)->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), @@ -222,7 +222,7 @@ env_t *new_compilation_unit(CORD *libname) {"TAU", "(Num32_t)(2.f*M_PI)", "Num32"}, {"random", "Num32$random", "func()->Num32"}, {"mix", "Num32$mix", "func(amount:Num32, x:Num32, y:Num32)->Num32"}, - {"from_text", "Num32$from_text", "func(text:Text, the_rest=!&Text)->Num32"}, + {"from_text", "Num32$from_text", "func(text:Text, success=!&Bool)->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), |
