expressions - simplify attribute parsing by combining feature attribute and geometry_type attribute processing.
This commit is contained in:
parent
e5a93bce52
commit
7326c0d558
1 changed files with 9 additions and 8 deletions
|
@ -77,7 +77,15 @@ namespace mapnik { namespace grammar {
|
||||||
|
|
||||||
auto do_attribute = [] (auto const& ctx)
|
auto do_attribute = [] (auto const& ctx)
|
||||||
{
|
{
|
||||||
_val(ctx) = std::move(attribute(_attr(ctx)));
|
auto & attr = _attr(ctx);
|
||||||
|
if (attr == "mapnik::geometry_type")
|
||||||
|
{
|
||||||
|
_val(ctx) = std::move(geometry_type_attribute());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_val(ctx) = std::move(attribute(attr));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
auto do_global_attribute = [] (auto const& ctx)
|
auto do_global_attribute = [] (auto const& ctx)
|
||||||
|
@ -85,11 +93,6 @@ namespace mapnik { namespace grammar {
|
||||||
_val(ctx) = std::move(global_attribute(_attr(ctx)));
|
_val(ctx) = std::move(global_attribute(_attr(ctx)));
|
||||||
};
|
};
|
||||||
|
|
||||||
auto do_geometry_type_attribute = [] (auto const& ctx)
|
|
||||||
{
|
|
||||||
_val(ctx) = std::move(geometry_type_attribute());
|
|
||||||
};
|
|
||||||
|
|
||||||
auto do_add = [] (auto const& ctx)
|
auto do_add = [] (auto const& ctx)
|
||||||
{
|
{
|
||||||
_val(ctx) = std::move(mapnik::binary_node<mapnik::tags::plus>(std::move(_val(ctx)), std::move(_attr(ctx))));
|
_val(ctx) = std::move(mapnik::binary_node<mapnik::tags::plus>(std::move(_val(ctx)), std::move(_attr(ctx))));
|
||||||
|
@ -387,8 +390,6 @@ namespace mapnik { namespace grammar {
|
||||||
|
|
|
|
||||||
quoted_string[do_unicode]
|
quoted_string[do_unicode]
|
||||||
|
|
|
|
||||||
lit("[mapnik::geometry_type]")[do_geometry_type_attribute]
|
|
||||||
|
|
|
||||||
feature_attr[do_attribute]
|
feature_attr[do_attribute]
|
||||||
|
|
|
|
||||||
global_attr[do_global_attribute]
|
global_attr[do_global_attribute]
|
||||||
|
|
Loading…
Add table
Reference in a new issue