1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-19 18:13:55 +00:00
emacs/test/indent/ruby.rb
Dmitry Gutov f063063a8a * lisp/progmodes/ruby-mode.el (ruby-syntax-methods-before-regexp): New const.
(ruby-syntax-propertize-function): Use it to recognize regexps.
Don't look at the text after regexp, just use the whitelist.
* test/indent/ruby.rb: Rearrange examples, add new ones.

Fixes: debbugs:6286
2012-08-14 08:38:11 -04:00

28 lines
493 B
Ruby

# Percent literals.
b = %Q{This is a "string"}
c = %w!foo
bar
baz!
d = %(hello (nested) world)
# Don't propertize percent literals inside strings.
"(%s, %s)" % [123, 456]
# Or inside comments.
x = # "tot %q/to"; =
y = 2 / 3
# Regexp after whitelisted method.
"abc".sub /b/, 'd'
# Don't mis-match "sub" at the end of words.
a = asub / aslb + bsub / bslb;
# Highlight the regexp after "if".
x = toto / foo if /do bar/ =~ "dobar"
# Some Cucumber code:
Given /toto/ do
print "hello"
end