Commit af67e79a authored by Dmitry Gutov's avatar Dmitry Gutov
Browse files

Fix Bug#15874

* lisp/progmodes/ruby-mode.el (ruby-mode-syntax-table): Don't modify
syntax for `?'.
(ruby-expr-beg): Expect that `!' will have syntax class "symbol"
where appropriate already.
(ruby-syntax-propertize-function): Propertize `?' and `!' at the
end of method names.
parent bf093209
2013-12-06 Dmitry Gutov <dgutov@yandex.ru>
* progmodes/ruby-mode.el (ruby-mode-syntax-table): Don't modify
syntax for `?'.
(ruby-expr-beg): Expect that `!' will have syntax class "symbol"
where appropriate already.
(ruby-syntax-propertize-function): Propertize `?' and `!' at the
end of method names (Bug#15874).
2013-12-06 Juri Linkov <juri@jurta.org>
* isearch.el (isearch--saved-overriding-local-map):
......
......@@ -186,7 +186,6 @@ This should only be called after matching against `ruby-here-doc-beg-re'."
(modify-syntax-entry ?\n ">" table)
(modify-syntax-entry ?\\ "\\" table)
(modify-syntax-entry ?$ "." table)
(modify-syntax-entry ?? "_" table)
(modify-syntax-entry ?_ "_" table)
(modify-syntax-entry ?: "_" table)
(modify-syntax-entry ?< "." table)
......@@ -783,7 +782,7 @@ Can be one of `heredoc', `modifier', `expr-qstr', `expr-re'."
ruby-block-mid-keywords)
'words))
(goto-char (match-end 0))
(not (looking-at "\\s_\\|!")))
(not (looking-at "\\s_")))
((eq option 'expr-qstr)
(looking-at "[a-zA-Z][a-zA-z0-9_]* +%[^ \t]"))
((eq option 'expr-re)
......@@ -1648,6 +1647,14 @@ It will be properly highlighted even when the call omits parens.")
;; Not within a string.
(nth 3 (syntax-ppss (match-beginning 0))))
(string-to-syntax "\\"))))
;; Part of symbol when at the end of a method name.
("[!?]"
(0 (unless (save-excursion
(or (nth 8 (syntax-ppss (match-beginning 0)))
(let (parse-sexp-lookup-properties)
(or (zerop (skip-syntax-backward "w_"))
(memq (preceding-char) '(?@ ?$))))))
(string-to-syntax "_"))))
;; Regular expressions. Start with matching unescaped slash.
("\\(?:\\=\\|[^\\]\\)\\(?:\\\\\\\\\\)*\\(/\\)"
(1 (let ((state (save-excursion (syntax-ppss (match-beginning 1)))))
......
......@@ -91,8 +91,7 @@ VALUES-PLIST is a list with alternating index and value elements."
(ert-deftest ruby-no-heredoc-inside-quotes ()
(ruby-assert-state "\"<<\", \"\",\nfoo" 3 nil))
;; Change result if you fix http://debbugs.gnu.org/15874
(ert-deftest ruby-exit!-font-lock () :expected-result :failed
(ert-deftest ruby-exit!-font-lock ()
(ruby-assert-face "exit!" 5 font-lock-builtin-face))
(ert-deftest ruby-deep-indent ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment