summaryrefslogtreecommitdiff
path: root/src/item.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/item.cc')
-rw-r--r--src/item.cc19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/item.cc b/src/item.cc
index 758ce254..9e297052 100644
--- a/src/item.cc
+++ b/src/item.cc
@@ -247,6 +247,10 @@ namespace {
return 0L;
}
+ value_t ignore(item_t&) {
+ return false;
+ }
+
template <value_t (*Func)(item_t&)>
value_t get_wrapper(call_scope_t& scope) {
return (*Func)(find_scope<item_t>(scope));
@@ -258,10 +262,12 @@ value_t get_comment(item_t& item)
if (! item.note) {
return string_value("");
} else {
- // jww (2009-03-01): If the comment is a short one-liner, put it at the
- // end of the post/xact
std::ostringstream buf;
- buf << "\n ;";
+ if (item.note->length() > 15)
+ buf << "\n ;";
+ else
+ buf << " ;";
+
bool need_separator = false;
for (const char * p = item.note->c_str(); *p; p++) {
if (*p == '\n') {
@@ -328,6 +334,11 @@ expr_t::ptr_op_t item_t::lookup(const string& name)
return WRAP_FUNCTOR(ledger::has_tag);
break;
+ case 'i':
+ if (name == "is_account")
+ return WRAP_FUNCTOR(get_wrapper<&ignore>);
+ break;
+
case 'm':
if (name == "meta")
return WRAP_FUNCTOR(ledger::get_tag);
@@ -341,6 +352,8 @@ expr_t::ptr_op_t item_t::lookup(const string& name)
case 'p':
if (name == "pending")
return WRAP_FUNCTOR(get_wrapper<&get_pending>);
+ else if (name == "parent")
+ return WRAP_FUNCTOR(get_wrapper<&ignore>);
break;
case 's':