use json reader state macros everywhere

Tue, 22 Oct 2024 12:17:48 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Tue, 22 Oct 2024 12:17:48 +0200
changeset 942
8a5bbdb7f87f
parent 941
9077724b75a0
child 943
9f1eb30dbc84

use json reader state macros everywhere

src/json.c file | annotate | diff | comparison | revisions
--- a/src/json.c	Tue Oct 22 12:16:16 2024 +0200
+++ b/src/json.c	Tue Oct 22 12:17:48 2024 +0200
@@ -510,9 +510,9 @@
         // expect ':'
         if (token.tokentype != CX_JSON_TOKEN_NAME_SEPARATOR) return -1;
         // next state
-        p->states[p->nstates] = 1;
+        p->states[p->nstates] = JP_STATE_VALUE_BEGIN_OBJ;
         ret = json_read(p);
-    } else if (state == 7) {
+    } else if (state == JP_STATE_OBJ_SEP_OR_CLOSE) {
         // expect ',' or '}'
         if (token.tokentype == CX_JSON_TOKEN_VALUE_SEPARATOR) {
             p->states[p->nstates] = JP_STATE_OBJ_NAME;

mercurial