aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDmitry Gutov2012-08-14 08:38:11 -0400
committerStefan Monnier2012-08-14 08:38:11 -0400
commitf063063a8a8bfc1ba343e7e9eb5d17f866f6fccd (patch)
tree2c68a80c0f9f14d93250ad8f5b4619eae3870f31 /test
parente636fafe20f0238d0aaabc4b822642efe68cad9b (diff)
downloademacs-f063063a8a8bfc1ba343e7e9eb5d17f866f6fccd.tar.gz
emacs-f063063a8a8bfc1ba343e7e9eb5d17f866f6fccd.zip
* 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
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog4
-rw-r--r--test/indent/ruby.rb30
2 files changed, 23 insertions, 11 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index a0163b56e6d..f1bf458f812 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,7 @@
12012-08-14 Dmitry Gutov <dgutov@yandex.ru>
2
3 * indent/ruby.rb: Rearrange examples, add new ones.
4
12012-08-12 Dmitry Gutov <dgutov@yandex.ru> 52012-08-12 Dmitry Gutov <dgutov@yandex.ru>
2 6
3 * automated/ruby-mode-tests.el (ruby-move-to-block-stops-at-opening) 7 * automated/ruby-mode-tests.el (ruby-move-to-block-stops-at-opening)
diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb
index c4a747a1c78..4f2e9e63377 100644
--- a/test/indent/ruby.rb
+++ b/test/indent/ruby.rb
@@ -1,17 +1,25 @@
1# Don't mis-match "sub" at the end of words. 1# Percent literals.
2a = asub / aslb + bsub / bslb;
3
4b = %Q{This is a "string"} 2b = %Q{This is a "string"}
5c = %w(foo 3c = %w!foo
6 bar 4 bar
7 baz) 5 baz!
8d = %!hello! 6d = %(hello (nested) world)
7
8# Don't propertize percent literals inside strings.
9"(%s, %s)" % [123, 456]
10
11# Or inside comments.
12x = # "tot %q/to"; =
13y = 2 / 3
14
15# Regexp after whitelisted method.
16"abc".sub /b/, 'd'
17
18# Don't mis-match "sub" at the end of words.
19a = asub / aslb + bsub / bslb;
9 20
10# A "do" after a slash means that slash is not a division, but it doesn't imply 21# Highlight the regexp after "if".
11# it's a regexp-ender, since it can be a regexp-starter instead! 22x = toto / foo if /do bar/ =~ "dobar"
12x = toto / foo; if /do bar/ then
13 toto = 1
14 end
15 23
16# Some Cucumber code: 24# Some Cucumber code:
17Given /toto/ do 25Given /toto/ do