emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r102965: * lisp/progmodes/ruby-mode.e


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r102965: * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function):
Date: Mon, 24 Jan 2011 14:47:46 -0500
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 102965
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Mon 2011-01-24 14:47:46 -0500
message:
  * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function):
  Handle ?" and friends differently (e.g. don't use backrefs).
modified:
  lisp/ChangeLog
  lisp/progmodes/ruby-mode.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-01-24 19:03:23 +0000
+++ b/lisp/ChangeLog    2011-01-24 19:47:46 +0000
@@ -1,3 +1,8 @@
+2011-01-24  Stefan Monnier  <address@hidden>
+
+       * 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  <address@hidden>
 
        * 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.

=== modified file 'lisp/progmodes/ruby-mode.el'
--- a/lisp/progmodes/ruby-mode.el       2011-01-16 02:21:30 +0000
+++ b/lisp/progmodes/ruby-mode.el       2011-01-24 19:47:46 +0000
@@ -1121,14 +1121,13 @@
          (syntax-propertize-rules
           ;; #{ }, #$hoge, address@hidden are not comments
           ("\\(#\\)address@hidden" (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 "\"/")


reply via email to

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