emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r105411: * lisp/progmodes/js.el (js--


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r105411: * lisp/progmodes/js.el (js--regexp-literal): Accept regexps at the beginning
Date: Fri, 05 Aug 2011 15:53:46 -0400
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 105411
fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9183
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Fri 2011-08-05 15:53:46 -0400
message:
  * lisp/progmodes/js.el (js--regexp-literal): Accept regexps at the beginning
  of statements and in a few more cases.
modified:
  lisp/ChangeLog
  lisp/progmodes/js.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-08-05 16:31:21 +0000
+++ b/lisp/ChangeLog    2011-08-05 19:53:46 +0000
@@ -1,5 +1,8 @@
 2011-08-05  Stefan Monnier  <address@hidden>
 
+       * progmodes/js.el (js--regexp-literal): Accept regexps at the beginning
+       of statements and in a few more cases (bug#9183).
+
        * emacs-lisp/cl-macs.el (cl--make-usage-var, cl--make-usage-args):
        New functions.
        (cl-transform-lambda): Use them (bug#9239).

=== modified file 'lisp/progmodes/js.el'
--- a/lisp/progmodes/js.el      2011-06-30 16:22:33 +0000
+++ b/lisp/progmodes/js.el      2011-08-05 19:53:46 +0000
@@ -1658,15 +1658,19 @@
 ;; below.
 (eval-and-compile
   (defconst js--regexp-literal
-    
"[=(,:]\\(?:\\s-\\|\n\\)*\\(/\\)\\(?:\\\\.\\|[^/*\\]\\)\\(?:\\\\.\\|[^/\\]\\)*\\(/\\)"
+    (concat
+     ;; We want to match regular expressions only at the beginning of
+     ;; expressions.
+     ;; FIXME: Should we also allow /regexp/ after infix operators such as +,
+     ;; /, -, *, >, ...?
+     "\\(?:\\`\\|[=([{,:;]\\)\\(?:\\s-\\|\n\\)*"
+     "\\(/\\)\\(?:\\\\.\\|[^/*\\]\\)\\(?:\\\\.\\|[^/\\]\\)*\\(/\\)")
   "Regexp matching a JavaScript regular expression literal.
 Match groups 1 and 2 are the characters forming the beginning and
 end of the literal."))
 
 (defconst js-syntax-propertize-function
   (syntax-propertize-rules
-   ;; We want to match regular expressions only at the beginning of
-   ;; expressions.
    (js--regexp-literal (1 "\"") (2 "\""))))
 
 ;;; Indentation


reply via email to

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