diff --git a/crates/taplo/src/parser/mod.rs b/crates/taplo/src/parser/mod.rs index 65e8afe57..647e9c7d7 100644 --- a/crates/taplo/src/parser/mod.rs +++ b/crates/taplo/src/parser/mod.rs @@ -567,9 +567,7 @@ impl<'p> Parser<'p> { } } FLOAT => { - if self.lexer.slice().starts_with('0') { - self.error("zero-padded numbers are not allowed") - } else if self.lexer.slice().starts_with('+') { + if self.lexer.slice().starts_with('+') { Err(()) } else { for (i, s) in self.lexer.slice().split('.').enumerate() { diff --git a/crates/taplo/src/tests/mod.rs b/crates/taplo/src/tests/mod.rs index 4511e7944..ef77f9f04 100644 --- a/crates/taplo/src/tests/mod.rs +++ b/crates/taplo/src/tests/mod.rs @@ -27,3 +27,15 @@ fn comments_after_tables() { assert!(errors.is_empty(), "{:#?}", errors); } + +#[test] +fn digits_in_keys() { + let src = r#" +0123 = true +01.23 = true +23.01 = true +"#; + let errors = parse(src).errors; + + assert!(errors.is_empty(), "{:#?}", errors); +}