Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Incorrect identification of sequences of digits with one or more leading zero as Numbers #179

Closed
stephanbuys opened this issue Oct 29, 2020 · 0 comments · Fixed by #180
Closed

Comments

@stephanbuys
Copy link
Contributor

stephanbuys commented Oct 29, 2020

The YAML 1.2 Spec does not allow Numbers to start with a 0 unless it is used to identify different kinds of number formats (such as Octal, etc).
See

if v.starts_with("0x") || v.starts_with("+0x") {

A digit sequence with leading zeros that isn't one of these types (and identified as such) should instead be interpreted as a String, see: https://yaml.org/spec/1.2/spec.html#id2761292

I'm happy to contribute a PR if wanted.

Examples:

string: 00082
integer: 82
@dtolnay dtolnay changed the title Incorrect identification of sequenzes of digits with one or more leading zero as Numbers Incorrect identification of sequences of digits with one or more leading zero as Numbers Oct 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant