gurkankaymak / hocon

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

Includes directives incorrectly parsed #30

Closed blackmichael closed 1 year ago

blackmichael commented 2 years ago

Config files that try to include multiple other resources seem to be incorrectly parsing subsequent statements. This works:

include required("a.conf")
-
include required("b.conf")

and this works

include required("a.conf")
x: 7
include required("b.conf")

but this fails (regardless of how much whitespace is used)

include required("a.conf")
include required("b.conf")

with the error

--- FAIL: TestParseIncludedResource (0.00s)
    --- FAIL: TestParseIncludedResource/parse_the_included_resource_and_return_the_parsed_object_if_there_is_no_error (0.00s)
        parser_test.go:1003: not expected an error, got err: "invalid key! at: 2:17, \"(\" is a forbidden character in keys"

and this parses, but doesn't actually include the second resource

include "a.conf"
include "b.conf"