John Wiegley
bf24b93818
Fixes to the value expression parser and evaluator
2009-11-10 02:26:20 -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
7ca80112fc
Change the value_t::POINTER type to value_t::SCOPE
...
scope_t pointers are the only kind that are ever stored in value
objects, so there was no need to make it generic and use boost::any.
2009-10-30 17:57:29 -04:00
John Wiegley
5ddb0e9bfb
Output pointer values correctly for 64-bit systems
2009-10-27 04:00:35 -04:00
John Wiegley
9b13e77ff5
Improved debug output of "--debug expr.calc"
2009-10-25 05:01:47 -04:00
John Wiegley
991e3a3eaf
Split commodity.h/cc into three files
...
commodity.h - code for commodity_t
annotate.h - commodity annotations
pool.h - commodity pool management
2009-06-24 16:43:46 +01:00
John Wiegley
521b935aa8
Restored --percent option, added baseline test
2009-06-21 18:07:27 +01: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
e2c30cf6e4
Added ; as a sequencing operator in valexprs
2009-03-03 16:05:04 -04:00
John Wiegley
098e3b0043
Fixed parsing of '(1, 2, (3, 4))'
2009-03-03 16:02:34 -04:00
John Wiegley
19cfd9e23b
Fixed the printing of O_CONS nodes
2009-02-28 06:13:49 -04:00
John Wiegley
0efe0c63ce
Corrected output of O_CALL nodes
2009-02-27 14:06:52 -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
e919f53c99
Renamed O_COMMA to O_CONS, and changed semantics
...
In the old scheme, nested values would simply flatten and concatenate,
so that '((1, 2), 3) = (1, 2, 3)'. Now sublists are preserved, so that
sequences may be passed as arguments to functions.
2009-02-23 15:04:07 -04:00
John Wiegley
fc349389e3
Restored the --budget option
2009-02-20 23:12:23 -04:00
John Wiegley
6f7f87699c
Parse '/' in an operator context as "div"
2009-02-15 16:34:34 -04:00
John Wiegley
94aa8e5a91
Changed debug category op.calc to expr.calc
2009-02-15 15:42:12 -04:00
John Wiegley
b53f844129
Removed an excessive error check.
2009-02-12 02:34:54 -04:00
John Wiegley
e777abe854
Revert "If a valexpr identifier is unknown at calc time, re-compile at that point."
...
This reverts commit 4a463aca3b .
2009-02-09 00:29:51 -04:00
John Wiegley
4a463aca3b
If a valexpr identifier is unknown at calc time, re-compile at that point.
2009-02-09 00:02:59 -04:00
John Wiegley
d4d7090f3c
Perhaps expr_t objects to remember their scope "context".
2009-02-08 21:15:22 -04:00
John Wiegley
2d5ad7dee8
Added support for value expression definitions.
...
Example:
] expr f(x) := x + 100
] expr f(100)
200
2009-02-08 04:30:05 -04:00
John Wiegley
7594639581
Better semantics for the ?: ternary operator.
2009-02-08 03:01:51 -04:00
John Wiegley
aebfc92a4d
Added debug code to the op_t calculation routine.
2009-02-07 23:30:53 -04:00
John Wiegley
0c8970584e
Removed handling of the unnused INDEX operator.
2009-02-07 18:42:12 -04:00
John Wiegley
011f35b730
Implemented expr_context.
2009-02-07 04:27:28 -04:00
John Wiegley
682544ef17
Refer to empty expression operators as simply NULL.
2009-02-07 04:27:04 -04:00
John Wiegley
17c7037da9
Correction to debug output.
2009-02-07 00:08:08 -04:00
John Wiegley
4854cead4f
When recompiled an expr_t, forget old definitions.
2009-02-05 02:45:29 -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
f49dfce302
Fixed the processing of O_NOT operations.
2009-02-03 18:11:59 -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
bd9ffed9db
Calculate the right-hand side O_MATCH, now that masks are values.
2009-02-02 15:17:02 -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
cadb02c257
Fixed a display problem when dumping O_MATCH expressions.
2009-02-01 18:36:40 -04:00
John Wiegley
c5795c66c9
"div", or "//", is now the operator of division.
2009-01-31 01:21:14 -04:00
John Wiegley
00fdadedcc
Removed extraneous parentheses.
2009-01-23 01:09:31 -04:00
John Wiegley
5ba81765ea
Added some debug code.
2009-01-23 01:09:23 -04:00
John Wiegley
7b76ea5cbc
Errors while calculating value expressions now display meaningful error
...
context.
2009-01-22 18:54:24 -04:00
John Wiegley
965df4a404
Whitespace changes.
2009-01-22 18:53:08 -04:00
John Wiegley
ccedf7d57f
Parse != as !(==) and !~ as !(=~), for simplicity's sake.
2009-01-22 16:25:51 -04:00
John Wiegley
887828a40c
Increased copyright range to include 2009.
2009-01-20 01:53:31 -04:00
John Wiegley
72c09cc0bf
Generate a better error if a function operand is invalid.
2009-01-19 22:29:36 -04:00
John Wiegley
660c40a6d3
Corrected several assertions which could occur when using unary operators and
...
unresolved identifiers.
2008-09-16 05:04:21 -04:00
John Wiegley
08488d4cd7
Removed more dead code and todo comments, and made it possible to stream
...
compiled value expressions.
2008-08-17 04:41:02 -04:00
John Wiegley
891d7b87c8
Removed some dead code and updated the binary streaming code for op_t and
...
value_t.
2008-08-17 03:15:57 -04:00
John Wiegley
fd2e6c2502
Ledger now builds without any significant warnings, except for one file. Some
...
of the warnings had to be temporarily disabled, but will be checked again once
the code has moved into master.
2008-08-10 02:52:38 -04:00
John Wiegley
f6f4a46cf5
Moved around most of the files so that source code is in src/, documentation
...
is in doc/, etc.
2008-08-05 18:05:49 -04:00