summaryrefslogtreecommitdiff
path: root/src/query.cc
Commit message (Collapse)AuthorAgeFilesLines
* Fix Query Parser for Automated Transactions (#1)Igbanam Ogbuluijah2024-06-251-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add failing test for use case TBH I don't know what I'm doing here, but this seems to fail for the right reasons enough to reflect the parser bug here. * Append to the ident on a closing brace ')' When parsing the automated rule, a scanner reads the line left-to-right char-by-char. The default behaviour is to append the char under the cursor to some `ident` string. When the cursor is on a ')', it skips the default handling and switches into some special handling: it tries to test the string it's reading if it's one of the keywords it knows, to select which type of token just got scanned. If what was scanned is not a known token, it defaults to `token_t::TERM` and returns a new token with the currently accumulated `ident` as a `token_t::TERM`. Issue is, since it skipped the appending to do some custom handling, the `token_t::TERM` will always be without its closing brace. The scanner needs to append the character under the cursor if it's falling through to default processing. * fix test case - ensure proper spacing for the posting to have an amount - ensure the posting balances against an account - the meaning of the number after `->` is the exit code * undo wrong approach * consume_next if unbalanced_braces * how this can be extended
* Fix =regex note query syntaxGwyneth Morgan2023-10-121-0/+4
| | | | | | | | | | | | The manpage documents `=regex` as equivalent to the `note regex` query syntax, but the former does not actually work as the parser only handles an equals sign in the case of `tag type=dining` syntax, and doesn't handle the case where an equals sign starts a note query. Fixing this does break queries like `tag type = dining` with spaces around the equals sign, but that syntax was not intended or documented. Closes: #2275
* Update copyright yearAlexis Hildebrandt2023-02-021-1/+1
| | | | [skip ci]
* Update copyright statement for 2022Alexis Hildebrandt2022-07-021-1/+1
|
* Use correct int return type for stream input operationskanreki2021-12-081-30/+2
| | | | | | | | This makes it safe to compare results to -1 to indicate EOF, regardless of whether char is considered signed or unsigned; and so eliminates compiler warnings on platforms such as ARM. Fixes bug #2058.
* Revert "Correction to the way parens are parsed in query expressions"John Wiegley2020-05-071-46/+9
| | | | This reverts commit 49b07a1c19489547b859d61fbc5c240aff224dda.
* Correction to the way parens are parsed in query expressionsJohn Wiegley2019-09-171-9/+46
|
* Fix warnings for -Wimplicit-fallthroughTim Landscheidt2018-02-191-0/+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-10/+10
|
* Correct parsing of automated xact expressionsJohn Wiegley2012-03-161-1/+1
| | | | Fixes #458
* Increased file copyrights to 2012John Wiegley2012-02-291-1/+1
|
* Removed unneeded break statementsJohn Wiegley2012-02-171-1/+0
|
* More report query fixesJohn Wiegley2011-11-101-17/+19
|
* Corrections to the query language parserJohn Wiegley2011-11-101-5/+14
| | | | Fixes #552
* Cleanup whitespaceJohn Wiegley2011-08-181-2/+2
|
* Removed unused variablesJohn Wiegley2011-08-181-1/+0
|
* Fixed an infinite loop in the report query parserJohn Wiegley2011-06-301-1/+3
|
* "only" now a report query modifier for --onlyJohn Wiegley2010-06-241-20/+22
| | | | This fits with "show" and "bold", etc.
* Added report query modifiers: for, since, untilJohn Wiegley2010-06-221-3/+70
| | | | | | | | | Now instead of ledger reg expense -p "this month", you can say: ledger reg expense for this month And as a shorthand for "for until this month", you can just say "until this month" or "since this month".
* Added new "bold" modifier to query expressionsJohn Wiegley2010-06-221-60/+76
| | | | | | | | | | | | | | 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'
* Corrected a bug in report query parsingJohn Wiegley2010-06-191-2/+2
|
* Untabified all source filesJohn Wiegley2010-06-111-75/+75
|
* Further improved parsing of query expressionsJohn Wiegley2010-06-011-18/+24
| | | | Fixes #210 / D4C2DD6F-8967-4FFC-BBBC-A941F9C53475
* Improve parsing of 'expr' query termsJohn Wiegley2010-06-011-6/+9
| | | | Fixes #157 / 9DF85DF2-4BF5-4931-A30C-2592A10BB5C0
* Updated copyrights to 2003-2010John Wiegley2010-03-051-1/+1
|
* Added some debugging code related to boost::regexJohn Wiegley2009-11-251-0/+2
|
* Renamed date_interval_t::end to finishJohn Wiegley2009-11-171-2/+2
|
* Corrected parsing of the 'expr' report query termJohn Wiegley2009-11-151-9/+9
|
* Stylistic change: assert(0) -> assert(false)John Wiegley2009-11-131-1/+1
|
* Removed "account" as a report query keywordJohn Wiegley2009-11-111-2/+0
|
* Fixes to the value expression parser and evaluatorJohn Wiegley2009-11-101-5/+4
|
* Redesigned the expr_t, predicate_t, query_t classesJohn Wiegley2009-11-091-0/+456