hjson / hjson-js

Hjson for JavaScript
https://hjson.github.io/
MIT License
416 stars 49 forks source link

Not all fields it supports #62

Open AldieNightStar opened 3 months ago

AldieNightStar commented 3 months ago

When i add 3+ fields using just space, it shows me Error: End of input while parsing an object (missing '}') at line 1,38 >>> name: "Haxi" age: 3 ....

{ name: "Haxi" age: 32" } - this is working { name: "Haxi" age: 32 role: "Admin" } - this is not

I am developer of Novel Engine, and it's currently in progress, so i thinking to take this as a library to parse HJson for it. It's free for everyone but still in development. So i considering it as a novel script language that can be easily parsed

trobro commented 2 months ago

When placing several fields on the same line they need to be separated by commas. This should work:

{ name: "Haxi", age: 32, role: "Admin" }

AldieNightStar commented 2 months ago

It would be great to make it tweakable to parse with commas or ignore. It still good

trobro commented 2 months ago

Thanks! If you put fields on separate lines commas are not needed, but I will let this issue remain open in case anyone wants to create a PR for it.