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

Write a well-defined grammar #61

Closed
jordanbtucker opened this issue Jul 29, 2014 · 17 comments
Closed

Write a well-defined grammar #61

jordanbtucker opened this issue Jul 29, 2014 · 17 comments

Comments

@jordanbtucker
Copy link
Member

I think JSON5 would benefit from a well-defined grammar like ECMAScript and JSON have. I wrote a prototype. The README is at the bottom.

@jordanbtucker
Copy link
Member Author

I decided to put my prototype on the Wiki. If you have any issues with that, please let me know. Thanks.

@aseemk
Copy link
Member

aseemk commented Jul 29, 2014

This is great @jordanbtucker, thank you!

No issues at all with it in the wiki. I do wonder if it could go in the repo itself though, since part of the purpose of this repo is to be the "spec". I don't feel strongly either way. WDYT?

@jordanbtucker
Copy link
Member Author

I think that might be a good idea, especially since I don't see a way to lock down Wiki pages. I'd like to expand the "spec" into a full document at some point.

@rlidwka
Copy link
Contributor

rlidwka commented Aug 1, 2014

Already done 7 months ago. :)

https://github.com/rlidwka/jju/blob/master/docs/Grammar.md

@jordanbtucker
Copy link
Member Author

@rlidwka Nice document. Almost the same as the one on the wiki, as far as I can see, with a few differences: line terminators (#70), signed hexadecimals (#36), numeric literals as property names (#55), Unicode escapes in property names (#1), and it's one grammar instead of a lexical and a syntactical.

@rlidwka
Copy link
Contributor

rlidwka commented Aug 1, 2014

Yeah, you see two different approaches here. This repository (and its grammar in wiki) is based on JSON parser. But in my implementation I actually got ES5 grammar and worked down from there, reducing features.

So all the differences you see are probably differences between JSON and JavaScript that haven't been resolved yet. And a potential source of the confusion for users trying to use JS grammar with JSON5.

@jordanbtucker
Copy link
Member Author

Funny, that's the same thing I did when I started writing a JSON5 parser for another language. I used the ES5 grammar. That's when I started finding a lot of missing features. :)

@rlidwka
Copy link
Contributor

rlidwka commented Aug 1, 2014

Offtopic: which language? Can we make a list of existing parsers somewhere? Do all tests pass?

@jordanbtucker
Copy link
Member Author

C# / .NET. It's a WIP at this point. I stopped to focus on JSON5 itself before continuing with other implementations.

There's a page on the Wiki called In The Wild. I think that's a good starting point to keep that list.

@aseemk
Copy link
Member

aseemk commented Aug 3, 2014

Just want to say that you guys are awesome. Thanks for all the great work!

@jordanbtucker
Copy link
Member Author

We now have an official spec in draft status. The PDF version can be found on the releases page.

Ideally, discussions regarding the future of JSON5 will be discussed in the json5-spec repo, while discussions regarding the JavaScript reference implementation will still be discussed in this repo.

I'd like to separate the goal of JSON5 from the different implementations.

Let me know what you think.

@aseemk
Copy link
Member

aseemk commented Mar 31, 2016

Nice @jordanbtucker.

Question: should we (finally) just create a json5 organization and move these repos there?

@jordanbtucker
Copy link
Member Author

@aseemk That sounds good. I've got a partial C# implementation and another one for Go, but I haven't uploaded them yet.

@aseemk
Copy link
Member

aseemk commented Apr 18, 2016

Thanks @jordanbtucker on creating the org! Happy to move this repo there. Should we keep the name simply json5, or change to json5-js?

@jordanbtucker
Copy link
Member Author

I'm thinking json5 for now.

@aseemk
Copy link
Member

aseemk commented Apr 18, 2016

Woohoo! Done. =)

https://github.com/json5/json5

@jordanbtucker
Copy link
Member Author

@aseemk Awesome. Thanks.

BTW, did you see this controversial issue about removing support for Infinity and NaN on the json5-spec repo?

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

3 participants