Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implemented a JSON5 lexer, as requested in #1880.
This lexer was mostly derived from the jsonnet lexer, which already implements lexing for features such as unquoted and single quoted object names and string values, comments and trailing commas in objects and arrays. This lexer covers the other JSON5 features such as mulitline strings, hexadecimal numbers, exponentials, leading and trailing decimal points, optional plus/minus signs and Infinity/NaN keywords while removing most of the jsonnet-specific code.
I'm not familiar with pygments or regex, so any feedback would be appreciated.