fix that the docu does not explain that you must reset a parser that ran into an error

Wed, 10 Dec 2025 22:34:48 +0100

author
Mike Becker <universe@uap-core.de>
date
Wed, 10 Dec 2025 22:34:48 +0100
changeset 1566
2ebbcb38986d
parent 1565
fb314eeca7a4
child 1567
f60f23b362e9

fix that the docu does not explain that you must reset a parser that ran into an error

docs/Writerside/topics/json.h.md file | annotate | diff | comparison | revisions
src/cx/json.h file | annotate | diff | comparison | revisions
--- a/docs/Writerside/topics/json.h.md	Wed Dec 10 22:16:19 2025 +0100
+++ b/docs/Writerside/topics/json.h.md	Wed Dec 10 22:34:48 2025 +0100
@@ -55,7 +55,8 @@
 
 A complete list of all status codes can be seen [below](#list-of-status-codes).
 
-If you want to reuse a `CxJson` structure, you can call `cxJsonReset()`, even if the last operation was a failure.
+If you want to reuse a `CxJson` structure, you can call `cxJsonReset()`.
+In particular, you _must_ reset the parser when the last operation was a failure.
 Otherwise, you need to call `cxJsonDestroy()` when you are done with the parser.
 
 The function `cxJsonFromString()` combines the above procedure. 
--- a/src/cx/json.h	Wed Dec 10 22:16:19 2025 +0100
+++ b/src/cx/json.h	Wed Dec 10 22:34:48 2025 +0100
@@ -495,8 +495,8 @@
 /**
  * Destroys and re-initializes the JSON interface.
  *
- * You might want to use this to reset the parser after
- * encountering a syntax error.
+ * You must use this to reset the parser after encountering a syntax error
+ * if you want to continue using it.
  *
  * @param json the JSON interface
  */

mercurial