mainespresso-mode - Support: sr #107235, [patch] fix for regexp literal...


sr #107235: [patch] fix for regexp literal regexp

Submitter:  None
Submitted:  Sun 24 Jan 2010 11:23:29 AM UTC
Category:  None Priority:  5 - Normal
Severity:  4 - Important Status:  None
Privacy:  Public Assigned to:  None
Originator Email:  -email is unavailable- Open/Closed:  Open
Operating System:  None
* Mandatory Fields

Add a New Comment Rich Markup

Wed 31 Mar 2010 07:18:35 AM UTC, comment #3: 

Ah, good catch. I didn't notice that. The actual code which used that /\\/ regexp had '/' but I accidentally changed it to '\' for the test case. With '/' there is no problems.

Wed 31 Mar 2010 05:48:38 AM UTC, comment #2: 

'\' is incorrect syntax. You escape closing quote and the string continues further. "\" is similar. You can setup flymake to catch such cases on-the-fly.

Aliaksey Kandratsenka <alk>
Tue 30 Mar 2010 02:32:04 PM UTC, comment #1: 

I tried that and it works correctly for that case.

Unfortunately neither of them doesn't work with following case:

function() {
  var test = abc(/\\/gi, '\');
  var test2 = abc(/\\/gi, '\');

Sun 24 Jan 2010 11:23:29 AM UTC, original submission:  


Your regexp for re literal:


has the following semantics:

(redsl-to-regexp `(concat (char-set "=(,:")
                          (* (or (whitespace) "\n"))
                          (cap-group /)
                          (or "\\/" (neg-char-set "/*"))
                          (* (or "\\/" (neg-char-set "/")))
                          (cap-group /)))

which is weird and does not work for /\\/g literal.

Mine version:

(redsl-to-regexp `(concat (char-set "=(,:")
                          (* (or (whitespace) "\n"))
                          (cap-group /)
                          (+ (or (neg-char-set "\\/")
                                 (concat "\\" (anychar))))
                          (cap-group /)))

which translates to:


seems more logical and works ok.

I'm attaching the patch.

P.S.: thanks for great javascript mode.



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #19541:  espresso-re-fix.dif added by None (531B - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by alk (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-01-24 None Attached File- Added espresso-re-fix.dif, #19541

    Back to the top

    Powered by Savane 3.13-ee12.
    Corresponding source code