@@ -132,14 +132,14 @@ function paren_type(k::Kind)
132
132
end
133
133
end
134
134
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
139
139
end
140
140
141
141
ParenDepthCounter () =
142
- ParenDepthCounter (Ref ( zero (UInt)), Ref ( zero (UInt)), Ref ( zero (UInt) ))
142
+ ParenDepthCounter (zero (UInt), zero (UInt), zero (UInt))
143
143
144
144
struct GreenLineage
145
145
node:: GreenNode
@@ -305,12 +305,12 @@ function _hl_annotations!(highlights::Vector{Tuple{UnitRange{Int}, Pair{Symbol,
305
305
end
306
306
elseif JuliaSyntax. is_error (nkind); :julia_error
307
307
elseif ((depthchange, ptype) = paren_type (nkind)) |> last != :none
308
- depthref = getfield (pdepths, ptype)[]
308
+ depthref = getfield (pdepths, ptype)
309
309
pdepth = if depthchange > 0
310
- getfield (pdepths, ptype)[] += depthchange
310
+ setfield! (pdepths, ptype, depthref + depthchange)
311
311
else
312
- depth0 = getfield (pdepths, ptype)[]
313
- getfield (pdepths, ptype)[] += depthchange
312
+ depth0 = getfield (pdepths, ptype)
313
+ setfield! (pdepths, ptype, depthref + depthchange)
314
314
depth0
315
315
end
316
316
if pdepth <= 0 && UNMATCHED_DELIMITERS_ENABLED[]
0 commit comments