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

Add comment support to json lexer. #243

Closed
wants to merge 2 commits into from

Conversation

textshell
Copy link

Allows to add comments in documentation of json formats. This commit only allows for one line comments, but should be easy to extend to /* ... */ style comments

This allows documentation in a style like this:

{
    "response": {
        "data": [
            // contact objects
        ],
        "limit": 10,
        "page": 1,
        "totalEntries": 15, // Note total entries changed
        "totalPages": 2
    }
}

Split into an basic commit to enable comments in all contexts except in otherwise empty objects and a separate commit to refactor handling of empty objects to be less of a special case and thus also support comments.

Martin Hostettler added 2 commits March 3, 2015 10:03
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.
@textshell
Copy link
Author

Please also see pull request 244 for a pull request that additionally adds ellipsis syntax and is based on this branch.

@jneen
Copy link
Member

jneen commented Mar 3, 2015

superseded by #244

@jneen jneen closed this Mar 3, 2015
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