File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -164,15 +164,18 @@ def scan_tokens encoder, options
164
164
end
165
165
166
166
elsif match = scan ( / ' (?:(?>[^'\\ ]*) ')? | " (?:(?>[^"\\ \# ]*) ")? /mx )
167
- encoder . begin_group :string
168
167
if match . size == 1
168
+ encoder . begin_group :string
169
169
encoder . text_token match , :delimiter
170
170
state = self . class ::StringState . new :string , match == '"' , match # important for streaming
171
171
else
172
+ kind = value_expected == true && scan ( /:/ ) ? :key : :string
173
+ encoder . begin_group kind
172
174
encoder . text_token match [ 0 , 1 ] , :delimiter
173
175
encoder . text_token match [ 1 ..-2 ] , :content if match . size > 2
174
176
encoder . text_token match [ -1 , 1 ] , :delimiter
175
- encoder . end_group :string
177
+ encoder . end_group kind
178
+ encoder . text_token ':' , :operator if kind == :key
176
179
value_expected = false
177
180
end
178
181
You can’t perform that action at this time.
0 commit comments