Alexis Hildebrandt
2b9208e850
Bump copyright information to 2014
2014-02-02 12:36:22 +01:00
John Wiegley
0951bcebef
Bump copyright information to 2013
2013-02-18 06:51:21 -06:00
John Wiegley
4681e58d7f
Converted the Ledger build system to use CMake
2012-05-20 04:48:05 -05:00
John Wiegley
f4f3058b8c
Switch to using Boost.Format
2012-05-14 21:44:00 -06:00
John Wiegley
927d404ad5
Added a syntax error check
2012-03-13 10:33:59 -05:00
John Wiegley
e65fc729bc
Made split_cons_expr a global function
2012-03-13 10:33:51 -05:00
John Wiegley
2a41649584
Improve error reporting of nested function calls
2012-03-11 03:05:33 -05:00
John Wiegley
4d01143400
Many improvements to lambdas and function calling
2012-03-08 00:44:40 -06:00
John Wiegley
ae4ef7a88d
More work done on proper evaluation of lambdas
2012-03-07 21:22:07 -06:00
John Wiegley
7e250696e0
Many options now have additive effect
...
For example, -A and -V used to override each other, whereas now:
-A report the average amount
-V report all amounts at current value
-AV report the current value of the average
-VA report the average of all current values
2012-03-07 12:46:46 -06:00
John Wiegley
b17b6cd9d4
Fixed parameter and argument scoping for O_CALL nodes
2012-03-07 05:38:13 -06:00
John Wiegley
65835a89cc
Dump IDENT referral values in op_t::dump
2012-03-07 05:21:40 -06:00
John Wiegley
71d0033b6f
Corrected several compile and link problems
2012-03-06 23:04:27 -06:00
John Wiegley
acb5e1beea
Generalized function call parsing
...
Directly calling a lambda now works:
(x -> x + 10)(10) => 20
2012-03-05 22:01:41 -06:00
John Wiegley
fa3805282a
Added an assert
2012-03-05 05:53:41 -06:00
John Wiegley
c8c2a17e28
Fixed invocation of lambda expressions
...
foo = x, y, z -> print(x, y, z)
foo(1, 2, 3)
However, this still does not work:
(x, y, z -> print(x, y, z))(1, 2, 3)
2012-03-05 05:03:51 -06:00
John Wiegley
cfd7ffb126
Provide more context if a valexpr function call fails
2012-03-01 22:20:38 -06:00
John Wiegley
e2afc783db
Increased file copyrights to 2012
2012-02-29 22:32:23 -06:00
John Wiegley
c47350dce9
Corrected handling of nested definitions
2012-02-21 03:53:00 -06:00
John Wiegley
1837e32391
The new SCOPE mechanism is working
2012-02-21 01:45:26 -06:00
John Wiegley
bc9ff7095f
Introduced a new SCOPE expression terminal
2012-02-20 17:20:22 -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
c4a3a7bbe5
Changed an assert into a proper exception
2011-07-17 15:28:11 -05:00
John Wiegley
976ba4907d
O_DEFINE operator should always return NULL_VALUE
2011-07-17 15:28:02 -05:00
John Wiegley
20f4ccde96
Added some debug code
2011-02-10 23:00:36 -05:00
John Wiegley
84780270f9
Added initial support for lambda functions
2010-09-06 00:56:00 -04:00
John Wiegley
e162455ebb
Minor simplifications to valexpr parser
...
The most significant change is the way CONS sequences are parsed, and
that now instead of =/:=, the operators are ==/=.
2010-09-05 01:38:47 -04:00
John Wiegley
011bf030a2
Generalized the semantics of FOO.BAR in valexprs
...
Previously, FOO was evaluated to return a scope, and BAR was an
identifier looked up in that scope. However, this prevented scope-local
functions from being called (since that is a CALL, not a plain IDENT).
Now the meaning of the "." operator is that it evaluates the left
operand in a scope type context, pushes that scope as the current object
context, and then evaluates BAR in that context.
Thus the bare word "amount" in an account context calls the same
function that "account.amount" would if evaluated in a posting context.
2010-06-24 20:37:12 -04:00
John Wiegley
024fb4f3e0
Fixed how valexpr function defs and calls work
2010-06-24 20:22:11 -04:00
John Wiegley
968a6f3c0a
Changes for building with Visual Studio 2008
2010-06-15 05:14:00 -04:00
John Wiegley
2ea075dc4f
Report error context in expressions more precisely
2010-06-13 18:39:26 -04:00
John Wiegley
ea1642b3f9
Completely reworked argument passing in expressions
2010-06-13 05:02:14 -04:00
John Wiegley
dcdd9c4a56
If a type context exists, confirm the result matches
2010-06-13 01:03:49 -04:00
John Wiegley
1bc5b894df
Expression evaluations now have a "type context"
...
Thus, an expression can know if the context in which it's being
evaluated requires a string, and if so, determine it's output
accordingly. For example:
account ; returns the full name of the posting's account
account.total ; here the context is SCOPE, so account is an obj
2010-06-13 01:03:48 -04:00
John Wiegley
dea2aed0b5
Untabified all source files
2010-06-11 17:02:25 -04:00
John Wiegley
b848ace768
Allow opt -NDEBUG build to complete without warnings
2010-06-04 06:02:00 -04:00
John Wiegley
d5f8c3bc57
Added O_EXPAND operator, to handle macros
2010-05-08 02:02:10 -04:00
John Wiegley
ab416f759f
Updated copyrights to 2003-2010
2010-03-05 22:14:10 -05:00
John Wiegley
4e30fcdf40
Many improvements to Ledger's Python bindings
2009-11-19 22:24:24 -05:00
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