bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#16915: 24.3.50; [ruby-mode] Comments in regexps using the extended s


From: Dmitry Gutov
Subject: bug#16915: 24.3.50; [ruby-mode] Comments in regexps using the extended syntax are not font-locked properly
Date: Sun, 02 Mar 2014 00:19:17 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Bozhidar Batsov <address@hidden> writes:

> In most editors/IDEs code like this
>
> regexp = /
>   start         # some text
>   \s            # white space char
>   (group)       # first group
>   (?:alt1|alt2) # some alternation
>   end
> /x
>
> will have the comments font-locked as comments, because comments are
> allowed in the extended regexp literal syntax (/x). It would be nice
> if this was taken into account in ruby-mode as well.

Not sure how to implement it best.

Ideally, we'd have a new kind of syntax instead of strings (native
regexp support?), which would make font-lock fontify comments inside.

Or maybe a modifier on the string syntax?

Of course, we could just scan the contents of every regexp, look for any
hash character that doesn't look like it starts interpolation, and
forcibly fontify the text from it till the end of line.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]