diff options
author | John Wiegley <johnw@newartisans.com> | 2022-01-27 21:28:52 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-27 21:28:52 -0800 |
commit | bcbcf169d5fddd48a77e30ef60ba07c0a2e1e1ab (patch) | |
tree | 47a132b29a9ea3b362789c48d122ec5f68f2563b /src/query.cc | |
parent | e001548e7f68f304dd6a98f0919fe15ee3e24496 (diff) | |
parent | 436895905d19f8ef0d3258cd515052a0e540b8b4 (diff) | |
download | fork-ledger-bcbcf169d5fddd48a77e30ef60ba07c0a2e1e1ab.tar.gz fork-ledger-bcbcf169d5fddd48a77e30ef60ba07c0a2e1e1ab.tar.bz2 fork-ledger-bcbcf169d5fddd48a77e30ef60ba07c0a2e1e1ab.zip |
Merge branch 'master' into add-flake
Diffstat (limited to 'src/query.cc')
-rw-r--r-- | src/query.cc | 32 |
1 files changed, 2 insertions, 30 deletions
diff --git a/src/query.cc b/src/query.cc index 883bea40..0eb7dd85 100644 --- a/src/query.cc +++ b/src/query.cc @@ -220,37 +220,9 @@ test_ident: return token_t(token_t::UNKNOWN); } -void query_t::lexer_t::token_t::unexpected() +void query_t::lexer_t::token_t::expected(char wanted) { - kind_t prev_kind = kind; - - kind = UNKNOWN; - - switch (prev_kind) { - case END_REACHED: - throw_(parse_error, _("Unexpected end of expression")); - case TERM: - throw_(parse_error, _f("Unexpected string '%1%'") % *value); - default: - throw_(parse_error, _f("Unexpected token '%1%'") % symbol()); - } -} - -void query_t::lexer_t::token_t::expected(char wanted, char c) -{ - kind = UNKNOWN; - - if (c == '\0' || c == -1) { - if (wanted == '\0' || wanted == -1) - throw_(parse_error, _("Unexpected end")); - else - throw_(parse_error, _f("Missing '%1%'") % wanted); - } else { - if (wanted == '\0' || wanted == -1) - throw_(parse_error, _f("Invalid char '%1%'") % c); - else - throw_(parse_error, _f("Invalid char '%1%' (wanted '%2%')") % c % wanted); - } + throw_(parse_error, _f("Missing '%1%'") % wanted); } expr_t::ptr_op_t |