File tree 2 files changed +20
-18
lines changed
2 files changed +20
-18
lines changed Original file line number Diff line number Diff line change @@ -23,9 +23,11 @@ use kdl::KdlDocument;
23
23
let doc_str = r # "
24
24
hello 1 2 3
25
25
26
- world prop="value" {
26
+ // Comment
27
+ world prop=value {
27
28
child 1
28
29
child 2
30
+ child #inf
29
31
}
30
32
" # ;
31
33
@@ -112,15 +114,14 @@ KDL itself does not specify a particular representation for numbers and
112
114
accepts just about anything valid, no matter how large and how small. This
113
115
means a few things:
114
116
115
- * Numbers without a decimal point are interpreted as [ ` u64 ` ] .
117
+ * Numbers without a decimal point are interpreted as [ ` i128 ` ] .
116
118
* Numbers with a decimal point are interpreted as [ ` f64 ` ] .
117
- * Floating point numbers that evaluate to [ ` f64::INFINITY ` ] or
118
- [ ` f64::NEG_INFINITY ` ] or NaN will be represented as such in the values,
119
- instead of the original numbers.
120
- * A similar restriction applies to overflowed [ ` u64 ` ] values.
121
- * The original _ representation_ of these numbers will be preserved, unless
122
- you [ ` KdlDocument::fmt ` ] in which case the original representation will be
123
- thrown away and the actual value will be used when serializing.
119
+ * The keywords ` #inf ` , ` #-inf ` , and ` #nan ` evaluate to [ ` f64::INFINITY ` ] ,
120
+ [ ` f64::NEG_INFINITY ` ] , and [ ` f64::NAN ` ] .
121
+ * The original _ representation/text_ of these numbers will be preserved,
122
+ unless you [ ` KdlDocument::autoformat ` ] in which case the original
123
+ representation will be thrown away and the actual value will be used when
124
+ serializing.
124
125
125
126
### Minimum Supported Rust Version
126
127
Original file line number Diff line number Diff line change 21
21
//! let doc_str = r#"
22
22
//! hello 1 2 3
23
23
//!
24
- //! world prop="value" {
24
+ //! // Comment
25
+ //! world prop=value {
25
26
//! child 1
26
27
//! child 2
28
+ //! child #inf
27
29
//! }
28
30
//! "#;
29
31
//!
110
112
//! accepts just about anything valid, no matter how large and how small. This
111
113
//! means a few things:
112
114
//!
113
- //! * Numbers without a decimal point are interpreted as [`u64 `].
115
+ //! * Numbers without a decimal point are interpreted as [`i128 `].
114
116
//! * Numbers with a decimal point are interpreted as [`f64`].
115
- //! * Floating point numbers that evaluate to [`f64::INFINITY`] or
116
- //! [`f64::NEG_INFINITY`] or NaN will be represented as such in the values,
117
- //! instead of the original numbers.
118
- //! * A similar restriction applies to overflowed [`u64`] values.
119
- //! * The original _representation_ of these numbers will be preserved, unless
120
- //! you [`KdlDocument::fmt`] in which case the original representation will be
121
- //! thrown away and the actual value will be used when serializing.
117
+ //! * The keywords `#inf`, `#-inf`, and `#nan` evaluate to [`f64::INFINITY`],
118
+ //! [`f64::NEG_INFINITY`], and [`f64::NAN`].
119
+ //! * The original _representation/text_ of these numbers will be preserved,
120
+ //! unless you [`KdlDocument::autoformat`] in which case the original
121
+ //! representation will be thrown away and the actual value will be used when
122
+ //! serializing.
122
123
//!
123
124
//! ## Minimum Supported Rust Version
124
125
//!
You can’t perform that action at this time.
0 commit comments