1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-10-19 16:07:38 +00:00

Add textutils.unserialiseJSON (#407)

This is relatively unoptimised right now, but should be efficient enough
for most practical applications.

 - Add textutils.json_null. This will be serialized into a literal
   `null`. When deserializing, and parse_null is true, this will be
   returned instead of a nil.

 - Add textutils.unserializeJSON (and textutils.unserializeJSON). This
   is a standard compliant JSON parser (hopefully).

 - Passing in nbt_style to textutils.unserializeJSON will handle
   stringified NBT (no quotes around object keys, numeric suffices). We
   don't currently support byte/long/int arrays - something to add in
   a future commit.
This commit is contained in:
Jonathan Coates
2020-04-19 15:08:46 +01:00
committed by GitHub
parent eead8b5755
commit b14c7842fc
325 changed files with 666 additions and 13 deletions

View File

@@ -3,10 +3,10 @@ import pathlib, sys
problems = False
# Skip images and files without extensions
exclude = [ ".png", "" ]
exclude = [ "*.png", "**/data/json-parsing/*.json" ]
for path in pathlib.Path(".").glob("src/**/*"):
if path.is_dir() or path.suffix in exclude:
for path in pathlib.Path("src").glob("**/*"):
if path.is_dir() or path.suffix == "" or any(path.match(x) for x in exclude):
continue
with path.open(encoding="utf-8") as file: