0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

ircd::json: Fix rule construction for clang.

This commit is contained in:
Jason Volk 2020-02-10 15:28:00 -08:00
parent bb3c8dfb53
commit 4007e4f2e2

View file

@ -306,29 +306,25 @@ struct ircd::json::output
// primary recursive rule
rule<string_view> value
{
(&object << object)
| (&array << array)
| (&literal << literal)
| (&number << number)
| string
rule<string_view>{}
,"value"
};
rule<json::object::member> member
{
name << name_sep << value
rule<json::object::member>{}
,"member"
};
rule<json::object> object
{
object_begin << -(member % value_sep) << object_end
rule<json::object>{}
,"object"
};
rule<json::array> array
{
array_begin << -(value % value_sep) << array_end
rule<json::array>{}
,"array"
};
@ -339,6 +335,9 @@ struct ircd::json::output
escaped.add(p.first, p.second);
// synthesized repropagation of recursive rules
member %= name << name_sep << value;
object %= object_begin << -(member % value_sep) << object_end;
array %= array_begin << -(value % value_sep) << array_end;
value %= (&object << object)
| (&array << array)
| (&literal << literal)