pyhocon icon indicating copy to clipboard operation
pyhocon copied to clipboard

Fixed parsing for empty strings in lists getting dropped

Open davlee1972 opened this issue 1 year ago • 2 comments

Replaced block of code skipping empty strings in lists with:

New block of code that pops empty string values in the first item and last item of a token list if that token list was generated from a multiline list. All other empty string values in lists are preserved and not dropped..

Fixes: https://github.com/chimpler/pyhocon/issues/232 Related Issue: https://github.com/chimpler/pyhocon/issues/317

davlee1972 avatar Feb 21 '25 14:02 davlee1972

Testing results:

image

davlee1972 avatar Feb 24 '25 20:02 davlee1972

There should be error checking for invalid ",," in hocon lists, but that is a different issue. Right now those will be just be included as additional empty strings in a list.

image

https://getakka.net/articles/configuration/hocon.html

[1,2,3,,] is invalid because it has two trailing commas. [,1,2,3] is invalid because it has an initial comma. [1,,2,3] is invalid because it has two commas in a row.

davlee1972 avatar Feb 24 '25 20:02 davlee1972