Commit graph

36 commits

Author SHA1 Message Date
John Wiegley
ab416f759f Updated copyrights to 2003-2010 2010-03-05 22:14:10 -05:00
John Wiegley
192972f854 Renamed the "args" command to "query" 2010-03-04 13:37:08 -05:00
John Wiegley
e27ba3e1ff It's OK for a report query to be empty
It's always possible the user only specified a display predicate.
2009-11-18 23:19:51 -05:00
John Wiegley
e4b3f0bb3a The new period parser is passing all tests 2009-11-18 05:45:48 -05:00
John Wiegley
7fe369eb49 The new period parser is implemented, but untested 2009-11-18 04:11:14 -05:00
John Wiegley
c28d828d8e Renamed date_interval_t::end to finish 2009-11-17 21:51:51 -05:00
John Wiegley
fb8be53edb Redesigned the format_t class 2009-11-09 02:06:08 -05:00
John Wiegley
c3535d06c8 Redesigned the expr_t, predicate_t, query_t classes 2009-11-09 02:06:06 -05:00
John Wiegley
3dc200983d Moved xdata clearing code into each type proper 2009-11-05 02:27:39 -05:00
John Wiegley
a77d9fc261 Added error message if a predicate query is invalid 2009-11-03 15:34:08 -05:00
John Wiegley
6538a2d1b8 Extended xact example used by some pre-commands 2009-11-01 21:17:53 -05:00
John Wiegley
52433e56e5 Fixed "show" keywords, and added // syntax 2009-10-28 23:44:57 -04:00
John Wiegley
218a333e83 Fixes to the new query expression parser 2009-10-28 23:07:03 -04:00
John Wiegley
47df7dd60e Rewrote the report query parser
It is now a full parser that parses report queries directly into value
expression trees.  These then get rendered into text so that other
options may extend the expression.
2009-10-28 18:40:31 -04:00
John Wiegley
f1523b5464 The new code is working now. 2009-03-16 03:44:27 -04:00
John Wiegley
a05353e269 First iteration of the new date_interval_t rewrite 2009-03-15 22:39:44 -04:00
John Wiegley
110f0b8023 Enabled use of pre-compiled headers by default 2009-03-10 17:02:03 -04:00
John Wiegley
c11d325712 Reduced the #include dependency tree to a minimum 2009-03-04 23:53:43 -04:00
John Wiegley
710e4792d1 Added a "show" report query term
Everything beyond the show modifies the --display predicate, and
everything before modifies the --limit predicate.
2009-03-02 22:33:43 -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
944c63e6f2 The Great Renaming, Part II
The last commit did not contain the majority of changes because of a
slight mishap.  This contains the real changeset.
2009-02-23 19:07:30 -04:00
John Wiegley
1f39d4148e Create a new interactive_t helper class
The purpose of this class is much like Emacs' (interactive) form: it
allows a value expression function to declare exactly how many
arguments, and of what type, it intends to receive.  It then offers
type-safe access to theese arguments in a consistent manner.

An example value expression function definition in C++:

    value_t fn_foo(call_scope_t& scope) {
      // We expect a string, an integer, and an optional date
      interactive_t args(scope, "sl&d");

      std::cout << "String  = " << args.get<string>(0)
                << "Integer = " << args.get<long>(1) << std::endl;

      if (args.has(2)) // was a date provided?
        std::cout << "Date    = " << args.get<date_t>(2) << std::endl;

      return NULL_VALUE;
    }

There is also an in_context_t<T> template, which finds the context type
T in the current scope hierarchy.  The in_context_t then also acts as a
smart pointer to reference this context object, in addition to serving
the same duty as interactive_t.  This combination of intent is solely
for the sake of brevity.

    value_t fn_bar(call_scope_t& scope) {
      in_context_t<account_t> env(scope, "sl&d");
      std::cout << "Account name = " << env->fullname()
                << "String arg   = " << env.get<string>(0)
                << std::endl;
      return NULL_VALUE;
    }

As you can see here, 'env' acts as a smart pointer to the required
context, and an object to extract the typed arguments.
2009-02-21 18:49:43 -04:00
John Wiegley
f2f52066d2 Added a --strict session option
When enabled, if any accounts or commodities are seen in an uncleared
transaction, which were not seen previously in a cleared or pending
transaction or a textual directive dealing with accounts or commodities,
a warning is generated about the unknown item.
2009-02-19 22:36:08 -04:00
John Wiegley
f232d558a8 Strip annotations from the "parse" result
This way the value shown follows the current reporting options.
2009-02-15 17:54:08 -04:00
John Wiegley
a9061811ce Greatly improved output from the "format" command
It now shows the formatted result against a sample entry, similar to
what "parse" now does.
2009-02-13 19:25:15 -04:00
John Wiegley
44518bc640 Wired up the "entry" command from 2.x, though it still needs to be ported. 2009-02-10 22:37:05 -04:00
John Wiegley
3c3606aa0d Break libledger_data's dependency on session_t. 2009-02-09 18:46:01 -04:00
John Wiegley
cad86ed87f For the "parse" pre-command, provide a sample transaction context. 2009-02-09 17:27:26 -04:00
John Wiegley
fd53d12bf8 Join command-line arguments before handling pre-commands. 2009-02-09 17:27:16 -04:00
John Wiegley
d6d0b75bf0 Repaired the output of the "eval" command. 2009-02-08 04:32:46 -04:00
John Wiegley
17c7037da9 Correction to debug output. 2009-02-07 00:08:08 -04:00
John Wiegley
e5befb0102 Fixed the debug output of the pre-command "args". 2009-02-07 00:04:19 -04:00
John Wiegley
cf6babcf90 Restored all the option handlers from 2.6.2, but not the options themselves. 2009-02-06 03:31:41 -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
3434650848 Removed the binary caching code, and the XML, QIF and Gnucash parsers. 2009-02-03 12:22:10 -04:00
John Wiegley
ae65e8ae05 Moved the pre-commands to their own file, and created new "args" command. 2009-02-01 18:36:28 -04:00