Commit graph

52 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
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
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
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
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
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
ebfe2d1011 Updated all copyright messages to 2003-2008. 2008-07-27 02:26:35 -04:00
John Wiegley
aa4f0d4364 Added the var_t helper class, which can be seen in the beginning
implementation of register_command in main.cc.
2008-07-21 20:41:42 -04:00
John Wiegley
8601a2a8bf Added back the --version option, and changed acprep so that it hacks on the
generated Makefile to greatly reduce unneeded verbosity.
2008-07-21 19:03:26 -04:00
John Wiegley
ac5cc7796f Merged in from master. 2008-07-21 17:34:39 -04:00
John Wiegley
0c800d968c A patch from Juergen Daubert, which fixes the output from --version. 2008-07-21 06:22:03 -04:00
John Wiegley
52fc9f2e44 Brought in the final round of 3.0 code, although it does not compile yet:
report, session, parts of xpath, main, journal, option.
2008-07-20 05:03:54 -04:00
John Wiegley
d568319495 Merged in bug fixes from master (done for 2.6.1b) 2008-07-19 21:36:34 -04:00
John Wiegley
45f6aa3f93 Reverted changes to option.cc in commit 2bdafd71, since I do not want to
change the exclusive (as opposed to inclusive) behavior of -e DATE.
2008-07-17 05:02:36 -04:00
Nathan Jones
885355f367 Fix compile errors with gcc 4.3 2008-05-23 01:29:12 -06:00
John Wiegley
d159501993 The code is compiling again, but it's far from being able to run yet. 2008-05-08 02:50:19 -04:00
John Wiegley
225338d784 option.cc: Include unistd.h, to pull in the prototype for access(). This was
preventing OpenBSD 4 from building.

acprep (CXXFLAGS): Don't use the compile flag -Wno-long-double except on OS X.
2008-05-07 04:19:37 -04:00
John Wiegley
fcae023196 Reverted the master branch back to the state of v2.6.0.90, because I intend to
be much more thorough about what gets commited to the master and why.  This
will still be the branch where new work will be checked in, but only after
thorough review in a development branch.
2008-05-02 01:24:29 -04:00
John Wiegley
925597a0ff Fixed #36: -e wasn't parsing the passed in date correctly. 2008-04-13 05:11:17 -04:00
John Wiegley
c851e1dcba Corrected help documentation for --budget flag. 2008-04-13 05:08:37 -04:00
John Wiegley
04dfda2282 Made separate modules for the csv command, since the prior method was
not fully correct.
2008-04-13 02:41:33 -04:00
John Wiegley
2982e637c2 *** empty log message *** 2008-04-13 02:41:32 -04:00
John Wiegley
f9b874e1cb Added elision styles. 2008-04-13 02:41:32 -04:00
John Wiegley
5a93d4819e Reworked the way date/times are handled. 2008-04-13 02:41:32 -04:00
John Wiegley
a5aff9eee9 Several fixes to lot price handling. 2008-04-13 02:41:31 -04:00
John Wiegley
e32d9e64a7 Added much better error location. 2008-04-13 02:41:29 -04:00
John Wiegley
96d6d62ad9 Began support for improved commodity handling. 2008-04-13 02:41:28 -04:00
John Wiegley
7901598f1d Checked in all major updates. 2008-04-13 02:41:27 -04:00
John Wiegley
a8012940f4 Removed Python integration support. 2008-04-13 02:41:21 -04:00
John Wiegley
2cf6fe3fc7 (process_environment): If the environment tag is NULL (which is really
should never be), then don't use it.
2008-04-13 02:41:04 -04:00
John Wiegley
c9fb11bd60 updated to version 2.0 2008-04-13 02:40:47 -04:00
John Wiegley
a32173ace6 changes 2008-04-13 02:40:47 -04:00
John Wiegley
ccf5571910 fixed a serious problem that prevented environment settings from being read 2004-09-27 18:29:11 -04:00
John Wiegley
f8a62c444f made several of the buffers used non-static 2004-09-26 23:48:31 -04:00
John Wiegley
3a3227298d if a commodity price cannot be downloaded, report it as an error 2004-09-25 02:51:55 -04:00
John Wiegley
ecf8a4b79c whitespace fix 2004-09-23 00:29:17 -04:00
John Wiegley
061e19e302 make config_t visible to Python; almost possible to implement main.cc in main.py 2004-09-14 06:25:29 -04:00
John Wiegley
fcaaa37201 switch from using deque back to list; affects speed by up to 30%! 2004-09-06 05:38:32 -04:00
John Wiegley
032afa5657 a bit of a reorg; still much more to go 2004-08-29 03:23:55 -04:00
John Wiegley
16841fbae3 added (disabled) code for Boost.Python 2004-08-27 23:38:39 -04:00
John Wiegley
c6860970f2 removed all uses of std::vector; simplified some code 2004-08-24 20:01:51 -04:00
John Wiegley
876f5b84ab a few fixes 2004-08-24 02:40:23 -04:00
John Wiegley
6d5333b896 use value_t instead of balance_pair_t; gains for 10% binary, 2% textual 2004-08-21 23:18:45 -04:00
John Wiegley
048d59afbc added missing header 2004-08-17 05:04:13 -04:00
John Wiegley
325cf53ea7 several significant speed improvements (removed excessive copying of strings) 2004-08-17 04:57:38 -04:00
John Wiegley
cd7d7e5b88 slight fixes 2004-08-17 01:50:38 -04:00
John Wiegley
0cac03ba7d performance tweaks 2004-08-13 17:41:29 -04:00