summaryrefslogtreecommitdiff
path: root/src/scope.cc
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright yearAlexis Hildebrandt2023-02-021-1/+1
| | | | [skip ci]
* Update copyright statement for 2022Alexis Hildebrandt2022-07-021-1/+1
|
* [misc] Update year in copyright notice to 2017Alexis Hildebrandt2018-01-271-1/+1
| | | | [ci skip]
* [misc] Update year in copyright notice to 2017Alexis Hildebrandt2017-01-051-1/+1
| | | | [ci skip]
* [misc] Update year in copyright notice to 2016Alexis Hildebrandt2016-01-021-1/+1
| | | | [ci skip]
* Bump copyright notice to 2015Alexis Hildebrandt2014-12-271-1/+1
| | | | | | The following script makes it a no-brainer: % NEXT_YEAR=2015; ag -l 'Copyright.*Wiegley' \ | xargs sed -i '' -e "s/\(Copyright.*\)-20[0-9]\{2\}/\1-${NEXT_YEAR}/"
* Bump copyright information to 2014Alexis Hildebrandt2014-02-021-1/+1
|
* Bump copyright information to 2013John Wiegley2013-02-181-1/+1
|
* Switch to using Boost.FormatJohn Wiegley2012-05-141-3/+3
|
* Many options now have additive effectJohn Wiegley2012-03-071-1/+2
| | | | | | | | | 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
* Whitespace fixesJohn Wiegley2012-03-071-2/+2
|
* Increased file copyrights to 2012John Wiegley2012-02-291-1/+1
|
* Whitespace fixJohn Wiegley2012-02-211-2/+1
|
* The new SCOPE mechanism is workingJohn Wiegley2012-02-211-2/+6
|
* Report error context in expressions more preciselyJohn Wiegley2010-06-131-1/+1
|
* Completely reworked argument passing in expressionsJohn Wiegley2010-06-131-0/+19
|
* Untabified all source filesJohn Wiegley2010-06-111-4/+4
|
* Updated copyrights to 2003-2010John Wiegley2010-03-051-1/+1
|
* Very minor but easy optimization for symbol_scope_tJohn Wiegley2009-11-241-10/+14
| | | | | | | Lots of symbol_scope_t throwaway objects get created during value expression calculation, and 99% of them are never used. Therefore, the std::map which each contains is now within an optional<> wrapper, so that no constructor happens unless one is actually used.
* Moved journal reading code into journal_tJohn Wiegley2009-11-051-0/+2
|
* Segregated symbols into 5 separate namespacesJohn Wiegley2009-11-041-10/+13
| | | | | | | | | | | | | | | | | | | | | 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)
* Enabled use of pre-compiled headers by defaultJohn Wiegley2009-03-101-0/+2
|
* Marked all strings needing internationalizationJohn Wiegley2009-02-251-1/+1
| | | | | | | | | | | | | | | | 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".
* Create a new interactive_t helper classJohn Wiegley2009-02-211-17/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Moved around some functions for clarityJohn Wiegley2009-02-161-0/+17
|
* Added support for value expression definitions.John Wiegley2009-02-081-3/+2
| | | | | | | | Example: ] expr f(x) := x + 100 ] expr f(100) 200
* Increased copyright range to include 2009.John Wiegley2009-01-201-1/+1
|
* Removed todo comments and dead code.John Wiegley2008-08-171-59/+0
|
* Moved around most of the files so that source code is in src/, documentationJohn Wiegley2008-08-051-0/+123
is in doc/, etc.