From db9f89100382b019892de66b0353c7f6fbef6f9d Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 14 Sep 2008 19:42:32 -0400 Subject: Added value expression parsing flag EXPR_PARSE_SINGLE, which means to read only a single expression and then quit immediately. Useful for parsing expressions that begin with a left parenthesis and are known to end at the right parenthesis. --- src/format.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/format.cc') diff --git a/src/format.cc b/src/format.cc index 3b3c562a..121cdf63 100644 --- a/src/format.cc +++ b/src/format.cc @@ -212,7 +212,7 @@ format_t::element_t * format_t::parse_elements(const string& fmt) case '[': { std::istringstream str(p); current->type = element_t::EXPR; - current->expr.parse(str, EXPR_PARSE_PARTIAL); + current->expr.parse(str, EXPR_PARSE_SINGLE); istream_pos_type pos = str.tellg(); current->expr.set_text(string(p, p + long(pos))); p += long(pos) - 1; -- cgit v1.2.3