knut
knut copied to clipboard
Document Syntax
It was not clear to me from README.md
which characters knut allows for account names. I am one of these weird individualists likes to use spaces in account names and slashes to separate subaccounts.
It turns out that knut "only" supports colons, unicode letters, and unicode digits (guessing from the following snippet). Which is okay, but would be nice to state in the docs.
https://github.com/sboehler/knut/blob/598e6acbe173705e7795dd375af5b544ed8573a6/lib/parser/parser.go#L512-L520
It might also be worth noting that there's the concept of an "identifier" and that commodities are parsed as identifiers.
It shares these restrictions with most PTA tools. Allowing spaces would make parsing significantly more complex, and colons seem to be the gold standard for declaring subaccounts. Agree this could be documented.
Can confirm about the spaces making the parser a lot more difficult to handle; you have to then rely on a double space (or more) to signify the end of an account declaration - I took it out. W.r.t. slashes, I've adopted those in blossom
to be semi-virtual accounts, e.g. Liability:Bank:CreditCard1/21x9
for the September statement.