Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify uniqueness of property names #25

Open
ell1e opened this issue May 13, 2020 · 1 comment
Open

Clarify uniqueness of property names #25

ell1e opened this issue May 13, 2020 · 1 comment
Assignees
Milestone

Comments

@ell1e
Copy link

ell1e commented May 13, 2020

When I read the spec, there is one point I found somewhat unclearly specified: are identifiers in object keys meant to be a short-hand for strings, or something that should remain separate after parsing & re-serializing? (If discounting lost formatting)

I assume they are just meant as a short-hand, since the JSON5Value list seems to indicate what is meant to be returned after parsing:

 A JSON5 value must be an object, array, string, or number, or one of the three literal names true, false, or null.
JSON5Value:
JSON5Null
JSON5Boolean
JSON5String
JSON5Number
JSON5Object
JSON5Array

After all, the single quote strings aren't in there either. Also the spec speaks of collision between "names" and not strings and identifiers separately. However, it would be nice if the 3. Objects section could clarify this and state without a doubt that the two different ways to write a name are just syntactical sugar that is usually in both cases expected to result in a plain string after deserialization.

@ell1e ell1e changed the title Suggestion to clarify: are identifiers in object keys meant to be a short-hand for strings or separata things to be retained? Suggestion to clarify: are identifiers in object keys meant to be a short-hand for strings or separate things to be retained? May 13, 2020
@jordanbtucker jordanbtucker self-assigned this May 13, 2020
@jordanbtucker jordanbtucker added this to the v1.1.0 milestone May 13, 2020
@jordanbtucker
Copy link
Member

Good point. You are correct that abc, 'abc', "abc", and \x61\x62\x63 are all variations of the same "name". This should be clarified in the spec.

@jordanbtucker jordanbtucker changed the title Suggestion to clarify: are identifiers in object keys meant to be a short-hand for strings or separate things to be retained? Clarify uniqueness of property names May 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants