0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 16:22:35 +01:00

ircd::json: Modify grammar to fail with error when member name is empty string.

This commit is contained in:
Jason Volk 2017-04-02 20:55:23 -07:00
parent 673c8ca068
commit 217a0e9454

View file

@ -97,7 +97,7 @@ struct input
rule<> quote { lit('"') ,"quote" };
rule<string_view> chars { raw[*(char_ - quote)] ,"characters" };
rule<string_view> string { quote >> chars >> quote ,"string" };
rule<string_view> name { string ,"name" };
rule<string_view> name { quote >> raw[+(char_ - quote)] >> quote ,"name" };
rule<string_view> boolean { lit_true | lit_false ,"boolean" };
rule<string_view> literal { lit_true | lit_false | lit_null ,"literal" };
@ -185,7 +185,7 @@ struct output
rule<string_view> number { double_ ,"number" };
rule<string_view> name { string ,"name" };
rule<string_view> name { quote << +(~char_('"')) << quote ,"name" };
rule<string_view> value { rule<string_view>{} /* subclass implemented */ ,"value" };
rule<const doc::member &> member { name << name_sep << value ,"member" };