Commit graph

222 commits

Author SHA1 Message Date
John Wiegley
ff89cb9c4d Fixed a bug that was causing includes to crash
Fixes #661
2012-03-01 16:22:08 -06:00
John Wiegley
9ec9cdf41e Started writing Python unit tests 2012-03-01 05:50:07 -06:00
John Wiegley
944e580825 Refactored the notion of "the current parsing context" 2012-03-01 03:31:28 -06:00
John Wiegley
e2afc783db Increased file copyrights to 2012 2012-02-29 22:32:23 -06:00
John Wiegley
8021955292 Removed incorrect session.h include in textual.cc 2012-02-29 22:12:24 -06:00
John Wiegley
656e46e182 Renamed actual/effective dates to primary/auxiliary 2012-02-28 03:02:16 -06:00
John Wiegley
7a55c7ffc1 Allow xact notes on periodic transactions
Fixes #448
2012-02-28 02:47:22 -06:00
John Wiegley
6d04f60573 Fixed display problem in an error message 2012-02-28 00:08:21 -06:00
John Wiegley
07137cc042 'end apply' doesn't need a qualifier 2012-02-27 12:39:12 -06:00
John Wiegley
440371d296 Added a TODO comment 2012-02-27 12:39:00 -06:00
John Wiegley
268127cf11 Added 'note' sub-directive to 'commodity' 2012-02-27 12:38:51 -06:00
John Wiegley
bee748cc93 Added a TODO comment 2012-02-27 12:38:39 -06:00
John Wiegley
2ec35ea6e9 Implement the "tag" metadata directive 2012-02-27 05:02:25 -06:00
John Wiegley
0e7b4fb182 Implemented account and commodity directives 2012-02-27 04:58:38 -06:00
John Wiegley
1d89093059 Output some line numbers with warnings 2012-02-27 04:10:16 -06:00
John Wiegley
61bc7362ca Added new account/payee/commodity directives
Also added supporting options: --explicit, --permissive, --pedantic, as
well as new behavior for --strict.
2012-02-27 02:31:09 -06:00
John Wiegley
aa9b07d79b Added --rich-data for 'convert', and SHA1 checksum checking 2012-02-26 15:45:15 -06:00
John Wiegley
4cf95497f9 Keep notes on their own line if parsed that way 2012-02-26 02:18:22 -06:00
John Wiegley
c3a9a7d2c5 Fixed many Clang type conversion warnings with static_cast 2012-02-17 15:17:52 -06:00
John Wiegley
c6b51a2635 Added a missing call to context.close() in the parser 2012-02-17 15:17:18 -06:00
John Wiegley
b4c870ace2 Fixes for variable shadowing (25/28) 2012-02-17 15:06:28 -06:00
John Wiegley
5e3e204766 Do not evaluate strings as booleans 2012-02-11 16:53:31 -10:00
John Wiegley
f0791bbd72 Cleanup whitespace 2011-08-18 14:48:38 -04:00
John Wiegley
add6f6ca2a Removed unused variables 2011-08-18 14:46:36 -04:00
John Wiegley
f2d99dae08 Rely on a default argument in textual.cc 2011-07-17 15:28:38 -05:00
John Wiegley
584bdb1600 Fix for Boost 1.46 and the new Filesystem library 2011-03-23 00:32:36 -04:00
John Wiegley
dc03c646eb Corrections to the regression tests 2011-03-03 23:47:11 -05:00
John Wiegley
8388baafd3 Support Boost 1.46 and Boost.Filesystem v3 2011-02-28 16:24:15 -05:00
John Wiegley
30e830626b Added "comment" and "test" directives 2011-02-12 17:55:56 -05:00
John Wiegley
2208ac1226 Fixes for compilation as C++0x code 2011-02-04 22:39:41 -05:00
John Wiegley
2f50e30b89 Scopes can now provide a description of themselves
This isn't being used yet, but it likely will to improve the information
presented to users if their value expressions fail to compile or
evaluate.
2010-06-24 19:53:59 -04:00
John Wiegley
3f899c93e6 Added new "bold" modifier to query expressions
For example:

  ledger bal assets bold checking

Or you can use expressions:

  ledger bal assets bold '=total > 1000'

This last is identical to saying:

  ledger bal -l 'account =~ /assets/' --bold-if='total > 1000'
2010-06-22 03:20:24 -04:00
John Wiegley
66de7e3055 Filename globs now surrounded by ^$ 2010-06-18 07:28:11 -04:00
John Wiegley
968a6f3c0a Changes for building with Visual Studio 2008 2010-06-15 05:14:00 -04:00
John Wiegley
dcffd218a1 Revised how Ledger handles the "current year"
Now when the Y directive sets the current year for a region, it affects
everything, as if the clock really were set back to that year.
2010-06-14 03:23:09 -04:00
John Wiegley
e3f228bd5b Fixed several misplaced parentheses 2010-06-13 19:56:10 -04:00
John Wiegley
6ef755c133 Added support for assert, check and expr directives
These can occur in many places:

  ; Within an automated transaction, the assert is evaluated every time
  ; a posting is matched, with the expression context set to the
  ; matching posting.
  = /Food/
    assert account("Expenses:Food").total >= $100

  2010-06-12 Sample
    Expenses:Food                $100
    Assets:Checking

  ; At file scope, the expression is evaluated with "global" scope.
  assert account("Expenses:Food").total == $100

  ; At the top of a transction, the assertion's scope is the
  ; transaction.  After a posting, the scope is that posting.  Note
  ; however that account totals are only adjusted after successful
  ; parsing of a transaction, which means that all the assertions below
  ; are true, even though it appears as though the middle posting should
  ; affect the total immediately (which is not the case).
  2010-06-12 Sample 2
    assert account("Expenses:Food").total == $100
    Expenses:Food                $50
    assert account("Expenses:Food").total == $100
    Assets:Checking
    assert account("Expenses:Food").total == $100
2010-06-13 01:03:48 -04:00
John Wiegley
8d2fce1ae8 Automated xacts may now contain "deferred tags"
For example, consider the following automated transaction:

  = /Food/
    ; Next Date:: date + 10
    (Expenses:Tax)                1.00
    ; Next Date:: date + 20

This will add a metadata field named 'Next Date' to the _matching
posting_, with a value that is 10 days later than that posting.  It will
also generate a new posting for that transaction, whose amount is the
same as the matching posting.  Further, it will add a 'Next Date'
metadata tag to the _generated posting_ whose value is 20 days later
than the date of the matching posting.
2010-06-13 01:03:48 -04:00
John Wiegley
1ced1f3d83 Reformatted a comment 2010-06-13 01:03:47 -04:00
John Wiegley
c558613ae4 Fixed a spelling error 2010-06-13 01:03:47 -04:00
John Wiegley
baad7272c7 Minor whitespace fix 2010-06-13 01:03:47 -04:00
John Wiegley
b1b4e2aadf Add support for typed metadata
The metadata construct 'Key: Value' is now just a special case for
'Key:: "Value"'.  Another after a :: in metadata setting is parsed as a
full value expression and typed as such.  For example:

  ; Key:: $400 + $500

  ledger -l 'tag("Key") < $1000'
2010-06-12 15:43:00 -04:00
John Wiegley
dea2aed0b5 Untabified all source files 2010-06-11 17:02:25 -04:00
John Wiegley
685b12d8d3 Allow fixated costs, as well as prices
You can now establish a fixated price automatically by way of a fixated
cost.  The syntax for this is:

  2009/11/01 Sample
      Assets                1 apple @ =$0.10
      Equity
2010-06-10 12:29:58 -04:00
John Wiegley
b848ace768 Allow opt -NDEBUG build to complete without warnings 2010-06-04 06:02:00 -04:00
John Wiegley
5cdd36f358 Further improved parsing of query expressions
Fixes #210 / D4C2DD6F-8967-4FFC-BBBC-A941F9C53475
2010-06-01 18:33:13 -04:00
John Wiegley
3fab2e1333 For Boost 1.35 and earlier, use is_regular
Fixes 0F17CB7F-A000-4F99-8471-739948AD575F
2010-05-23 00:34:26 -06:00
John Wiegley
37a3f27ef2 Corrected handling of context stack in the parser
Fixes F4A477E6-C4F6-43B1-ABCC-4DC325C2869A
2010-05-22 21:35:28 -04:00
John Wiegley
68056c1948 Guard against NULL value passed to "end" directive
Fixes 89233B6D-CB21-4162-98E3-BE38B9336070
2010-05-22 21:35:01 -04:00
John Wiegley
8dd362b57c The include directive now supports file globbing
This only happens at the base filename, not for any of the directory
names for now.
2010-03-17 02:40:42 -04:00