Commit graph

47 commits

Author SHA1 Message Date
John Wiegley
a461e17eee Added historical support for single-letter valexprs 2009-11-14 03:11:48 -05:00
John Wiegley
ab9fc6f9f0 Changed the type being throw of some exceptions 2009-11-05 05:11:01 -05:00
John Wiegley
78e6770c4c Segregated symbols into 5 separate namespaces
The different namespaces are:

  Function      Value expression functions, which receive a "context"
  Option        Command-line options
  Precommand    Commands which are invoked before reading the journal
  Command       Commands which are invoked after reading the journal
  Directive     Directives that occur at column 0 in a data file

This greatly eases the ability for Python uses to add intercept hooks to
change how the basic Ledger module functions.  An example of what should
be possible soon:

  import ledger

  def my_foo_handler(value):
      print "--foo received:", value

  ledger.add_handler(ledger.Option, "foo=", my_foo_handler)
2009-11-04 20:40:48 -05:00
John Wiegley
a0a91a61c4 If an item doesn't have a given tag, return "" 2009-11-01 21:16:47 -05:00
John Wiegley
4427016b1b Improved arg checking for several valexpr functions 2009-10-31 04:07:33 -04:00
John Wiegley
cb6f7cd54e Add a position_t object for tracking item positions
It is also optional, which is useful for generated items.
2009-10-30 17:54:54 -04:00
John Wiegley
f3565495b1 Added missing check in item_t::get_actual 2009-10-30 17:48:28 -04:00
John Wiegley
588f2ef2f5 Fixed many compiler warnings from g++ 4.4 2009-10-25 05:01:39 -04:00
John Wiegley
f161aea8ce Removed reliance on strptime/strftime
The code now uses Boost's input and output facets for times and dates.
This ensures completely consistency regarding timezones and times, and
fixes the regression test that was broken while I was away coding in
London (where it was GMT-0 and I didn't notice the difference between
local and GMT).
2009-10-11 05:19:01 -04:00
John Wiegley
521b935aa8 Restored --percent option, added baseline test 2009-06-21 18:07:27 +01:00
John Wiegley
0e64207757 If a posting comment is very short, let it hang
This applies when using the "print" report, or the "comment" variable.
2009-06-14 18:26:26 +01:00
Andrew Potter
684a9c6cbf Fix pointer const-ness in parse_tags() 2009-05-26 22:47:07 -05:00
John Wiegley
110f0b8023 Enabled use of pre-compiled headers by default 2009-03-10 17:02:03 -04:00
John Wiegley
9d4e888ef5 Cured several harmless compiler warnings 2009-03-04 04:31:34 -04:00
John Wiegley
ad42447475 Changed how comments are output to be more logical 2009-03-01 05:40:44 -04:00
John Wiegley
38122c2224 Corrected warnings g++-4.3.3 was complaining about 2009-02-28 04:54:54 -04:00
John Wiegley
645e43ef75 The print command now prints xact's effective date 2009-02-27 03:49:59 -04:00
John Wiegley
69e2c733b9 If an item tag is already set, don't overwrite it 2009-02-26 05:33:06 -04:00
John Wiegley
fbb734689b Added a new source_context function 2009-02-26 04:41:38 -04:00
John Wiegley
238bd7f8a5 Marked all strings needing internationalization
These strings are now collected automagically in the file po/ledger.pot.
If you'd like to produce a translation, just run this command after
building Ledger:

    msginit -l LOCALE -o LANG.po -i po/ledger.pot

Where LOCALE is a string like de or en_GB, and LANG is a short
descriptive word for your language.

Then send me this .po file so I can commit it to the Ledger sources
(alternatively, you could maintain the file in a fork on GitHub), and
setup the build script to format and install your new message catalog
during a "make install".
2009-02-25 03:51:42 -04:00
John Wiegley
625b94cf04 Switched from using POST_AUTO to ITEM_GENERATED 2009-02-24 02:23:20 -04:00
John Wiegley
a577e8c48e Added a new --raw option, for use with print 2009-02-21 19:45:13 -04:00
John Wiegley
d67c9fee0f Added valexpr vars for accessing item position
- filename
 - beg_line
 - beg_pos
 - end_line
 - end_pos
2009-02-19 16:22:31 -04:00
John Wiegley
d0a664d102 Fixed several unused value and param warnings 2009-02-16 16:55:18 -04:00
John Wiegley
ee5e0600aa xact metadata searches get passed up to the entry
That is, if a metadata tag cannot be found in a transaction, look in the
parent entry to see if it was set there.  Transactions "inherit"
notational details from their entries.
2009-02-14 05:37:53 -04:00
John Wiegley
1a030da55d Rewrote the "entry" command. It's ALIVE! 2009-02-11 19:14:23 -04:00
John Wiegley
6ca01af594 Fixed the use of --effective and --date-format (-y). 2009-02-09 17:27:54 -04:00
John Wiegley
623c57a623 Terminate the buffer used to read in item context. 2009-02-08 21:16:43 -04:00
John Wiegley
02bd9d29cf Improved an error message that was trying to show transaction context. 2009-02-08 20:05:56 -04:00
John Wiegley
b89d8a1fa5 Have all items respond to the "depth" property, defaulting to 0. 2009-02-08 19:53:39 -04:00
John Wiegley
aec5020d34 item_t::get_uncleared was returning true if CLEARED. 2009-02-07 22:50:38 -04:00
John Wiegley
9380d73646 The "note" expressions returns an empty string if there is no note. 2009-02-07 05:53:40 -04:00
John Wiegley
682544ef17 Refer to empty expression operators as simply NULL. 2009-02-07 04:27:04 -04:00
John Wiegley
408b819c6e Greatly simplified the way option and command handlers are defined. 2009-02-05 21:20:09 -04:00
John Wiegley
2d941730b1 Largely removed all of Ledger's use of global variables, for the REPL's sake. 2009-02-04 19:55:27 -04:00
John Wiegley
1cc33531ea Simplified the textual parser, and improved metadata support. 2009-02-04 03:34:37 -04:00
John Wiegley
2ce7ae376c Removed used of src_idx. 2009-02-03 19:06:53 -04:00
John Wiegley
43c4636d9d Removed the global references to session->report. 2009-02-03 13:03:10 -04:00
John Wiegley
46b35a015b Don't allow implicit matching of strings against masks, =~ is needed. 2009-02-02 15:16:40 -04:00
John Wiegley
b18214372e Use > quoting characters when excerpting from the user's data file. 2009-02-02 00:28:12 -04:00
John Wiegley
42bed9c001 Added a missing brace. 2009-02-02 00:24:56 -04:00
John Wiegley
9540406af1 Simplified error context handling. 2009-02-02 00:24:26 -04:00
John Wiegley
fb5428ce85 Added support for metadata and tagging, and made regexs a first-class type. 2009-02-01 22:10:32 -04:00
John Wiegley
9d267fa133 Inspired by Omari Norman, I've rewritten main.cc so it's easy to approach. 2009-01-31 18:52:34 -04:00
John Wiegley
887828a40c Increased copyright range to include 2009. 2009-01-20 01:53:31 -04:00
John Wiegley
93f884b5f2 The cleared or pending flag of a transaction overrides the flag for the entire
entry only if it is "more" cleared.
2009-01-14 00:32:02 -04:00
John Wiegley
fdc7a4e4c5 Factored common parts of entry_t and xact_t into new item_t 2008-09-19 08:06:20 -04:00