Skip to content
Permalink
Browse files

Remove know-ification of elements due to post state

  • Loading branch information...
CandyAngel committed Aug 27, 2019
1 parent 0848f2b commit cdd6b7c0ac10a15b8f8853b7610ae58037c261aa
Showing with 14 additions and 22 deletions.
  1. +0 −20 src/journal.cc
  2. +6 −2 test/baseline/opt-pedantic.test
  3. +8 −0 test/baseline/opt-strict.test
@@ -152,9 +152,6 @@ account_t * journal_t::register_account(const string& name, post_t * post,
fixed_accounts = true;
result->add_flags(ACCOUNT_KNOWN);
}
else if (! fixed_accounts && post->_state != item_t::UNCLEARED) {
result->add_flags(ACCOUNT_KNOWN);
}
else if (checking_style == CHECK_WARNING) {
current_context->warning(_f("Unknown account '%1%'") % result->fullname());
}
@@ -237,9 +234,6 @@ string journal_t::register_payee(const string& name, xact_t * xact)
fixed_payees = true;
known_payees.insert(name);
}
else if (! fixed_payees && xact->_state != item_t::UNCLEARED) {
known_payees.insert(name);
}
else if (checking_style == CHECK_WARNING) {
current_context->warning(_f("Unknown payee '%1%'") % name);
}
@@ -269,13 +263,6 @@ void journal_t::register_commodity(commodity_t& comm,
fixed_commodities = true;
comm.add_flags(COMMODITY_KNOWN);
}
else if (! fixed_commodities &&
((context.which() == 1 &&
boost::get<xact_t *>(context)->_state != item_t::UNCLEARED) ||
(context.which() == 2 &&
boost::get<post_t *>(context)->_state != item_t::UNCLEARED))) {
comm.add_flags(COMMODITY_KNOWN);
}
else if (checking_style == CHECK_WARNING) {
current_context->warning(_f("Unknown commodity '%1%'") % comm);
}
@@ -298,13 +285,6 @@ void journal_t::register_metadata(const string& key, const value_t& value,
fixed_metadata = true;
known_tags.insert(key);
}
else if (! fixed_metadata &&
((context.which() == 1 &&
boost::get<xact_t *>(context)->_state != item_t::UNCLEARED) ||
(context.which() == 2 &&
boost::get<post_t *>(context)->_state != item_t::UNCLEARED))) {
known_tags.insert(key);
}
else if (checking_style == CHECK_WARNING) {
current_context->warning(_f("Unknown metadata tag '%1%'") % key);
}
@@ -6,12 +6,16 @@
Expenses:Phone 20.00 GBP
Assets:Cash

test bal --pedantic -> 1
test bal --pedantic -> 2
__ERROR__
While parsing file "$FILE", line 2:
While parsing posting:
Expenses:Phone 20.00 GBP

Error: Unknown account 'Expenses:Phone'
end test
While parsing file "$FILE", line 6:
While parsing posting:
Expenses:Phone 20.00 GBP

Error: Unknown account 'Expenses:Phone'
end test
@@ -18,5 +18,13 @@ test reg --strict
07-Feb-02 Baz Expenses:Foodx $30.00 $30.00
Assets:Cash $-30.00 0
__ERROR__
Warning: "$FILE", line 2: Unknown account 'Expenses:Food'
Warning: "$FILE", line 2: Unknown commodity '$'
Warning: "$FILE", line 3: Unknown account 'Assets:Cash'
Warning: "$FILE", line 6: Unknown account 'Expenses:Food'
Warning: "$FILE", line 6: Unknown commodity '$'
Warning: "$FILE", line 7: Unknown account 'Assets:Cash'
Warning: "$FILE", line 10: Unknown account 'Expenses:Foodx'
Warning: "$FILE", line 10: Unknown commodity '$'
Warning: "$FILE", line 11: Unknown account 'Assets:Cash'
end test

0 comments on commit cdd6b7c

Please sign in to comment.
You can’t perform that action at this time.