chimpler / pyhocon

HOCON parser for Python
Apache License 2.0
502 stars 118 forks source link

Chained substitution problem #313

Open Savlik opened 1 year ago

Savlik commented 1 year ago

Hi, i have a problem with simple substitution:

foo: "foo"
bar: ${foo}bar
bar: ${?foo2}
foobar: ${bar}

result: pyhocon.exceptions.ConfigSubstitutionException: Cannot resolve ${bar}: (line: 4, col: 9). Check for cycles. expected: foo: foo, bar: foobar, foobar: foobar

Every slight modification work correctly as expected:

foo: "foo"
bar: ${foo}bar
bar: ${?foo2}

result: foo: foo, bar: foobar

foo: "foo"
bar: ${foo}bar
foobar: ${bar}

result: foo: foo, bar: foobar, foobar: foobar

foo: "foo"
bar: bar
bar: ${?foo2}
foobar: ${bar}

result: foo: foo, bar: bar, foobar: bar

Any ideas what is wrong, or how to fix it?