From 8948609b4a4e928b5cdc2b99490b679a07defeb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Vieira=20Porto?= Date: Sun, 28 Feb 2021 17:39:18 -0300 Subject: [PATCH] Update README.BBCode --- README.BBCode | 74 +++++++++++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 38 deletions(-) diff --git a/README.BBCode b/README.BBCode index 21bca98..58f5ddd 100644 --- a/README.BBCode +++ b/README.BBCode @@ -12,46 +12,44 @@ It's not well tested, but I thought to "formally" release it here in case someon [spoiler] If you wish to handle things more manually, you can use a thiner parser that is also faster: -[code=ags] String json_string = "{ \"name\":\"John\", \"age\":30, \"car\":null }"; - JsonParser* parser = new JsonParser; - - int token_count = 8; - JsonToken* t[] = JsonToken.NewArray(token_count); - - int r = parser.Parse(json_string, t, token_count); - - // now that you have the Tokens, you can use them to parse as you wish! - if (r < 0) Display("Failed to parse JSON: %d\n", r); - if (r < 1 || t[0].type != eJSON_Tok_OBJECT) Display("Object expected\n"); - - for(int i=0; i