regexp options.
Fixes: debbugs:16914
+2014-03-01 Dmitry Gutov <dgutov@yandex.ru>
+
+ * progmodes/ruby-mode.el (ruby-font-lock-keywords): Highlight
+ regexp options. (Bug#16914)
+
2014-03-01 Martin Rudalics <rudalics@gmx.at>
* window.el (window--max-delta-1): Round down when calculating
;; Character literals.
;; FIXME: Support longer escape sequences.
("\\_<\\?\\\\?\\S " 0 font-lock-string-face)
+ ;; Regexp options.
+ ("\\(?:\\s|\\|/\\)\\([imxo]+\\)"
+ 1 (when (save-excursion
+ (let ((state (syntax-ppss (match-beginning 0))))
+ (and (nth 3 state)
+ (or (eq (char-after) ?/)
+ (progn
+ (goto-char (nth 8 state))
+ (looking-at "%r"))))))
+ font-lock-preprocessor-face))
)
"Additional expressions to highlight in Ruby mode.")
# Highlight the regexp after "if".
x = toto / foo if /do bar/ =~ "dobar"
+# Regexp options are highlighted.
+
+/foo/xi != %r{bar}mo.tee
+
bar(class: XXX) do # ruby-indent-keyword-label
foo
end