Skip to content

Conversation

@donbarbos
Copy link
Contributor

@donbarbos donbarbos commented Jan 25, 2026

Actually, pyright uses node-jsonc-parser (see deps), jsonc spec. It seems writing a real context-free grammar parser is unnecessary here and more suitible way is using regex. This regex is suitable for almost all cases, except for those where a parser is really needed, such as nested /* ... /* ... */ ... */ comments.

Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. For posterity, we should add a few comments to the regexps.

donbarbos and others added 2 commits January 26, 2026 16:54
add comments to regex

Co-authored-by: Sebastian Rittau <sebastian.rittau@zfutura.de>
@srittau srittau merged commit f0878de into python:main Jan 26, 2026
66 checks passed
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