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

Use ES5 whitespace #60

Merged
merged 8 commits into from
Jul 29, 2014
Merged

Use ES5 whitespace #60

merged 8 commits into from
Jul 29, 2014

Conversation

jordanbtucker
Copy link
Member

Use JSON whitespace: space, tab, carriage return and line feed.
Throw on any characters with a Unicode code point value of 0x1F or less.
See [ES §7.2] and [§15.12.1.1]

Use JSON whitespace: <SP>, <TAB>, <CR>, and <LF>.
Throw on any characters with a Unicode code point value of 0x1F or less.
@aseemk
Copy link
Member

aseemk commented Jul 29, 2014

Thanks @jordanbtucker! Just out of curiosity, what's your reasoning for this? Any harm in accepting more whitespace than JSON? (As long as it's not more than ES5.)

{
// An invalid form feed character (\x0c) has been entered before this comment.
// Be careful not to delete it.
"a": true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: let's standardize on 4-spaces. I know some of the test files use 2, sorry about that. =)

@aseemk
Copy link
Member

aseemk commented Jul 29, 2014

LGTM if you think this is worth merging! Feel free to then. =)

@jordanbtucker
Copy link
Member Author

You know, I was thinking the same thing about ES5 whitespace. I was going back and forth between JSON and ES5 whitespace. I don't remember why I chose JSON. Let me do some research and get back to you.

@jordanbtucker
Copy link
Member Author

Oh, now I remember. It was because ES5 supports whitespace from certain Unicode categories that we can't support yet. So I just went with JSON.

I'm going to fix this to support as much ES5 whitespace as possible without venturing into Unicode territory.

@jordanbtucker jordanbtucker changed the title Use JSON whitespace Use ES5 whitespace Jul 29, 2014
jordanbtucker added a commit that referenced this pull request Jul 29, 2014
@jordanbtucker jordanbtucker merged commit 4449110 into json5:develop Jul 29, 2014
@jordanbtucker jordanbtucker deleted the use-json-whitespace branch July 29, 2014 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants