ktoml
ktoml copied to clipboard
Support for quoted keys and values with special symbols
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.
Yes, looks like it needs to be fixed. But have you tried single quotes as a workaround?
+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.