Closed GoogleCodeExporter closed 8 years ago
Same here with the following regexp:
var stringRE = /('[^']*')|("[^"]*")/g;
It's important to say that the file becomes basically impossible to edit after
such a
regex, because the mode always tries to automatically insert '' + '' when you
hit
enter, even if there are lines between the insertion point and the offending
line.
The only way to continue working is to put the offending redex in the last
line.
Original comment by andrei.f...@gmail.com
on 25 Jun 2008 at 4:12
The best workaround I have for now is to add a comment at the end of the line
that
closes the string. This keeps the error from continuing through the rest of
the file.
return str.replace(/'/g, "q"); //'
Original comment by dshilv...@gmail.com
on 29 Jun 2008 at 7:26
The reason that this happens is because of the function parse-partial-sexp
which is
able to return some rather nice things. One of those things is whether or not
the
cursor is current in a string. The problem arises in the fact that this function
bases it's judgment on the syntax table defined by the mode. Currently ' is
defined
as a character which can being a string, and the syntax table knows nothing
about
regular expressions (from what I can tell).
I don't know enough about how the syntax table works to actually fix the
problem.
Original comment by waw...@gmail.com
on 5 Oct 2008 at 1:02
Also true for double-quotes, e.g. /[^"]/ (reported in another bug that I'm
marking as
a duplicate of this one).
Original comment by steve.ye...@gmail.com
on 23 Jul 2009 at 11:07
Issue 99 has been merged into this issue.
Original comment by steve.ye...@gmail.com
on 23 Jul 2009 at 11:09
Original comment by steve.ye...@gmail.com
on 23 Jul 2009 at 11:13
This can be fixed by adding a syntax-table text property to the chars inside
regexps,
and telling parse-partial-sexp to respect text properties. I'll fix it for an
upcoming release (in a week or so.)
Original comment by steve.ye...@gmail.com
on 23 Jul 2009 at 11:26
Fixed in 20090723b.el
Original comment by steve.ye...@gmail.com
on 23 Jul 2009 at 11:38
This is happening again for me; I have the 20090723b.el release.
The culprit code is attached; it's based off some json library for jquery my
team is
using. Hideous regexp, but it's valid, according to jslint.
Original comment by chai...@gmail.com
on 12 Nov 2009 at 1:29
Attachments:
Original issue reported on code.google.com by
dshilv...@gmail.com
on 18 Jun 2008 at 6:13