Skip to content

Conversation

@ota-meshi
Copy link
Owner

This PR changes the parser to allow some static values ​​so that it can handle some syntax in a superset of JSON, such as JSON6.

The following allows the syntax supported by JSON6.

  • Change parser to allow static template literals.
  • Change parser to allow undefined identifier.
  • Change parser to allow empty slots in array literals.
  • Change parser to allow spaces after -/+ sign.
  • Change parser to allow number property key.

The following is not supported in JSON6, but is allowed as a parser because it is clear that it is a static value.

  • Change parser to allow regexp literal.
  • Change parser to allow bigint literal.

And, the parser only parsed files with the .json extension, but removes this restriction to allow other extensions.

ota-meshi and others added 4 commits July 14, 2020 16:38
- Change parser to allow static template literals.
- Change parser to allow undefined identifier.
- Change parser to allow empty slots in array literals.
- Change parser to allow spaces after `-`/`+` sign.
- Change parser to allow number property key.
- Change parser to allow regexp literal.
- Change parser to allow bigint literal.
- Change parser to parse all extensions (not only `.json`).
@ota-meshi ota-meshi merged commit a93f47d into master Jul 14, 2020
@ota-meshi ota-meshi deleted the ast branch July 14, 2020 08:11
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