GNU bug report logs -
#25529
25.1.90; js-mode: Regexp literal with unbalanced brackets breaks font-lock
Previous Next
Reported by: Mikhail Gusarov <mikhail <at> hola.org>
Date: Wed, 25 Jan 2017 11:15:02 UTC
Severity: minor
Found in version 25.1.90
Done: Tom Tromey <tom <at> tromey.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hey Tom,
On 05.02.2017 20:43, Tom Tromey wrote:
> Tom> Another way is to use a regexp, see appended.
> Tom> I'll try to write a test for this soon.
>
> Now with a test.
This is very good, thank you. Here's just one example I've come so far
that works with the old code, but not with yours:
let x = /[/]/;
And that's probably just because the new js-syntax-propertize-regexp
doesn't move point forward after matching (the current one leaves it
after the closing slash), because the regexp in js-syntax-propertize is
too primitive.
We could try to combine the regexps together, though. Then we'd move the
syntax-ppss status check inside the rule for the opening delimiter, and
use a simple one for the closer.
> + "Regular expression matching the body of a JavaScript regexp literal.")
Maybe remove "the body of". The regexp matches the delimiters as well.
Thanks!
This bug report was last modified 8 years and 180 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.