diff options
author | John Wiegley <johnw@newartisans.com> | 2010-02-04 18:23:52 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2010-02-04 18:23:52 -0500 |
commit | b78e22d52b75cafd63678ee786b1653afffa49e6 (patch) | |
tree | bdb9fbeb401fde311189451b8b792dd69702baba /src/item.cc | |
parent | c92a54b0ab510762e10cd4cab1082a9e59716025 (diff) | |
download | fork-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.cc | 6 |
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': |