Skip to content

Conversation

@n00dlr
Copy link
Contributor

@n00dlr n00dlr commented Jun 18, 2024

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.

@Anteru Anteru added the A-lexing area: changes to individual lexers label Oct 6, 2024
@Anteru Anteru added this to the 2.19.0 milestone Oct 6, 2024
@Anteru Anteru merged commit a12a9b1 into pygments:master Oct 6, 2024
@Anteru
Copy link
Collaborator

Anteru commented Oct 6, 2024

Merged, thanks!

@n00dlr n00dlr deleted the json5-lexer branch October 23, 2024 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-lexing area: changes to individual lexers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants