Toml representation in src/types.rs seems to be simplified and not enough to constuct a tree of toml objects that produces original toml document with original formatting.
Is tomllib a proper library for the following application idea:
Convert toml to line-based format and back, like xml2, but for TOML instead of XML. Something like in this imaginary session:
$ cat test.toml
[section1]
var1="qwe"
var2=456
# A comment
var3 = [ "qqq" ]
$ cat test.toml | toml2lines
/section1/var1="qwe
/section1/#=
/section1/var2=456
/section1/#=# A comment
/section1/var3/0=qqq
$ cat test.toml | toml2lines | lines2toml
[section1]
var1="qwe"
var2=456
# A comment
var3 = [ "qqq" ]
$ cat test.toml | toml2lines | grep var3 | lines2toml
[section1]
var3 = [ "qqq" ]
Maybe making all things in src/internals/ast reachable by Serde and/or making them public API should make it possible?
Toml representation in
src/types.rsseems to be simplified and not enough to constuct a tree of toml objects that produces original toml document with original formatting.Is tomllib a proper library for the following application idea:
Convert toml to line-based format and back, like xml2, but for TOML instead of XML. Something like in this imaginary session:
Maybe making all things in
src/internals/astreachable by Serde and/or making them public API should make it possible?