aboutsummaryrefslogtreecommitdiff
path: root/src/json-gram.y
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2018-06-04 11:11:20 +0300
committerSergey Poznyakoff <gray@gnu.org>2018-06-04 11:11:20 +0300
commitc3850a4d3f94436aab6b23020242bc99c71506ee (patch)
tree644cd582c39c833124d1d071a4b7738bac97428d /src/json-gram.y
parent43a1c4ce04cf9301b88c8df31087fe84dcb7e232 (diff)
downloadgrecs-c3850a4d3f94436aab6b23020242bc99c71506ee.tar.gz
grecs-c3850a4d3f94436aab6b23020242bc99c71506ee.tar.bz2
json: improve parser reentrability
* include/grecs/json.h (jsonlex_cleanup): New proto. * src/json-lex.l (jsonlex_setup): Initialize parser state. Initialize json_current_locus_point.file to a non-NULL value. (jsonlex_cleanup): New function. * src/json-gram.y (json_parse_string): Call jsonlex_cleanup before returning. * src/diag.c (default_print_diag): Print the passed errcode argument, instead of errno.
Diffstat (limited to 'src/json-gram.y')
-rw-r--r--src/json-gram.y1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/json-gram.y b/src/json-gram.y
index fe8996b..d5b0248 100644
--- a/src/json-gram.y
+++ b/src/json-gram.y
@@ -280,6 +280,7 @@ json_parse_string(char const *input, size_t len)
/* FIXME: error recovery */
return NULL;
}
+ jsonlex_cleanup();
return json_return_obj;
}

Return to:

Send suggestions and report system problems to the System administrator.