0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-17 07:20:55 +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 // primary recursive rule
rule<string_view> value rule<string_view> value
{ {
(&object << object) rule<string_view>{}
| (&array << array)
| (&literal << literal)
| (&number << number)
| string
,"value" ,"value"
}; };
rule<json::object::member> member rule<json::object::member> member
{ {
name << name_sep << value rule<json::object::member>{}
,"member" ,"member"
}; };
rule<json::object> object rule<json::object> object
{ {
object_begin << -(member % value_sep) << object_end rule<json::object>{}
,"object" ,"object"
}; };
rule<json::array> array rule<json::array> array
{ {
array_begin << -(value % value_sep) << array_end rule<json::array>{}
,"array" ,"array"
}; };
@ -339,6 +335,9 @@ struct ircd::json::output
escaped.add(p.first, p.second); escaped.add(p.first, p.second);
// synthesized repropagation of recursive rules // 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) value %= (&object << object)
| (&array << array) | (&array << array)
| (&literal << literal) | (&literal << literal)