summaryrefslogtreecommitdiff
path: root/src/compare.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
|
* Avoid making references to nullKunht Kun2022-03-171-8/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | In `compare_items` if `sort_order` is a top level expression, it has no context and `get_context()` method returns the null pointer. To see this, run $ ledger -f test/input/demo.ledger --sort display_amount reg --debug scope.symbols and there will be many lines like [DEBUG] Binding scope 0 with ... In such case making a reference to the context is an undefined behavior (honestly the dereferencing itself feels quite problematic, but many compilers just run without any complaints) and could potentially cause segfaults. Therefore, we change to use only the grandchild scope (`left` or `right`) for `find_sort_values` here. Note that it may seem to be more appropriate to use `report` here for the parent scope. However, in `find_sort_values` which is called right after, the `report` scope is always bound to this scope. So we only use grandchild scope to avoid unnecessary operations. Fixes #2069.
* [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]
* Item sorting should have access to the report scopeJohn Wiegley2017-01-041-0/+16
|
* [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
|
* Increased file copyrights to 2012John Wiegley2012-02-291-1/+1
|
* Introduced a new SCOPE expression terminalJohn Wiegley2012-02-201-1/+1
|
* Minor simplifications to valexpr parserJohn Wiegley2010-09-051-3/+5
| | | | | The most significant change is the way CONS sequences are parsed, and that now instead of =/:=, the operators are ==/=.
* Untabified all source filesJohn Wiegley2010-06-111-4/+4
|
* Updated copyrights to 2003-2010John Wiegley2010-03-051-1/+1
|
* Whitespace fixJohn Wiegley2009-11-101-2/+1
|
* Fixed sorting in bal reports when --flat is usedJohn Wiegley2009-10-261-33/+27
| | | | | | | Note that sorting on the "total" is not the same thing as sorting on the "display_total" when multiple commodities are in use and the -X flag is selected! One should always sort on display_total, since that's the value which is shown in the report. 'T' is a synonym for display_total.
* Enabled use of pre-compiled headers by defaultJohn Wiegley2009-03-101-0/+2
|
* Reduced the #include dependency tree to a minimumJohn Wiegley2009-03-041-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".
* Made commodity reduction during parsing consistentJohn Wiegley2009-02-241-2/+1
|
* The Great Renaming, Part IIJohn Wiegley2009-02-231-7/+7
| | | | | The last commit did not contain the majority of changes because of a slight mishap. This contains the real changeset.
* Renamed O_COMMA to O_CONS, and changed semanticsJohn Wiegley2009-02-231-1/+1
| | | | | | 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.
* Simplify account total values before comparisonJohn Wiegley2009-02-191-2/+7
| | | | | | This way, if two account values are BALANCE types containing only a single AMOUNT, then it will do the sorting comparison of the amounts -- since otherwise balances are ignored for the purposes of sorting.
* If a sorting value can't be found, report an errorJohn Wiegley2009-02-191-0/+3
|
* Renamed a function to sort_value_is_less_thanJohn Wiegley2009-02-121-2/+2
| | | | | The purpose was to provided a clearer relationship between the function name and its expected arguments.
* Sorting expr now uses "-" to indicate descendingJohn Wiegley2009-02-121-36/+32
| | | | | For example: -S payee,-date sorts 1) ascending by payee, then 2) descending by date.
* The --sort flag now accepts multiple terms (-S payee,date).John Wiegley2009-02-121-2/+31
| | | | However, there is no way yet to reverse the meaning of a given term.
* Increased copyright range to include 2009.John Wiegley2009-01-201-1/+1
|
* Moved around most of the files so that source code is in src/, documentationJohn Wiegley2008-08-051-0/+85
is in doc/, etc.