@@ -132,14 +132,14 @@ function paren_type(k::Kind)
132132 end
133133end
134134
135- struct ParenDepthCounter
136- paren:: Base.RefValue{ UInt}
137- bracket:: Base.RefValue{ UInt}
138- curly:: Base.RefValue{ UInt}
135+ mutable struct ParenDepthCounter
136+ paren:: UInt
137+ bracket:: UInt
138+ curly:: UInt
139139end
140140
141141ParenDepthCounter () =
142- ParenDepthCounter (Ref ( zero (UInt)), Ref ( zero (UInt)), Ref ( zero (UInt) ))
142+ ParenDepthCounter (zero (UInt), zero (UInt), zero (UInt))
143143
144144struct GreenLineage
145145 node:: GreenNode
@@ -305,12 +305,12 @@ function _hl_annotations!(highlights::Vector{Tuple{UnitRange{Int}, Pair{Symbol,
305305 end
306306 elseif JuliaSyntax. is_error (nkind); :julia_error
307307 elseif ((depthchange, ptype) = paren_type (nkind)) |> last != :none
308- depthref = getfield (pdepths, ptype)[]
308+ depthref = getfield (pdepths, ptype)
309309 pdepth = if depthchange > 0
310- getfield (pdepths, ptype)[] += depthchange
310+ setfield! (pdepths, ptype, depthref + depthchange)
311311 else
312- depth0 = getfield (pdepths, ptype)[]
313- getfield (pdepths, ptype)[] += depthchange
312+ depth0 = getfield (pdepths, ptype)
313+ setfield! (pdepths, ptype, depthref + depthchange)
314314 depth0
315315 end
316316 if pdepth <= 0 && UNMATCHED_DELIMITERS_ENABLED[]
0 commit comments