]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function):
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 24 Jan 2011 19:47:46 +0000 (14:47 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 24 Jan 2011 19:47:46 +0000 (14:47 -0500)
Handle ?" and friends differently (e.g. don't use backrefs).

Fixes: debbugs:7735
lisp/ChangeLog
lisp/progmodes/ruby-mode.el

index e7135e57d88855e171b362b36f67619316a30ad7..0a2b34cb024cc90292fb33cf420698ae7ddee32e 100644 (file)
@@ -1,3 +1,8 @@
+2011-01-24  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * progmodes/ruby-mode.el (ruby-syntax-propertize-function): (bug#7735)
+       Handle ?" and friends differently (e.g. don't use backrefs).
+
 2011-01-24  Jay Belanger  <jay.p.belanger@gmail.com>
 
        * calc/calc.el (calc-default-power-reference-level)
@@ -6,8 +11,8 @@
        (math-logunits): New variable.
        (math-extract-logunits, math-logcombine, calcFunc-luplus)
        (calcFunc-luminus, calc-luplus, calc-luminus, math-logunit-level)
-       (calcFunc-fieldlevel, calcFunc-powerlevel, calc-level): New
-       functions.
+       (calcFunc-fieldlevel, calcFunc-powerlevel, calc-level):
+       New functions.
        (math-find-base-units-rec): Add entry for ln(10).
        * calc/calc-help.el (calc-u-prefix-help): Add logarithmic help.
        (calc-ul-prefix-help): New function.
index 2f10a7f2a97cb1090a89341f79a431dbdb3b3716..733af999cdbb05e892353c822b183f47bc1876db 100644 (file)
@@ -1121,14 +1121,13 @@ See `add-log-current-defun-function'."
          (syntax-propertize-rules
           ;; #{ }, #$hoge, #@foo are not comments
           ("\\(#\\)[{$@]" (1 "."))
-          ;; the last $', $", $` in the respective string is not variable
-          ;; the last ?', ?", ?` in the respective string is not ascii code
-          ("\\(^\\|[\[ \t\n<+\(,=]\\)\\(['\"`]\\)\\(\\\\.\\|\\2\\|[^'\"`\n\\\\]\\)*?\\\\?[?$]\\(\\2\\)"
-           (2 "\"")
-           (4 "\""))
           ;; $' $" $` .... are variables
           ;; ?' ?" ?` are ascii codes
-          ("\\(^\\|[^\\\\]\\)\\(\\\\\\\\\\)*[?$]\\([#\"'`]\\)" (3 "."))
+          ("\\([?$]\\)[#\"'`]"
+           (1 (unless (save-excursion
+                        ;; Not within a string.
+                        (nth 3 (syntax-ppss (match-beginning 0))))
+                (string-to-syntax "\\"))))
           ;; regexps
           ("\\(^\\|[=(,~?:;<>]\\|\\(^\\|\\s \\)\\(if\\|elsif\\|unless\\|while\\|until\\|when\\|and\\|or\\|&&\\|||\\)\\|g?sub!?\\|scan\\|split!?\\)\\s *\\(/\\)[^/\n\\\\]*\\(\\\\.[^/\n\\\\]*\\)*\\(/\\)"
            (4 "\"/")