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

Support for quoted keys and values with special symbols #235

Open
alanv opened this issue Jul 17, 2023 · 2 comments
Open

Support for quoted keys and values with special symbols #235

alanv opened this issue Jul 17, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@alanv
Copy link

alanv commented Jul 17, 2023

String.validateSymbols() in ktoml-core-jvm:0.5.0 performs an extra trimQuotes(), which prevents assignment to quoted keys containing special symbols.

For example, consider the following line of valid (per language docs) TOML:

"androidx.activity:activity-compose" = {}

This yields the following exception:

ParseException: <...>: Not able to parse the key: ["androidx.activity:activity-compose"] as it contains invalid symbols.
@orchestr7
Copy link
Owner

orchestr7 commented Aug 9, 2023

Yes, looks like it needs to be fixed. But have you tried single quotes as a workaround?

@orchestr7 orchestr7 added the enhancement New feature or request label Aug 9, 2023
@orchestr7 orchestr7 self-assigned this Aug 9, 2023
@mhozza
Copy link

mhozza commented Apr 28, 2024

+1 to this. Using single quotes succeeds to parse, but the resulting keys have the quotes in the name, i.e.:

'foo:' = 'bar'

Would result to:

mapOf("'foo:'" to "bar")

The quotes are applied inconsistently to the keys and values.

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

No branches or pull requests

3 participants