Open asottile opened 4 years ago
@infininight this patch is small and subtle, would you be able to review?
Weirdly the dot in the regex is ... official? https://yaml.org/type/float.html
[-+]?([0-9][0-9_]*)?\.[0-9.]*([eE][-+][0-9]+)?
(base 10)
This allows even weird things like 1.....1
Don't ask me why.
I suspect it's a mistake in the spec there -- it's not implemented that way in libyaml
In fact, it's highly questionable, since one of the examples doesn't even match the regex (and has a typo):
exponentioal: 685.230_15e+03
I don't know whether those "type" pages should be "official" or not ... they're "drafts" and from a previous version of the spec.
The 1.2.2 spec has a different regex in the recommended Core Schema
[-+]? ( \. [0-9]+ | [0-9]+ ( \. [0-9]* )? ) ( [eE] [-+]? [0-9]+ )?
This all is too confusing. Same with what counts as a boolean.
I don't know much about YAML, but I already know I don't like it :laughing:
Oh. I suspect the repeatable .
was supposed to be a repeatable _
. This makes sense based on that example, which would match in this case. I'll try reporting this on yaml spec repo.
This was incorrectly highlighting the following: