PlutoLang / Pluto

A superset of Lua 5.4 with a focus on general-purpose programming.
https://pluto-lang.org/docs/Introduction
MIT License
337 stars 20 forks source link

JSON decoder does not decode objects accurately if there is a space between the key and the colon #871

Closed aaronlink127 closed 1 month ago

aaronlink127 commented 1 month ago

This code sample shows the issue proper

local json = require("pluto:json")
print(dumpvar(json.decode('{"hello": "world"}'))) -- { ["hello"] = string(5) "world", }
print(dumpvar(json.decode('{"hello" : "world"}')))-- {}

I would expect the decoder to decode these the same, but it does not.

Sainan commented 1 month ago

Fixed upstream: https://github.com/calamity-inc/Soup/commit/4de5813c3b1f780ee7c4a351401c5db9fd85dd0d