gurkankaymak / hocon

go implementation of lightbend's HOCON configuration library https://github.com/lightbend/config
MIT License
79 stars 17 forks source link

Parser error when trailing comma is followed be a comment #41

Closed jroper closed 1 year ago

jroper commented 1 year ago

According to the HOCON spec:

The last element in an array or last field in an object may be followed by a single comma. This extra comma is ignored.

If I have the following array:

my-array: [
  "some-value", # some comment
]

The following error is produced:

Error: invalid value! at: 3:1, unknown value: "]"

Edit: updated to reflect that this only occurs when there is a comment after the trailing comma