Skip to content

Commit 1027dc1

Browse files
authored
Update regex to EBNF
1 parent 15f79d8 commit 1027dc1

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/libcore/num/dec2flt/mod.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -129,19 +129,17 @@ macro_rules! from_str_float_impl {
129129
///
130130
/// # Grammar
131131
///
132-
/// All strings that adhere to the following regular expression
132+
/// All strings that adhere to the following EBNF grammar
133133
/// will result in an [`Ok`] being returned:
134134
///
135135
/// ```txt
136-
/// (\+|-)?
137-
/// (inf|
138-
/// NaN|
139-
/// ([0-9]+|
140-
/// [0-9]+\.[0-9]*|
141-
/// [0-9]*\.[0-9]+)
142-
/// ((e|E)
143-
/// (\+|-)?
144-
/// [0-9]+)?)
136+
/// Float ::= Sign? ( 'inf' | 'NaN' | Number )
137+
/// Number ::= ( Digit+ |
138+
/// Digit+ '.' Digit* |
139+
/// Digit* '.' Digit+ ) Exp?
140+
/// Exp ::= [eE] Sign? Digit+
141+
/// Sign ::= [+-]
142+
/// Digit ::= [0-9]
145143
/// ```
146144
///
147145
/// # Known bugs

0 commit comments

Comments
 (0)