9 std::string::const_iterator
end_of_literal(std::string::const_iterator it, std::string::const_iterator end_it) {
11 for(++it; it != end_it; ++it) {
23 std::vector<std::string> &tag_names,
24 std::vector<std::string> &sub_exprs) {
25 std::string::const_iterator it(input_expr.cbegin()), it_end(input_expr.cend()), t_it1, t_it2;
27 while(it != it_end && (isspace(*it) || boost::is_any_of(
",#")(*it)))
37 if(t_it2 == t_it1 || (*t_it2) !=
'\'') {
38 throw std::runtime_error(
"Mismatched quotation marks in expression:\n \"" + input_expr +
"\"\n");
43 while(it != it_end && !(isspace(*it) || (*it) ==
',') && (*it) !=
'(' && (*it) !=
')')
47 throw std::runtime_error(
"Mismatched parentheses in expression:\n \"" + input_expr +
"\"\n");
50 tag_names.push_back(std::string(t_it1, it));
51 sub_exprs.push_back(std::string());
55 if(it == it_end || (*it) !=
'(')
59 while(it != it_end && isspace(*(++it)));
62 throw std::runtime_error(
"Stray comma in expression:\n \"" + input_expr +
"\"\n");
69 while(it != it_end && !((*it) ==
')' && paren_depth == 0)) {
79 throw std::runtime_error(
"Mismatched parentheses in expression:\n \"" + input_expr +
"\"\n");
82 while(isspace(*(--t_it2)));
85 throw std::runtime_error(
"Stray comma in expression:\n \"" + input_expr +
"\"\n");
87 sub_exprs.back() = std::string(t_it1, ++t_it2);
void split_formatter_expression(const std::string &input_expr, std::vector< std::string > &tag_names, std::vector< std::string > &sub_exprs)
std::string::const_iterator end_of_literal(std::string::const_iterator it, std::string::const_iterator end_it)
EigenIndex Index
For long integer indexing: