@@ -316,6 +316,7 @@ function compute_ir_line_annotations(code::IRCode)
316
316
push! (loc_methods, loc_method)
317
317
last_line = line
318
318
(lineno != 0 ) && (last_lineno = lineno)
319
+ nothing
319
320
end
320
321
return (loc_annotations, loc_methods, loc_lineno)
321
322
end
@@ -396,14 +397,14 @@ function DILineInfoPrinter(linetable::Vector, showtypes::Bool=false)
396
397
end
397
398
else
398
399
npops = length (context) - nctx
399
- end
400
- # look at the first non-matching element to see if we are only changing the line number
401
- if ! update_line_only && nctx < nframes
402
- let CtxLine = context[nctx + 1 ],
403
- FrameLine = DI[nframes - nctx]
404
- if CtxLine. file === FrameLine. file &&
405
- method_name (CtxLine) === method_name (FrameLine)
406
- update_line_only = true
400
+ # look at the first non-matching element to see if we are only changing the line number
401
+ if ! update_line_only && nctx < nframes
402
+ let CtxLine = context[ nctx + 1 ],
403
+ FrameLine = DI[nframes - nctx]
404
+ if CtxLine . file === FrameLine . file &&
405
+ method_name ( CtxLine) === method_name ( FrameLine)
406
+ update_line_only = true
407
+ end
407
408
end
408
409
end
409
410
end
@@ -416,35 +417,12 @@ function DILineInfoPrinter(linetable::Vector, showtypes::Bool=false)
416
417
println (io)
417
418
end
418
419
end
419
- # see what change we made to the outermost line number
420
- if update_line_only
421
- frame = DI[nframes - nctx]
422
- nctx += 1
423
- push! (context, frame)
424
- if frame. line != typemax (frame. line) && frame. line != 0
425
- print (io, linestart)
426
- Base. with_output_color (linecolor, io) do io
427
- print (io, indent (" │" ), " @ " , frame. file, " :" , frame. line, " within `" , method_name (frame), " '" )
428
- if collapse
429
- method = method_name (frame)
430
- while nctx < nframes
431
- frame = DI[nframes - nctx]
432
- method_name (frame) === method || break
433
- nctx += 1
434
- push! (context, frame)
435
- print (io, " @ " , frame. file, " :" , frame. line)
436
- end
437
- end
438
- end
439
- println (io)
440
- end
441
- end
442
- # now print the rest of the new frames
420
+ # now print the new frames
443
421
while nctx < nframes
444
422
frame = DI[nframes - nctx]
445
423
nctx += 1
446
424
started = false
447
- if showtypes && ! isa (frame. method, Symbol) && nctx != 1
425
+ if ! update_line_only && showtypes && ! isa (frame. method, Symbol) && nctx != 1
448
426
print (io, linestart)
449
427
Base. with_output_color (linecolor, io) do io
450
428
print (io, indent (" │" ))
@@ -457,8 +435,12 @@ function DILineInfoPrinter(linetable::Vector, showtypes::Bool=false)
457
435
Base. with_output_color (linecolor, io) do io
458
436
print (io, indent (" │" ))
459
437
push! (context, frame)
460
- context_depth[] += 1
461
- nctx != 1 && print (io, started ? " │" : " ┌" )
438
+ if update_line_only
439
+ update_line_only = false
440
+ else
441
+ context_depth[] += 1
442
+ nctx != 1 && print (io, started ? " │" : " ┌" )
443
+ end
462
444
print (io, " @ " , frame. file)
463
445
if frame. line != typemax (frame. line) && frame. line != 0
464
446
print (io, " :" , frame. line)
0 commit comments