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

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

bug#7882: 24.0.50; Bad regexp for javascript regexps


From: Harald Hanche-Olsen
Subject: bug#7882: 24.0.50; Bad regexp for javascript regexps
Date: Fri, 21 Jan 2011 18:50:29 +0100 (CET)

Put the following four line code snippet in a new buffer:

replace(/\\/g,something);
// Now we're in trouble:
// Still in trouble.
// And all's well again.

and activate js-mode and font-lock-mode.

The syntax colouring is now off: The code starting with the first
slash on the first line and ending with the first slash on the second
line is coloured as a regexp; now the syntax highlighter is unaware
that we are in a comment, and reads the single quote as the start of a
string. After the second single quote things return to normal.

The problem seems to lie with the constant js--regexp-literal declared
in js.el, as this regexp does not treat backslashes with sufficient care.

In GNU Emacs 24.0.50.1 (x86_64-apple-darwin10.5.0, NS apple-appkit-1038.35)
 of 2010-12-27 on mack
Windowing system distributor `Apple', version 10.3.1038
configured using `configure  '--with-ns''

- Harald





reply via email to

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