# Don't propertize percent literals inside strings.
"(%s, %s)" % [123, 456]
-"abc/#{def}ghi"
-"abc\#{def}ghi"
+"abc/#{ddf}ghi"
+"abc\#{ddf}ghi"
# Or inside comments.
x = # "tot %q/to"; =
something
end
+qux :+,
+ bar,
+ :[]=,
+ bar,
+ :a
+
+b = $:
+c = ??
+
# Example from http://www.ruby-doc.org/docs/ProgrammingRuby/html/language.html
d = 4 + 5 + # no '\' needed
6 + 7
self.end
D.new.class
end
+
+ def begin
+ end
end
a = foo(j, k) -
bar
# https://github.com/rails/rails/blob/17f5d8e062909f1fcae25351834d8e89967b645e/activesupport/lib/active_support/time_with_zone.rb#L206
-foo
+foo # comment intended to confuse the tokenizer
.bar
z = {
foo if
bar
+fail "stuff" \
+ unless all_fine?
+
if foo?
bar
end
tee < qux
zux do
- foo == bar and
+ foo == bar &&
tee == qux
+
+ a = 3 and
+ b = 4
end
+foo + bar ==
+ tee + qux
+
+1 .. 2 &&
+ 3
+
+3 < 4 +
+ 5
+
+10 << 4 ^
+ 20
+
+100 + 2 >>
+ 3
+
+2 ** 10 /
+ 2
+
foo ^
bar
foo_bar_tee(1, 2, 3)
- .qux.bar
- .tee
+ .qux&.bar
+ .tee.bar
+ &.tee
foo do
bar
.baz
end
+abc(foo
+ .bar,
+ tee
+ .qux)
+
# http://stackoverflow.com/questions/17786563/emacs-ruby-mode-if-expressions-indentation
tee = if foo
bar
a.records().map(&:b).zip(
foo)
+foo1 =
+ subject.update(
+ 1
+ )
+
+foo2 =
+ subject.
+ update(
+ 2
+ )
+
# FIXME: This is not consistent with the example below it, but this
# offset only happens if the colon is at eol, which wouldn't be often.
# Tokenizing `bar:' as `:bar =>' would be better, but it's hard to
foo(:bar =>
tee)
+regions = foo(
+ OpenStruct.new(id: 0, name: "foo") => [
+ 10
+ ]
+)
+
{'a' => {
'b' => 'c',
'd' => %w(e f)