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

Update Crystal lexer #1650

merged 7 commits into from Jan 4, 2021

Update Crystal lexer #1650

merged 7 commits into from Jan 4, 2021


Copy link

@oprypin oprypin commented Dec 28, 2020

  • drop all classes from builtins; these aren't normally highlighted - broken here
  • fix percent-strings, drop Ruby-specific arbitrary delimiters - broken here
  • update keywords and builtins - broken here, broken here
  • fix string literals and escape sequences - broken here
  • uppercase identifiers aren't always constants - broken here
  • annotations can be namespaced

(see commit messages themselves for a bit more details)

oprypin added 7 commits Dec 28, 2020

("normally" meaning all other highlighter tools)
It seems that Ruby supports strings such as `%*text*` where `*` can be anything. But Crystal never had anything like that. It does, however, keep `%|text|`, so add a case for that.
Update list of escapes. Support Unicode escape sequences.

Also remove the Ruby-specific `:@foo` symbol syntax, Crystal doesn't have it.
Make `FOO::Bar` be highlighted like `Foo::Bar` would be, rather than like `FOO`
Highlight the entire inside part of `@[Foo::Bar]`, not just the `Foo` part

(these used to be named 'attributes' but the official name is 'annotations' now, so I also change that)
@Anteru Anteru added this to the 2.7.4 milestone Jan 4, 2021
@Anteru Anteru merged commit f8b097c into pygments:master Jan 4, 2021
13 checks passed
Copy link

@Anteru Anteru commented Jan 4, 2021

Merged, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants