From 5db45d9fa3ef0130eecc4e3d9f6cc24ff687889d Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Mon, 13 Nov 2017 13:15:47 +0100 Subject: [PATCH] use semantic actions to fix #3744 ( >= boost_1_65) --- include/mapnik/json/positions_grammar_x3_def.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/mapnik/json/positions_grammar_x3_def.hpp b/include/mapnik/json/positions_grammar_x3_def.hpp index 1a5e06750..f6ef084f9 100644 --- a/include/mapnik/json/positions_grammar_x3_def.hpp +++ b/include/mapnik/json/positions_grammar_x3_def.hpp @@ -34,6 +34,13 @@ using x3::double_; using x3::no_case; using x3::omit; +namespace { +auto assign_helper = [](auto const& ctx) +{ + _val(ctx) = std::move(_attr(ctx)); +}; +} // anonymous ns + // start rule positions_grammar_type const positions("Positions"); // rules @@ -42,7 +49,7 @@ x3::rule const ring("Ring"); x3::rule const rings("Rings"); x3::rule const rings_array("RingsArray"); -auto const positions_def = rings_array | rings | ring | point ; +auto const positions_def = rings_array[assign_helper] | rings[assign_helper] | ring[assign_helper] | point[assign_helper] ; auto const point_def = lit('[') > double_ > lit(',') > double_ > omit[*(lit(',') > double_)] > lit(']'); auto const ring_def = lit('[') >> -(point % lit(',')) >> lit(']'); auto const rings_def = lit('[') >> (ring % lit(',') > lit(']'));