File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,10 @@ module Color
60
60
on_words_beg : [ [ RED , BOLD ] , ALL ] ,
61
61
on_parse_error : [ [ RED , REVERSE ] , ALL ] ,
62
62
compile_error : [ [ RED , REVERSE ] , ALL ] ,
63
+ on_assign_error : [ [ RED , REVERSE ] , ALL ] ,
64
+ on_alias_error : [ [ RED , REVERSE ] , ALL ] ,
65
+ on_class_name_error :[ [ RED , REVERSE ] , ALL ] ,
66
+ on_param_error : [ [ RED , REVERSE ] , ALL ] ,
63
67
}
64
68
rescue NameError
65
69
# Give up highlighting Ripper-incompatible older Ruby
Original file line number Diff line number Diff line change @@ -82,9 +82,23 @@ def test_colorize_code
82
82
tests . merge! ( {
83
83
"[1]]]\u0013 " => "[#{ BLUE } #{ BOLD } 1#{ CLEAR } ]#{ RED } #{ REVERSE } ]#{ CLEAR } #{ RED } #{ REVERSE } ]#{ CLEAR } #{ RED } #{ REVERSE } ^S#{ CLEAR } " ,
84
84
} )
85
+ tests . merge! ( {
86
+ "def req(true) end" => "#{ GREEN } def#{ CLEAR } #{ BLUE } #{ BOLD } req#{ CLEAR } (#{ RED } #{ REVERSE } true#{ CLEAR } ) #{ RED } #{ REVERSE } end#{ CLEAR } " ,
87
+ "nil = 1" => "#{ RED } #{ REVERSE } nil#{ CLEAR } = #{ BLUE } #{ BOLD } 1#{ CLEAR } " ,
88
+ "alias $x $1" => "#{ GREEN } alias#{ CLEAR } #{ GREEN } #{ BOLD } $x#{ CLEAR } #{ RED } #{ REVERSE } $1#{ CLEAR } " ,
89
+ "class bad; end" => "#{ GREEN } class#{ CLEAR } #{ RED } #{ REVERSE } bad#{ CLEAR } ; #{ GREEN } end#{ CLEAR } " ,
90
+ "def req(@a) end" => "#{ GREEN } def#{ CLEAR } #{ BLUE } #{ BOLD } req#{ CLEAR } (#{ RED } #{ REVERSE } @a#{ CLEAR } ) #{ GREEN } end#{ CLEAR } " ,
91
+ } )
85
92
else
86
93
tests . merge! ( {
87
94
"[1]]]\u0013 " => "[1]]]^S" ,
95
+ } )
96
+ tests . merge! ( {
97
+ "def req(true) end" => "def req(true) end" ,
98
+ "nil = 1" => "#{ CYAN } #{ BOLD } nil#{ CLEAR } = #{ BLUE } #{ BOLD } 1#{ CLEAR } " ,
99
+ "alias $x $1" => "#{ GREEN } alias#{ CLEAR } #{ GREEN } #{ BOLD } $x#{ CLEAR } $1" ,
100
+ "class bad; end" => "#{ GREEN } class#{ CLEAR } bad; #{ GREEN } end#{ CLEAR } " ,
101
+ "def req(@a) end" => "#{ GREEN } def#{ CLEAR } #{ BLUE } #{ BOLD } req#{ CLEAR } (@a) #{ GREEN } end#{ CLEAR } " ,
88
102
} )
89
103
end
90
104
You can’t perform that action at this time.
0 commit comments