comparison lisp/progmodes/js.el @ 112420:f7f90410cc52

* lisp/progmodes/js.el (js--regexp-literal): Count backslashes.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 21 Jan 2011 15:48:20 -0500
parents 376148b31b5e
children 9f7614f1a892
comparison
equal deleted inserted replaced
112419:a651b7492a78 112420:f7f90410cc52
1652 1652
1653 ;; XXX: Javascript can continue a regexp literal across lines so long 1653 ;; XXX: Javascript can continue a regexp literal across lines so long
1654 ;; as the newline is escaped with \. Account for that in the regexp 1654 ;; as the newline is escaped with \. Account for that in the regexp
1655 ;; below. 1655 ;; below.
1656 (defconst js--regexp-literal 1656 (defconst js--regexp-literal
1657 "[=(,:]\\(?:\\s-\\|\n\\)*\\(/\\)\\(?:\\\\/\\|[^/*]\\)\\(?:\\\\/\\|[^/]\\)*\\(/\\)" 1657 "[=(,:]\\(?:\\s-\\|\n\\)*\\(/\\)\\(?:\\\\.\\|[^/*\\]\\)\\(?:\\\\.\\|[^/\\]\\)*\\(/\\)"
1658 "Regexp matching a JavaScript regular expression literal. 1658 "Regexp matching a JavaScript regular expression literal.
1659 Match groups 1 and 2 are the characters forming the beginning and 1659 Match groups 1 and 2 are the characters forming the beginning and
1660 end of the literal.") 1660 end of the literal.")
1661 1661
1662 ;; we want to match regular expressions only at the beginning of 1662 ;; we want to match regular expressions only at the beginning of