summaryrefslogtreecommitdiff
path: root/src/item.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-02-04 18:23:52 -0500
committerJohn Wiegley <johnw@newartisans.com>2010-02-04 18:23:52 -0500
commitb78e22d52b75cafd63678ee786b1653afffa49e6 (patch)
treebdb9fbeb401fde311189451b8b792dd69702baba /src/item.cc
parentc92a54b0ab510762e10cd4cab1082a9e59716025 (diff)
downloadfork-ledger-b78e22d52b75cafd63678ee786b1653afffa49e6.tar.gz
fork-ledger-b78e22d52b75cafd63678ee786b1653afffa49e6.tar.bz2
fork-ledger-b78e22d52b75cafd63678ee786b1653afffa49e6.zip
Added a "seq" sequence property for all items
This indicates the absolute parsing order of every transaction and posting. It is 0 for generated items.
Diffstat (limited to 'src/item.cc')
-rw-r--r--src/item.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/item.cc b/src/item.cc
index 0e596f33..135fa18f 100644
--- a/src/item.cc
+++ b/src/item.cc
@@ -296,6 +296,10 @@ namespace {
return item.pos ? long(item.pos->end_line) : 0L;
}
+ value_t get_seq(item_t& item) {
+ return item.pos ? long(item.pos->sequence) : 0L;
+ }
+
value_t get_depth(item_t&) {
return 0L;
}
@@ -416,6 +420,8 @@ expr_t::ptr_op_t item_t::lookup(const symbol_t::kind_t kind,
case 's':
if (name == "status")
return WRAP_FUNCTOR(get_wrapper<&get_status>);
+ else if (name == "seq")
+ return WRAP_FUNCTOR(get_wrapper<&get_seq>);
break;
case 't':