File tree Expand file tree Collapse file tree 2 files changed +25
-6
lines changed Expand file tree Collapse file tree 2 files changed +25
-6
lines changed Original file line number Diff line number Diff line change @@ -23,12 +23,8 @@ def self.to_html token_stream
23
23
when :on_ivar then 'ruby-ivar'
24
24
when :on_cvar then 'ruby-identifier'
25
25
when :on_gvar then 'ruby-identifier'
26
- when '=' != t [ :text ] && :on_op then
27
- if RDoc ::RipperStateLex ::EXPR_ARG == t [ :state ] then
28
- 'ruby-identifier'
29
- else
30
- 'ruby-operator'
31
- end
26
+ when '=' != t [ :text ] && :on_op
27
+ then 'ruby-operator'
32
28
when :on_tlambda then 'ruby-operator'
33
29
when :on_ident then 'ruby-identifier'
34
30
when :on_label then 'ruby-value'
Original file line number Diff line number Diff line change @@ -2674,6 +2674,29 @@ def blah()
2674
2674
assert_equal expected , markup_code
2675
2675
end
2676
2676
2677
+ def test_parse_instance_operation_method
2678
+ util_parser <<-RUBY
2679
+ class Foo
2680
+ def self.& end
2681
+ end
2682
+ RUBY
2683
+
2684
+ expected = <<EXPECTED
2685
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">&</span> <span class="ruby-keyword">end</span>
2686
+ <span class="ruby-keyword">end</span>
2687
+ EXPECTED
2688
+ expected = expected . rstrip
2689
+
2690
+ @parser . scan
2691
+
2692
+ foo = @top_level . classes . first
2693
+ assert_equal 'Foo' , foo . full_name
2694
+
2695
+ blah = foo . method_list . first
2696
+ markup_code = blah . markup_code . sub ( /^.*\n / , '' )
2697
+ assert_equal expected , markup_code
2698
+ end
2699
+
2677
2700
def test_parse_statements_postfix_if_after_heredocbeg
2678
2701
@filename = 'file.rb'
2679
2702
util_parser <<RUBY
You can’t perform that action at this time.
0 commit comments