Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed parsing for empty strings in lists getting dropped #334

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

davlee1972
Copy link

@davlee1972 davlee1972 commented Feb 21, 2025

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:
#232
Related Issue:
#317

Fixed token list parsing for empty strings in token list.
@davlee1972
Copy link
Author

Testing results:

image

@davlee1972 davlee1972 changed the title Update config_parser.py Fixed parsing for empty strings in lists getting dropped Feb 24, 2025
@davlee1972
Copy link
Author

davlee1972 commented Feb 24, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant