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/annotate.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/annotate.cc')
-rw-r--r-- | src/annotate.cc | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/annotate.cc b/src/annotate.cc index 27261f57..e0fb0d08 100644 --- a/src/annotate.cc +++ b/src/annotate.cc @@ -86,33 +86,33 @@ void annotation_t::parse(std::istream& in) return; char buf[256]; - char c = peek_next_nonws(in); + int c = peek_next_nonws(in); if (c == '{') { if (price) throw_(amount_error, _("Commodity specifies more than one price")); - in.get(c); - c = static_cast<char>(in.peek()); + in.get(); + c = in.peek(); if (c == '{') { - in.get(c); + in.get(); add_flags(ANNOTATION_PRICE_NOT_PER_UNIT); } c = peek_next_nonws(in); if (c == '=') { - in.get(c); + in.get(); add_flags(ANNOTATION_PRICE_FIXATED); } READ_INTO(in, buf, 255, c, c != '}'); if (c == '}') { - in.get(c); + in.get(); if (has_flags(ANNOTATION_PRICE_NOT_PER_UNIT)) { - c = static_cast<char>(in.peek()); + c = in.peek(); if (c != '}') throw_(amount_error, _("Commodity lot price lacks double closing brace")); else - in.get(c); + in.get(); } } else { throw_(amount_error, _("Commodity lot price lacks closing brace")); @@ -128,18 +128,18 @@ void annotation_t::parse(std::istream& in) if (date) throw_(amount_error, _("Commodity specifies more than one date")); - in.get(c); + in.get(); READ_INTO(in, buf, 255, c, c != ']'); if (c == ']') - in.get(c); + in.get(); else throw_(amount_error, _("Commodity date lacks closing bracket")); date = parse_date(buf); } else if (c == '(') { - in.get(c); - c = static_cast<char>(in.peek()); + in.get(); + c = in.peek(); if (c == '@') { in.clear(); in.seekg(pos, std::ios::beg); @@ -150,13 +150,13 @@ void annotation_t::parse(std::istream& in) throw_(amount_error, _("Commodity specifies more than one valuation expresion")); - in.get(c); + in.get(); READ_INTO(in, buf, 255, c, c != ')'); if (c == ')') { - in.get(c); - c = static_cast<char>(in.peek()); + in.get(); + c = in.peek(); if (c == ')') - in.get(c); + in.get(); else throw_(amount_error, _("Commodity valuation expression lacks closing parentheses")); @@ -172,7 +172,7 @@ void annotation_t::parse(std::istream& in) READ_INTO(in, buf, 255, c, c != ')'); if (c == ')') - in.get(c); + in.get(); else throw_(amount_error, _("Commodity tag lacks closing parenthesis")); |