Log In  

Cart #stringhashtable-2 | 2022-03-10 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Feature Overview

This script parse JSON like(incompatible JSON) String data, and convert to hash table.

  • HTBL() uses 174 Token. ( including TONORM() )
  • Using space as delimiter.
  • Parsing recursive.
  • Double quotation marks are not used (they tend to be fewer characters than JSON).
  • Not compatible with JSON.

"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
  • String
  • Bool
  • Nil

may want to Use VDMP() if check the converted table.

This function is included in the KNUTIL library.

UPDATE history

v0.2 (2022 03 10)

No replace() is used.

v0.1 (2020 08 26)

  • Miniaturization of the cord.
  • No replace "\n" in the recursive process.

old ver


Cart #stringhashtable-1 | 2020-08-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

P#71300 2019-12-22 06:44 ( Edited 2022-03-10 15:38)

1

wow.

P#71331 2019-12-23 00:00
:: sparr
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

@sparr
Yes. Please use it!
It is frequently used in games that I develop.

P#72857 2020-02-07 02:19

[Please log in to post a comment]

Follow Lexaloffle:        
Generated 2022-05-04 14:58:25 | 0.021s | Q:21