This library is used to turn parse JSON strings into Dosato objects and vice versa.
To compile the library, run the following command:
make
This will create a json.dll
or json.so
file that can be imported into Dosato programs.
Theres a few examples in the examples
directory that show how to use the library.
This function takes a JSON string and returns a Dosato object.
make object obj = json_parse("{\"key\": \"value\"}")
do sayln(obj->key) // value
This function takes a Dosato object and returns a JSON string.
make object obj = {
key: "value"
}
do sayln(json_stringify(obj, false)) // {"key":"value"}
do sayln(json_stringify(obj, true))
/*
{
"key": "value"
}
*/