summaryrefslogtreecommitdiff
path: root/src/token.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-18 05:45:48 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-18 05:45:48 -0500
commite4b3f0bb3a74b799f0f67d8b2f1efeedad5e2021 (patch)
tree605879730937c258e41090302bff105c6d0a96a1 /src/token.cc
parent7fe369eb492f737f570d0ccf4aaf5db68f900279 (diff)
downloadfork-ledger-e4b3f0bb3a74b799f0f67d8b2f1efeedad5e2021.tar.gz
fork-ledger-e4b3f0bb3a74b799f0f67d8b2f1efeedad5e2021.tar.bz2
fork-ledger-e4b3f0bb3a74b799f0f67d8b2f1efeedad5e2021.zip
The new period parser is passing all tests
Diffstat (limited to 'src/token.cc')
-rw-r--r--src/token.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/token.cc b/src/token.cc
index 3df072a7..81c54a82 100644
--- a/src/token.cc
+++ b/src/token.cc
@@ -206,11 +206,12 @@ void expr_t::token_t::next(std::istream& in, const parse_flags_t& pflags)
length++;
date_interval_t timespan(buf);
- if (! timespan)
+ optional<date_t> begin = timespan.begin();
+ if (! begin)
throw_(parse_error,
_("Date specifier does not refer to a starting date"));
kind = VALUE;
- value = *timespan.start;
+ value = *begin;
break;
}