fktn-k / fkYAML

A C++ header-only YAML library
MIT License
69 stars 7 forks source link

Cannot parse string which consists of numbers and multiple dots #242

Closed fktn-k closed 10 months ago

fktn-k commented 10 months ago

Description

fkYAML throws an exception while parsing a string scalar which consists of numbers and multiple dots such as semantic versions.
This only occurs if such a scalar is not surrounded with single/double quotes.

Reproduction steps

Try parse the following:

semver: 1.2.3

Expected vs. actual results

Expected: No error.
Actual: An exception is thrown with the following message:

parse_error: Multiple decimal points found in a token. (at line 0, column 11)

Minimal code example

int main()
{
    using namespace fkyaml::literals::yaml_literals;
    fkyaml::node n = "semver: 1.2.3"_yaml;
    return 0;
}

Error messages

parse_error: Multiple decimal points found in a token. (at line 0, column 11)

Compiler and operating system

GCC 11.4.0 on Ubuntu 22.04 LTS

Library version

develop HEAD

Validation

fktn-k commented 10 months ago

Fixed by the PR #251 and all the workflows pass successfully.
So, I'll close this issue.