Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to have String starting with the digits #32

Closed
floating-cat opened this issue Dec 16, 2022 · 1 comment
Closed

Unable to have String starting with the digits #32

floating-cat opened this issue Dec 16, 2022 · 1 comment

Comments

@floating-cat
Copy link
Contributor

Example config1:

uuid = 123e4567-e89b-12d3-a456-426614174000

Error:

error: strconv.ParseFloat: parsing "123e4567": value out of range

Example2:

id = 123abc

Error:

error: missing comma! at: 1:9, values should have comma or ASCII newline ('\n') between them

This library recognizes the String starting with the digits as a number.
But these are two valid strings "123e4567-e89b-12d3-a456-426614174000", "123e4567":

https://github.com/lightbend/config/blob/main/HOCON.md#string-value-concatenation

The value of an object field or array element may consist of multiple values which are combined. There are three kinds of value concatenation:
if all the values are simple values (neither objects nor arrays), they are concatenated into a string.
.....
For purposes of string value concatenation, non-string values are converted to strings as follows (strings shown as quoted strings):
numbers should be kept as they were originally written in the file. For example, if you parse 1e5 then you might render it alternatively as 1E5 with capital E, or just 100000. For purposes of value concatenation, it should be rendered as it was written in the file.

In https://hocon-playground.avelier.dev/, these can be recognized correctly:
image

@sholsapp
Copy link

Ah, this is impacting me, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants