Feature Overview
This is a script that parses String data and converts it into a hash table. (Not compatible with JSON)
- A single string can initialize many values.
- Returns at least an empty table.
- Elements can be added space-separated. (the space character cannot be used as a value.)
{}
specifies a table.key=val;
key{val}
specifies the key and value of the table.- Newline codes are ignored.
- Bool values, Nil, and Hexadecimal strings are automatically normalized.
- The first level can be initialized with global values by using cat() in _env.
CAT(_env,HTBL[[VALUES]]) --init with 5tokens
- Double quotation marks are not used (they tend to be fewer characters than JSON).
- Not compatible with JSON.
- HTBL() uses 150 Token.
"k{v1 v2 ...}"
is table. serve just Immediately before hashkey.
"k=v;"
is key and value.
See code in cart for examples of format usage.
The parser normalizes individual values using TONORM() in the following order of precedence.
- Number(hexadecimal)
- String
- Bool
- Nil
may want to Use DMP() if check the converted table.
This function is included in the KNUTIL library.
UPDATE history
old ver
P#71300 2019-12-22 06:44 ( Edited 2023-10-23 23:14)

1

May I publish some or all of your code, or derivatives, in https://github.com/sparr/pico8lib ?
P#72818 2020-02-06 18:31
[Please log in to post a comment]