Currently bafr scripts are based on TOML.
If we were willing to parse our own syntax, we could have nice things like:
No more awkward [[ replace ]] blocks, just a separator, or maybe even nothing (just make sure to start every replacement with the from key — so every time we encounter a new from declaration, we start a new replacement)
No need to quote keys containing special characters (see #1)
We could use the more natural : instead of =
We could use to instead of = in #1
We could have a less awkward multiline string syntax. Perhaps just a regular quote character (why terminate quotes on line endings anyway?).
We could support unquoted strings for simple things. Basically only quote your string if you don't want whitespace trimmed or it’s multiline (we don't need to distinguish numbers or other values from strings anyway)
The obvious downsides are:
WAY more effort
Reduced compatibility. No syntax highlight anywhere unless this becomes quite popular.
Currently bafr scripts are based on TOML. If we were willing to parse our own syntax, we could have nice things like:
[[ replace ]]
blocks, just a separator, or maybe even nothing (just make sure to start every replacement with thefrom
key — so every time we encounter a newfrom
declaration, we start a new replacement):
instead of=
to
instead of=
in #1The obvious downsides are:
Alternatively, we could explore using YAML. I went with TOML to avoid all the weird whitespace sensitivity of YAML, but I just read it can also use
{}
for scope, so it might be worth another look: https://medium.com/@kasunbg/write-yaml-without-indentation-via-curly-braces-3c05ae8700ce