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

Bad syntax highlighting using < inside regex #43

Open
anquegi opened this issue Oct 1, 2020 · 2 comments
Open

Bad syntax highlighting using < inside regex #43

anquegi opened this issue Oct 1, 2020 · 2 comments
Labels
Font-lock Issues involving syntax highlighting and coloring

Comments

@anquegi
Copy link
Contributor

anquegi commented Oct 1, 2020

While testing regexes using emacs I found the following:

my $m = rx /\d ** 2 <?{ 1 <= $/ <= 12 }>/;

then all the text is colored like inside a string, I need to finish the line with #>> in order to finish the two opened <
I added the captures to better view of the problem:

Captura de pantalla 2020-10-01 a las 22 56 11

Captura de pantalla 2020-10-01 a las 22 56 00

@matiaslina matiaslina added the Font-lock Issues involving syntax highlighting and coloring label Apr 3, 2021
@chromis
Copy link

chromis commented Nov 6, 2021

Hello,

I encountered a very similar problem: in my case, this happens in strings that start with the <-character:

syntax_highlighting

workaround: you can add "# '>'"-comment snippets in your Raku code.

This is in emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.5) of 2021-01-31, modified by Debian (the debian package version is 1:26.1+1-3.2+deb10u2). raku-mode is manually cloned: I'm on commit 4ee9045.

@Mercerenies
Copy link

Just encountered this as well, glad to know I'm not the only one.

Screenshot from 2022-02-14 20-47-04

The < in the when block and the > in atom => $x are creating the string context, somehow

GNU Emacs 26.3 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.24.13) of 2019-12-10

Raku Mode 20210927.1227 from MELPA (commit 977b14a)

Complete file that causes this issue

Mercerenies added a commit to Mercerenies/raku-mode that referenced this issue Feb 15, 2022
Angle brackets are no longer treated as string delimiters, which makes
the $<foobar> syntax slightly uglier but allows us to use less than
signs in code without the rest of the file blowing up.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Font-lock Issues involving syntax highlighting and coloring
Projects
None yet
Development

No branches or pull requests

4 participants