hocon-js icon indicating copy to clipboard operation
hocon-js copied to clipboard

Hyphens are not supported in unquoted strings (key names)

Open BitBrit opened this issue 7 years ago • 2 comments

I have a need for a library just like yours but there a couple of issues. I'll create issues separately so they can be independently tracked.

I believe that hyphens should be allowed in an unquoted string if the hyphen isn't at the start.

https://github.com/typesafehub/config/blob/master/HOCON.md#unquoted-strings

Right now the library produces:

Hocon:

hyphen-separated-name {}

Output:

ReferenceError: separated is not defined

Could you allow hyphens please?

BitBrit avatar Jun 07 '17 17:06 BitBrit

Just tried parsing some HOCON that starts with an unquoted string which contains hyphens and had no problem. Might want to re-try this with the latest version.

Your example works as well.

walshie4 avatar Nov 28 '18 19:11 walshie4

Thanks @walshie4 !

yellowblood avatar Nov 29 '18 10:11 yellowblood

Confirmed to work with latest! Thanks @walshie4

BitBrit avatar Oct 10 '23 21:10 BitBrit