Commit graph

995 commits

Author SHA1 Message Date
John Wiegley
6d4bbe97db Rearranged some of the options code, enabled -t and -T. 2008-08-05 06:18:07 -04:00
John Wiegley
7455495d14 Moved the option code for 2.6.1 from option.cc into report.h. It's still
commented out, but now it's nearer the right place for conversion.
2008-08-05 05:00:31 -04:00
John Wiegley
806be999ef A few small changes to regress.py to make pylint mostly happy. 2008-08-05 03:34:25 -04:00
John Wiegley
98c05e8eb2 Added infrastructure for running regression tests, since I would like to make
sure that nothing breaks again once a bug in closed.
2008-08-05 03:20:14 -04:00
John Wiegley
6194cccdd3 Added version.m4 to the ignore list. 2008-08-05 01:59:27 -04:00
John Wiegley
85aa048f55 The version script is no longer needed either. 2008-08-04 17:29:47 -04:00
John Wiegley
32188cfaeb Removed version.m4, since this is generated from version.m4.in. 2008-08-04 17:26:47 -04:00
John Wiegley
fb31f5c065 Removed unnecessary clean rules, since git-clean does the job very nicely. 2008-08-04 17:22:04 -04:00
John Wiegley
9c9a34388a First round of work to get the balance report working again. 2008-08-04 16:24:41 -04:00
John Wiegley
966b231f23 When doing a command-line tag search, search for :tag:, not just tag. 2008-08-04 16:10:54 -04:00
John Wiegley
fb85292b55 Changed the #include's in ledger.h so that UnitTests would build again. 2008-08-04 15:54:13 -04:00
John Wiegley
04ca4909f6 Ignore the UnitTests binary. 2008-08-04 15:53:55 -04:00
John Wiegley
007f4ecb60 Changed the way that version info is included into a Ledger build. 2008-08-04 15:50:58 -04:00
John Wiegley
bcffbc96ba Regular expressions are working again, such that very basic register reports
are now possible.
2008-08-03 23:44:18 -04:00
John Wiegley
8a21391d0a Got pre-compiled headers working again, which are used if --devel is passed to
acprep.
2008-08-03 22:30:43 -04:00
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
3e4b016940 Added several missing copyright notices. 2008-08-03 20:56:43 -04:00
John Wiegley
363fb6d558 Got date, payee and accounts back into the register report. 2008-08-03 00:22:55 -04:00
John Wiegley
dfc14dfff3 Re-enabled almost all of the old reporting code, which means it compiles now
within the new scheme.
2008-08-02 23:34:28 -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
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
5bf3f536b3 Restored the interval_t time and added a new "period" debugging command.
You can use 'ledger period "daily in june"' to find out how Ledger will parse
that date string, plus up to the first 20 dates it encounters in the range.
Note that the 'end' displayed is currently exclusive.
2008-08-02 00:37:36 -04:00
John Wiegley
858978de89 Journal data structures now use date_t instead of datetime_t.
This means transactions can only have day-level granularity -- which has
always been the case from an data file point of view.  The advantage to this
restriction is that reports will now be immune from daylight savings related
bugs, where a transaction falls to the wrong side of a --monthly report, for
example.
2008-08-01 17:37:22 -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
8ed99e621d Turned some #if 0'd code into a comment. 2008-08-01 03:11:45 -04:00
John Wiegley
af344b1ab1 Improved the output from some debugging commands.
There are now three commands one can use to interact with value expressions
directly:

  ledger parse EXPR       # shows the parse tree resulting from EXPR
  ledger compile EXPR     # shows what the compiled tree looks like
  ledger eval EXPR        # print the resulting value, useful in scripts
2008-08-01 02:53:32 -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
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
567902b173 Simplified the format_t code so that it no longer references any particulars
about journal objects.  This is all done through value expressions now.
2008-08-01 01:37:58 -04:00
John Wiegley
e5048ec71b Change many uses of for+iterator to use Boost.Foreach. 2008-07-31 17:48:29 -04:00
John Wiegley
99313ebc6c Revised the way that exceptions are thrown around. Instead of context being a
complicated string of pointers, it's now just a global block of text that gets
appended to as the error is being thrown up, and can be displayed at the catch
point if desired.  There are almost no cases where a thrown exception will not
result in an error message being displayed to the user.
2008-07-31 06:24:45 -04:00
John Wiegley
8afd926a27 Cleaned up some method names and documentation relating to values. 2008-07-31 05:05:24 -04:00
John Wiegley
8276b51f56 A new binary_cache_t object has been creating to manage saving and restoring a
Ledger session from a cache file.  It doesn't work at all yet, though at least
the major structures are in place now.
2008-07-31 04:28:58 -04:00
John Wiegley
208c414ab9 Fixed the clean targets in Makefile.am. Use 'all-clean' to wipe everything
generated.
2008-07-30 16:27:01 -04:00
John Wiegley
80f87bc100 Corrected a failing test. 2008-07-30 15:57:03 -04:00
John Wiegley
544f69108b Updated acprep to reflect a more modern OS X system. 2008-07-30 15:26:29 -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
230d7fd602 Reorganized the ordering of filenames in Makefile.am, to better reflect
Ledger's internal architecture.
2008-07-30 03:27:30 -04:00
John Wiegley
5aef1add42 Merged over fix to #205 from v2.6.1b, which deals with small commodity
rounding.
2008-07-29 21:47:54 -04:00
John Wiegley
1bb29cdbb7 The register report has begun printing real data, although not all the pieces
are in place yet and the formatting is still off.
2008-07-29 21:44:21 -04:00
John Wiegley
42e1d725aa The next value expression scheme is working, but the individual accessor
functions for each of the journal objects has yet to be ported.
2008-07-29 21:05:08 -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
200d919fe7 Changed the way scopes are structured for an upcoming design change. 2008-07-29 18:57:02 -04:00
John Wiegley
d073a7e8a5 Move the value expression code into libamounts, since it really belongs with
value_t, rather than the rest of Ledger proper.
2008-07-29 06:17:37 -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
63039ade92 Added the skeleton for the upcoming value_expr unit tests. 2008-07-28 03:42:18 -04:00
John Wiegley
e14d7b6e54 Cleaned up the value expression code a bit before undertaking the real work of
getting everything back up to what it was (plus the new code written for 3.0).
2008-07-27 20:37:21 -04:00
John Wiegley
0c76ac5b8f Merge branch 'master' into v2.7a 2008-07-27 19:50:25 -04:00