feat: String_ToFloat + Json escape sequence support
- Add bux_str_to_float() C runtime wrapper (strtod) - Add String_ToFloat() in library/std/String.bux - Update JsonParser_ParseNumber to use String_ToFloat (decimals now work) - Update JsonParser_ParseString to decode escape sequences (\n, \t, \r, \", \\, \b, \f) - Fix use-after-free in JsonParser_ParseString: String_Copy before StringBuilder_Free
This commit is contained in:
@@ -179,6 +179,12 @@ func String_Replace(s: String, old: String, new: String) -> String {
|
||||
return result;
|
||||
}
|
||||
|
||||
extern func bux_str_to_float(s: String) -> float64;
|
||||
|
||||
func String_ToFloat(s: String) -> float64 {
|
||||
return bux_str_to_float(s);
|
||||
}
|
||||
|
||||
func String_FromFloat(f: float64) -> String {
|
||||
return bux_float_to_string(f);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user