comparison lisp/progmodes/sh-script.el @ 92878:0d903db06886

(sh-font-lock-quoted-subshell): Fix handling of \ and '.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 13 Mar 2008 14:34:20 +0000
parents c70e45a7acfd
children e42355d302bb
comparison
equal deleted inserted replaced
92877:fe5dcbfb5634 92878:0d903db06886
999 (let ((char (char-after (point))) 999 (let ((char (char-after (point)))
1000 ;; `state' can be: double-quote, backquote, code. 1000 ;; `state' can be: double-quote, backquote, code.
1001 (state (if (eq (char-before) ?`) 'backquote 'code)) 1001 (state (if (eq (char-before) ?`) 'backquote 'code))
1002 ;; Stacked states in the context. 1002 ;; Stacked states in the context.
1003 (states '(double-quote))) 1003 (states '(double-quote)))
1004 (while (and state (progn (skip-chars-forward "^'\\\"`$()" limit) 1004 (while (and state (progn (skip-chars-forward "^'\\\\\"`$()" limit)
1005 (< (point) limit))) 1005 (< (point) limit)))
1006 ;; unescape " inside a $( ... ) construct. 1006 ;; unescape " inside a $( ... ) construct.
1007 (case (char-after) 1007 (case (char-after)
1008 (?\' (skip-chars-forward "^'" limit)) 1008 (?\' (forward-char 1) (skip-chars-forward "^'" limit))
1009 (?\\ (forward-char 1)) 1009 (?\\ (forward-char 1))
1010 (?\" (case state 1010 (?\" (case state
1011 (double-quote (setq state (pop states))) 1011 (double-quote (setq state (pop states)))
1012 (t (push state states) (setq state 'double-quote))) 1012 (t (push state states) (setq state 'double-quote)))
1013 (if state (put-text-property (point) (1+ (point)) 1013 (if state (put-text-property (point) (1+ (point))