mirror of
https://github.com/fastfloat/fast_float.git
synced 2026-10-29 02:17:15 +08:00
chars_format::javascript follows the strict-mode grammar, which rejects
any leading zero. In sloppy mode, JavaScript also accepts a leading zero
when one of the digits is 8 or 9 ("08.5" is 8.5, Annex B's
NonOctalDecimalIntegerLiteral). A leading zero followed only by octal
digits is a LegacyOctalIntegerLiteral ("0775"), which is not a decimal
number: it is rejected with the new parse_error::legacy_octal_integer_part
so the caller can parse it in base 8.
javascript_sloppy sets one extra bit on top of javascript, and the check
lives inside the existing runtime JavaScript branch of
parse_number_string<false>, so the general path is unchanged. An
interleaved A/B with realbenchmark on canada.txt and mesh.txt (ASCII and
UTF-16, 32/64-bit) shows identical instructions per float and cycles
within noise.
Document both formats in the README.
|
||
|---|---|---|
| .. | ||
| bloat_analysis | ||
| build_tests | ||
| installation_tests | ||
| basictest.cpp | ||
| BUILD.bazel | ||
| CMakeLists.txt | ||
| example_comma_test.cpp | ||
| example_integer_times_pow10.cpp | ||
| example_test.cpp | ||
| exhaustive32_64.cpp | ||
| exhaustive32_midpoint.cpp | ||
| exhaustive32.cpp | ||
| fast_int.cpp | ||
| fixedwidthtest.cpp | ||
| fortran.cpp | ||
| ipv4_test.cpp | ||
| javascript_fmt.cpp | ||
| json_fmt.cpp | ||
| long_exhaustive32_64.cpp | ||
| long_exhaustive32.cpp | ||
| long_random64.cpp | ||
| long_test.cpp | ||
| p2497.cpp | ||
| powersoffive_hardround.cpp | ||
| random64.cpp | ||
| random_string.cpp | ||
| rcppfastfloat_test.cpp | ||
| short_random_string.cpp | ||
| string_test.cpp | ||
| supported_chars_test.cpp | ||
| wide_char_test.cpp | ||