1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//! Parsing of numbers written out as ASCII text.
//!
//! Both [`json`] and [`sqlite_jsonb`] store their numbers this way, the latter
//! in the payload of its `INT`, `INT5`, `FLOAT` and `FLOAT5` elements, so they
//! share one parser here. Which forms that parser accepts is decided by a
//! [`Syntax`], of which [`Json`] covers [RFC 8259] and [`Json5`] the extensions
//! SQLite understands on top of it.
//!
//! The parser is explicit rather than being built on [`str::parse`], for two
//! reasons. It says which byte of a number is at fault instead of only that the
//! number is bad, and it decides exactly when a number written with a fraction
//! or an exponent still denotes a whole number, so that `1.00` and `100e-2` both
//! decode into an integer while `1.5` does not.
//!
//! Converting the decimal digits of a float into the closest binary float is
//! left to [`dec2flt`], which is correctly rounded.
//!
//! [RFC 8259]: https://datatracker.ietf.org/doc/html/rfc8259#section-6
//! [`dec2flt`]: crate::dec2flt
//! [`Syntax`]: self::syntax::Syntax
//! [`json`]: crate::json
//! [`sqlite_jsonb`]: crate::sqlite_jsonb
//! [`str::parse`]: str::parse
// Between them the two formats use everything here, so a build with both of
// them on still reports anything which has genuinely gone dead. A build with
// only one of them leaves the other's share unused, which is not worth cutting
// the module up over.
pub use Error;
pub use ;
pub use ;
pub use ;
pub use visit_any;