diff options
author | Peter Feigl <craven@gmx.net> | 2014-02-25 22:50:20 +0100 |
---|---|---|
committer | Peter Feigl <craven@gmx.net> | 2014-02-25 22:50:20 +0100 |
commit | c80b4955467a38a2be3aaaa60c9f49b33edef774 (patch) | |
tree | f83e871677be813384f68563d4da8bf83134a1a5 /src/textual.cc | |
parent | bc08eed3cb1bdb4f67d1b77273f3254d0cf13be2 (diff) | |
download | fork-ledger-c80b4955467a38a2be3aaaa60c9f49b33edef774.tar.gz fork-ledger-c80b4955467a38a2be3aaaa60c9f49b33edef774.tar.bz2 fork-ledger-c80b4955467a38a2be3aaaa60c9f49b33edef774.zip |
Adding support for recursive aliases.
Alias expansion is now a loop. If you define
alias A=B:A
alias B=C:B
then A will expand to C:B:A.
Also added a short section to the manual about this.
Diffstat (limited to 'src/textual.cc')
-rw-r--r-- | src/textual.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/textual.cc b/src/textual.cc index d8648c93..627a1835 100644 --- a/src/textual.cc +++ b/src/textual.cc @@ -977,6 +977,11 @@ void instance_t::account_alias_directive(account_t * account, string alias) // (account), add a reference to the account in the `account_aliases' // map, which is used by the post parser to resolve alias references. trim(alias); + // Ensure that no alias like "alias Foo=Foo" is registered. + if ( alias == account->fullname()) { + throw_(parse_error, _f("Illegal alias %1%=%2%") + % alias % account->fullname()); + } std::pair<accounts_map::iterator, bool> result = context.journal->account_aliases.insert (accounts_map::value_type(alias, account)); |