Run generate.sh [your prefix] on linux/wsl/msys/cygwin. The prefixed files will be in the generated folder.
How to Use:
Call JSON.parse with a string that contains JSON text, it will return either a JsonElement in case of success, or a JsonError in case of failure. Call JsonElement::serialize to generate JSON back from a JsonElement.
JsonError - NOT a Json Element. If JSON.parse return this, it means that the parsing failed, the error is in JsonError.what, it contains line number and some extra information.
JsonElement - One of JsonObject, JsonArray, JsonString, JsonNumber, JsonBool, or JsonNull
JsonObject - Hash Table that holds JsonElement values with String keys
JsonArray - Dynamic Array that holds JsonElement values
JsonString - String Literal
JsonNumber - One of JsonInt or JsonDouble
JsonInt - Integral Literal
JsonDouble - Decimal Literal
JsonBool - A true/false Literal
JsonNull - A null Literal
Last edited by RicardoLuis0 on Mon Nov 15, 2021 8:05 am, edited 7 times in total.
The executable crashes due to a VM abort at this function, citing "array access out of bounds. Negative current index = -125".
Turning the "R" in "Rattler" to lower-case fixes it. It seems to always have something to do with upper-case letters in field keys.
However, changing "Rattler" to something like "BIO" also works fine. If it helps, anything I've sent to get parsed have been in UTF-8 with LF line endings.
Thanks for any help you can give.
it seems that an uint (hashed string) is turning negative when being constrained to the limit of the hash table array (256)? seems possibly to be a bug with the modulus operator.
the expression that's crashing is table[hash(key)%table_size], where hash returns an uint, and table_size is 256.
It seems to be caused by the fact that table_size is a constant, if i replace it with an uint variable, it works properly, so i'll implement that workaround for now.
I've filed a bug report: viewtopic.php?f=2&t=73477