From ca329a7d5c1185cdf15fb85891693eca30295de1 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 13 Apr 2009 22:30:05 +0100 Subject: [docs] Show an example of assignment Since I decided to rant about assignments in JSON definitions, I also need to show what an assignment looks like. --- json-glib/json-parser.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'json-glib/json-parser.c') diff --git a/json-glib/json-parser.c b/json-glib/json-parser.c index bde6527..46a05f5 100644 --- a/json-glib/json-parser.c +++ b/json-glib/json-parser.c @@ -1170,11 +1170,18 @@ json_parser_get_current_pos (JsonParser *parser) * @parser: a #JsonParser * @variable_name: return location for the variable name, or %NULL * - * A JSON data stream might sometimes contain an assignment, even though - * it would technically constitute a violation of the RFC. #JsonParser - * will ignore the left hand identifier and parse the right hand value - * of the assignment. #JsonParser will record, though, the existence of the - * assignment in the data stream and the variable name used. + * A JSON data stream might sometimes contain an assignment, like: + * + * |[ + * var _json_data = { "member_name" : [ ... + * ]| + * + * even though it would technically constitute a violation of the RFC. + * + * #JsonParser will ignore the left hand identifier and parse the right + * hand value of the assignment. #JsonParser will record, though, the + * existence of the assignment in the data stream and the variable name + * used. * * Return value: %TRUE if there was an assignment, %FALSE otherwise. If * @variable_name is not %NULL it will be set to the name of the variable -- cgit v1.2.1