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
Add comment and ellipsis support to json lexer. #244
Add comment and ellipsis support to json lexer. #244
Conversation
This is really cool! However, I'm a little hesitant to add it to the main json lexer. Would it be possible to create a new lexer for this instead? Maybe |
(oops, accidentally closed) |
I'm implementing it as subclass of JSON which seems to be working out well. |
While the json syntax doesn't allow for any comments it's often very useful to be able add inline comments in documentation or tutorials.
In documentation it is often helpful to be able to omit details not currently relevant. In contrast to a comment, this syntax is allowed between a comma and the end of an object. This allows for more uniform usage when omitting details at the end of an object.
63fa327
to
18a2786
Compare
Did you have a chance to look at this? Will this work, or it there still something to fix? |
@jneen ping? |
Sorry for the delay. Looks fantastic, thank you. |
…psis2 Add comment and ellipsis support to json lexer.
This pull request adds ellipsis support in addition to comment support from pull request 243.
Omitting key/value pairs with the comment syntax (i.e. // ... ) is awkward because if used at the end of an object you need to change the preceeding line to remove a trailing comma. This PR adds an syntax that looks better and also removes the special case when used at the end of an object.
Example: