Commit graph

7 commits

Author SHA1 Message Date
John Wiegley
bbdab79302 Rearranged the code a bit, breaking walk.cc into several different files:
compare         compare_items<T>
  handler         item_handler<T>
  iterators       used to iterators sets of journal objects
  filters         derived from item_handler, they morph the result set
  output          derived from item_handler, these do the printing

Also, created a new 'help' files which contains just Ledger's help text.
2008-08-03 21:38:53 -04:00
John Wiegley
5a90fe7357 Moved xact_xdata_t into xact_t itself, as a set of "extended data" that might
be gathered during reporting.

Removed the references to accounts and such from the mask logic, which means
that the value expression "acount =~ /foo/" is needed in place of just
"/foo/".
2008-08-02 22:45:35 -04:00
John Wiegley
7b3c8c03c5 Changed the way that bare masks are parsed. There is still some coupling
here, albeit just through flag values.  It needs to be changed, though.
2008-08-02 17:07:04 -04:00
John Wiegley
9a9e06554e Formatting now relies exclusively on value expressions.
What this means is that the utility code, basic math, value expressions,
string formatting and option handling are now entirely decoupled from the rest
of the code.  This decoupling not only greatly simplifies the more basic parts
of Ledger, but makes it much easier to test and verify its completeness.

For example, when the formatting code %X is seen by the format parser, it
turns into a call to the expression function fmt_X, which must be defined when
the format string is first compiled against an object.  If that object is a
transaction, the transaction's scope will be the first to have a chance at
providing a definition.  If an account is being reported, it will.  If neither
does, the next scope in sequence -- soon to be the current report -- will, and
then the session object that "owns" the current Ledger session.

In 2.6, the formatting code new everything about transaction and accounts, and
relied on flags to communicate special details between them.  Now the
transaction will offer the details for its own reporting, while the formatter
worries only about strings and how to output them.
2008-08-02 06:42:36 -04:00
John Wiegley
c98be73173 Re-implemented ?: parsing in value expressions. "a ? b : c" is implemented by
translating it into the equivalent syntax tree "(a & b) | c", since this
expression evaluates to the value of b if a is true, otherwise c.
2008-08-01 01:56:13 -04:00
John Wiegley
2aff35215f Enabled a huge number of warning flags for g++ in acprep, and fixed them all
except for several unused parameter warnings (because there is so much code
still #if 0'd out), and one implicit conversion from long long to long which
still has to be dealt with.
2008-07-30 05:12:46 -04:00
John Wiegley
4518ea9540 Value expression architecture is now rewritten, but the functionality of the
old system (for example, the meaning of 'a') has yet to be restored.  In the
new scheme, this will be done by definition a function outside of the value
expression logic, rather than the tight coupling between journal innards and
value expressions that occurred in 2.x.
2008-07-29 05:59:38 -04:00