From bc2e09a3b7a4e414814b56be71ec5c540b8eb4d9 Mon Sep 17 00:00:00 2001
From: Ferenc Szontágh <szf@fsociety.hu>
Date: Sat, 19 Apr 2025 18:37:09 +0000
Subject: [PATCH] Merge branch 'refactor' of https://git.spamming.hu/r/voidscript into refactor

---
 docs/JsonModule.md |  104 +++++++++++++++++++++++++++++++--------------------
 1 files changed, 63 insertions(+), 41 deletions(-)

diff --git a/docs/JsonModule.md b/docs/JsonModule.md
index 8ad9c5f..75bb20e 100644
--- a/docs/JsonModule.md
+++ b/docs/JsonModule.md
@@ -1,41 +1,63 @@
- # JsonModule
-
- Provides JSON serialization and deserialization functions.
-
- ## Functions
-
- ### json_encode
-
- - **Signature:** `json_encode(value) -> string`
- - **Description:** Serializes a VoidScript value to a JSON string.
- - **Parameters:**
-   - `value`: A VoidScript value (int, double, bool, string, object, null).
- - **Returns:** JSON string representation.
- - **Errors:**
-   - Incorrect number of arguments.
-
- ### json_decode
-
- - **Signature:** `json_decode(json) -> object|value`
- - **Description:** Parses a JSON string into a VoidScript value.
- - **Parameters:**
-   - `json` (string): A valid JSON string.
- - **Returns:** VoidScript value (object, number, bool, null).
- - **Errors:**
-   - Incorrect number of arguments.
-   - `json` not a string.
-   - Invalid JSON format.
- - **Note:** Only JSON objects (`{}`), primitives, and null are supported; arrays (`[]`) are not supported.
-
- ## Example
-
- ```vs
- var obj = {};
- obj["name"] = "Alice";
- obj["age"] = 30;
- var jsonStr = json_encode(obj);
- printnl(jsonStr);  // {"name":"Alice","age":30}
-
- var decoded = json_decode(jsonStr);
- printnl(decoded["name"]);  // Alice
- ```
\ No newline at end of file
+# JsonModule
+
+Provides JSON serialization and deserialization functions.
+
+## Functions
+
+### json_encode
+
+* **Signature:** `json_encode(value) -> string`
+
+* **Description:** Serializes a VoidScript value to a JSON string.
+
+* **Parameters:**
+
+  * `value`: A VoidScript value (int, double, bool, string, object, null).
+
+* **Returns:** JSON string representation.
+
+* **Errors:**
+
+  * Incorrect number of arguments.
+
+### json_decode
+
+* **Signature:** `json_decode(json) -> object|value`
+
+* **Description:** Parses a JSON string into a VoidScript value.
+
+* **Parameters:**
+
+  * `json` (string): A valid JSON string.
+
+* **Returns:** VoidScript value (object, number, bool, null).
+
+* **Errors:**
+
+  * Incorrect number of arguments.
+
+  * `json` not a string.
+
+  * Invalid JSON format.
+
+* **Note:** Only JSON objects (`{}`), primitives, and null are supported; arrays (`[]`) are not supported.
+
+## Example
+
+    
+
+`# JSON Encode/Decode Feature Test`\
+`# Define an object with nested data`\
+`object $user = {`\
+`    string name: "Alice",`\
+`    int age: 30,`\
+`    boolean active: true,`\
+`    object prefs: {`\
+`        string theme: "dark",`\
+`        boolean notifications: false`\
+`    }`\
+`};`
+
+`// Encode to JSON string`\
+`string $json = json_encode($user);`\
+`printnl("Encoded JSON: ", $json);`
\ No newline at end of file

--
Gitblit v1.9.3