diff options
| author | Stefan Monnier | 2011-01-24 14:47:46 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2011-01-24 14:47:46 -0500 |
| commit | 21bb5ce0dd56f69d661d3d386c1cd3cef12a1d36 (patch) | |
| tree | cace8e3d588540bad9adbc969f77d662735241a6 /lisp/progmodes/ruby-mode.el | |
| parent | 10617634616deb3a645bb3e9f7bcd91ea900f4aa (diff) | |
| download | emacs-21bb5ce0dd56f69d661d3d386c1cd3cef12a1d36.tar.gz emacs-21bb5ce0dd56f69d661d3d386c1cd3cef12a1d36.zip | |
* lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function):
Handle ?" and friends differently (e.g. don't use backrefs).
Fixes: debbugs:7735
Diffstat (limited to 'lisp/progmodes/ruby-mode.el')
| -rw-r--r-- | lisp/progmodes/ruby-mode.el | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 2f10a7f2a97..733af999cdb 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el | |||
| @@ -1121,14 +1121,13 @@ See `add-log-current-defun-function'." | |||
| 1121 | (syntax-propertize-rules | 1121 | (syntax-propertize-rules |
| 1122 | ;; #{ }, #$hoge, #@foo are not comments | 1122 | ;; #{ }, #$hoge, #@foo are not comments |
| 1123 | ("\\(#\\)[{$@]" (1 ".")) | 1123 | ("\\(#\\)[{$@]" (1 ".")) |
| 1124 | ;; the last $', $", $` in the respective string is not variable | ||
| 1125 | ;; the last ?', ?", ?` in the respective string is not ascii code | ||
| 1126 | ("\\(^\\|[\[ \t\n<+\(,=]\\)\\(['\"`]\\)\\(\\\\.\\|\\2\\|[^'\"`\n\\\\]\\)*?\\\\?[?$]\\(\\2\\)" | ||
| 1127 | (2 "\"") | ||
| 1128 | (4 "\"")) | ||
| 1129 | ;; $' $" $` .... are variables | 1124 | ;; $' $" $` .... are variables |
| 1130 | ;; ?' ?" ?` are ascii codes | 1125 | ;; ?' ?" ?` are ascii codes |
| 1131 | ("\\(^\\|[^\\\\]\\)\\(\\\\\\\\\\)*[?$]\\([#\"'`]\\)" (3 ".")) | 1126 | ("\\([?$]\\)[#\"'`]" |
| 1127 | (1 (unless (save-excursion | ||
| 1128 | ;; Not within a string. | ||
| 1129 | (nth 3 (syntax-ppss (match-beginning 0)))) | ||
| 1130 | (string-to-syntax "\\")))) | ||
| 1132 | ;; regexps | 1131 | ;; regexps |
| 1133 | ("\\(^\\|[=(,~?:;<>]\\|\\(^\\|\\s \\)\\(if\\|elsif\\|unless\\|while\\|until\\|when\\|and\\|or\\|&&\\|||\\)\\|g?sub!?\\|scan\\|split!?\\)\\s *\\(/\\)[^/\n\\\\]*\\(\\\\.[^/\n\\\\]*\\)*\\(/\\)" | 1132 | ("\\(^\\|[=(,~?:;<>]\\|\\(^\\|\\s \\)\\(if\\|elsif\\|unless\\|while\\|until\\|when\\|and\\|or\\|&&\\|||\\)\\|g?sub!?\\|scan\\|split!?\\)\\s *\\(/\\)[^/\n\\\\]*\\(\\\\.[^/\n\\\\]*\\)*\\(/\\)" |
| 1134 | (4 "\"/") | 1133 | (4 "\"/") |