Commit graph

14 commits

Author SHA1 Message Date
John Wiegley
e52a6a9bd8 More infrastructure work toward getting journal objects to provide their own
information in an abstract manner.
2008-08-02 16:32:16 -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
ea3b386062 Added a new 'format' debugging command, which dissects the formatting
expression in its argument.
2008-08-01 03:44:22 -04:00
John Wiegley
d213b32ffc Value expressions now auto-compile themselves on first use if the expr_t
object is not constant.  This saves classes that use expr_t from having to
track such a detail themselves.
2008-08-01 02:20:29 -04:00
John Wiegley
ea27d1b45a Moved around and renamed a very large amount of code in order to rationalize
the way that value expressions extract information from journal objects.
2008-07-29 20:10:03 -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
John Wiegley
1741c80fe4 rewrote the way registers are computed -- again 2004-08-04 03:12:26 -04:00
John Wiegley
f570e6644f brought back the "print" and "equity" reports; this time much better! 2004-07-31 07:42:34 -04:00
John Wiegley
493694f848 predicate are now used instead of constraints 2004-07-30 23:42:59 -04:00
John Wiegley
94e76ae87e two major changes
Complete changed the way format strings are handled.  They are now
compiled first, which is far more efficient than what was being done
before.

Also, there is now a global ledger::commodity_t::commodities map,
which saves me from having to pass the current journal around to a
zillion different functions, for the sole purpose of making sure that
all commodity symbols that are parsed refer to the same commodity
object.
2004-07-30 21:57:02 -04:00
John Wiegley
5087a60dee added error checking to value expression parsing 2004-07-30 20:06:56 -04:00
John Wiegley
358e3329b3 moved some code around 2004-07-29 02:08:10 -04:00
John Wiegley
dd5680c267 reorganized report.cc into item.cc, expr.cc and format.cc 2004-07-27 01:33:41 -04:00
John Wiegley
161d6f79bd initial rev of 2.0 2004-07-26 23:33:51 -04:00