+ make comma separator optional (preserve space delimitted syntax)

This commit is contained in:
artemp 2013-05-03 16:06:51 +01:00
parent 6490245218
commit f70e39c1e6

View file

@ -319,12 +319,13 @@ void box2d<T>::pad(T padding)
template <typename T> template <typename T>
inline bool box2d<T>::from_string(std::string const& str) inline bool box2d<T>::from_string(std::string const& str)
{ {
using boost::spirit::qi::lit;
using boost::spirit::qi::double_; using boost::spirit::qi::double_;
using boost::spirit::ascii::space; using boost::spirit::ascii::space;
bool r = boost::spirit::qi::phrase_parse(str.begin(), bool r = boost::spirit::qi::phrase_parse(str.begin(),
str.end(), str.end(),
double_ >> ',' >> double_ >> ',' double_ >> -lit(',') >> double_ >> -lit(',')
>> double_ >> ',' >> double_, >> double_ >> -lit(',') >> double_,
space, space,
*this); *this);
return r; return r;