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

Misc. SchemeLexer improvements #2060

Merged
merged 5 commits into from
Feb 8, 2022
Merged

Misc. SchemeLexer improvements #2060

merged 5 commits into from
Feb 8, 2022

Conversation

jeanas
Copy link
Contributor

@jeanas jeanas commented Feb 1, 2022

  • Highlight string escapes,
  • Recognize fancy numbers (e.g. fractions and infinities),
  • Autogenerate builtins (using the Guile implementation),
  • Support simple datums commented with #;,
  • Recognize #:keywords.

(For history readability, it would be ideal if the commits were merged without squashing.)

@birkenfeld
Copy link
Member

LGTM in general. Can the small test file be moved to snippets?

Move string parsing to a dedicated state so it can recognize string escapes.
Add support for various kinds of escapes.
Many number literals were not recognized previously, such as
fractions, infinities, hex and complex literals.
This enriches the space of recognized builtins.

Note that this also fixes the space after a builtin being included in
the token.
Previously, #; awaited an S-expression but could not cope with a
simple datum like a number literal. While at it, also support R6RS
brackets for S-expressions.
Highlighting as Keyword.Declaration is consistent with the
RacketLexer.
@jeanas
Copy link
Contributor Author

jeanas commented Feb 2, 2022

Done.

@jeanas
Copy link
Contributor Author

jeanas commented Feb 8, 2022

@birkenfeld Does this PR still need an update on my side? Does it look OK now? Sorry for being insistent :-)

@birkenfeld
Copy link
Member

No, LGTM, sorry for dropping the ball. Thanks for the PR!

@birkenfeld birkenfeld added the changelog-update Items which need to get mentioned in the changelog label Feb 8, 2022
@birkenfeld birkenfeld merged commit 86372c2 into pygments:master Feb 8, 2022
@jeanas
Copy link
Contributor Author

jeanas commented Feb 8, 2022

Thank you!

@jeanas jeanas deleted the scheme branch February 8, 2022 18:42
@Anteru Anteru removed the changelog-update Items which need to get mentioned in the changelog label Feb 20, 2022
@Anteru Anteru added this to the 2.12.0 milestone Feb 20, 2022
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.

3 participants