diff options
Diffstat (limited to 'src/token.cc')
-rw-r--r-- | src/token.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/token.cc b/src/token.cc index 964c65de..f2b43ffb 100644 --- a/src/token.cc +++ b/src/token.cc @@ -198,7 +198,7 @@ void expr_t::token_t::next(std::istream& in, const uint_least8_t pflags) case '{': { in.get(c); amount_t temp; - temp.parse(in, AMOUNT_PARSE_NO_MIGRATE); + temp.parse(in, amount_t::PARSE_NO_MIGRATE); in.get(c); if (c != '}') expected('}', c); @@ -343,15 +343,17 @@ void expr_t::token_t::next(std::istream& in, const uint_least8_t pflags) // When in relaxed parsing mode, we want to migrate commodity flags // so that any precision specified by the user updates the current // maximum displayed precision. - amount_t::flags_t parse_flags = 0; - if (pflags & EXPR_PARSE_NO_MIGRATE) - parse_flags |= AMOUNT_PARSE_NO_MIGRATE; - if (pflags & EXPR_PARSE_NO_REDUCE) - parse_flags |= AMOUNT_PARSE_NO_REDUCE; + amount_t::parse_flags_t parse_flags; + parser_t::parse_flags_t pflags_copy(pflags); + + if (pflags_copy.has_flags(PARSE_NO_MIGRATE)) + parse_flags.add_flags(amount_t::PARSE_NO_MIGRATE); + if (pflags_copy.has_flags(PARSE_NO_REDUCE)) + parse_flags.add_flags(amount_t::PARSE_NO_REDUCE); try { amount_t temp; - if (! temp.parse(in, parse_flags | AMOUNT_PARSE_SOFT_FAIL)) { + if (! temp.parse(in, parse_flags.plus_flags(amount_t::PARSE_SOFT_FAIL))) { // If the amount had no commodity, it must be an unambiguous // variable reference |