summaryrefslogtreecommitdiff
path: root/json-glib/json-parser.c
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@linux.intel.com>2010-03-18 17:08:44 +0000
committerEmmanuele Bassi <ebassi@linux.intel.com>2010-03-18 17:11:58 +0000
commit3355987049560b4d31af22476a7c2b20c9d6665b (patch)
tree9ec1ebeab5e0cf36276eb5fb517bb1cb16f0abd8 /json-glib/json-parser.c
parentf622ee8d8ba54ddea6fbb7311a905ffab7842e8d (diff)
downloadjson-glib-3355987049560b4d31af22476a7c2b20c9d6665b.tar.gz
parser: Add debug annotations for json_parse_value()
Print out the values we are parsing, for debug purposes.
Diffstat (limited to 'json-glib/json-parser.c')
-rw-r--r--json-glib/json-parser.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/json-glib/json-parser.c b/json-glib/json-parser.c
index 18a3d34..082e9b1 100644
--- a/json-glib/json-parser.c
+++ b/json-glib/json-parser.c
@@ -359,18 +359,26 @@ json_parse_value (JsonParser *parser,
{
case G_TOKEN_INT:
*node = json_node_new (JSON_NODE_VALUE);
+ JSON_NOTE (PARSER, "abs(node): %" G_GINT64_FORMAT " (sign: %s)",
+ scanner->value.v_int64,
+ is_negative ? "negative" : "positive");
json_node_set_int (*node, is_negative ? scanner->value.v_int64 * -1
: scanner->value.v_int64);
break;
case G_TOKEN_FLOAT:
*node = json_node_new (JSON_NODE_VALUE);
+ JSON_NOTE (PARSER, "abs(node): %.6f (sign: %s)",
+ scanner->value.v_float,
+ is_negative ? "negative" : "positive");
json_node_set_double (*node, is_negative ? scanner->value.v_float * -1.0
: scanner->value.v_float);
break;
case G_TOKEN_STRING:
*node = json_node_new (JSON_NODE_VALUE);
+ JSON_NOTE (PARSER, "node: '%s'",
+ scanner->value.v_string);
json_node_set_string (*node, scanner->value.v_string);
break;