We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent080f8a8 commit39cbd37Copy full SHA for 39cbd37
lib/coderay/scanners/ruby.rb
@@ -164,15 +164,18 @@ def scan_tokens encoder, options
164
end
165
166
elsifmatch=scan(/ ' (?:(?>[^'\\]*) ')? | " (?:(?>[^"\\\#]*) ")? /mx)
167
-encoder.begin_group:string
168
ifmatch.size ==1
+encoder.begin_group:string
169
encoder.text_tokenmatch,:delimiter
170
state=self.class::StringState.new:string,match =='"',match# important for streaming
171
else
172
+kind=value_expected ==true &&scan(/:/) ?:key ::string
173
+encoder.begin_groupkind
174
encoder.text_tokenmatch[0,1],:delimiter
175
encoder.text_tokenmatch[1..-2],:contentifmatch.size >2
176
encoder.text_tokenmatch[-1,1],:delimiter
-encoder.end_group:string
177
+encoder.end_groupkind
178
+encoder.text_token':',:operatorifkind ==:key
179
value_expected=false
180
181