+ add 'wsp' delimiter support
+ re-arrange grammar a bit
This commit is contained in:
parent
b4e96c35b5
commit
97a9abc8f3
1 changed files with 5 additions and 8 deletions
|
@ -37,19 +37,16 @@ bool parse_dasharray(Iterator first, Iterator last, std::vector<double>& dasharr
|
||||||
using qi::phrase_parse;
|
using qi::phrase_parse;
|
||||||
using qi::_1;
|
using qi::_1;
|
||||||
using qi::lit;
|
using qi::lit;
|
||||||
using ascii::space;
|
using qi::char_;
|
||||||
|
using qi::no_skip;
|
||||||
using phoenix::push_back;
|
using phoenix::push_back;
|
||||||
// SVG
|
// SVG
|
||||||
// dasharray ::= (length | percentage) (comma-wsp dasharray)?
|
// dasharray ::= (length | percentage) (comma-wsp dasharray)?
|
||||||
// no support for 'percentage' as viewport is unknown at load_map
|
// no support for 'percentage' as viewport is unknown at load_map
|
||||||
//
|
//
|
||||||
bool r = phrase_parse(first, last,
|
bool r = phrase_parse(first, last,
|
||||||
(
|
(double_[push_back(phoenix::ref(dasharray), _1)] % no_skip[char_(", ")] | lit("none")),
|
||||||
lit("none") | (double_[push_back(phoenix::ref(dasharray), _1)]
|
qi::ascii::space);
|
||||||
>> *(',' >> double_[push_back(phoenix::ref(dasharray), _1)]))
|
|
||||||
)
|
|
||||||
,
|
|
||||||
space);
|
|
||||||
|
|
||||||
if (first != last)
|
if (first != last)
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue