File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,21 @@ function pattern_match_apply_call(expr, frame)
78
78
return new_expr
79
79
end
80
80
81
+ # Replace functions with their symbol so that calls print like `f(x)` instead of `(f)(x)`.
82
+ function replace_function_with_symbol (expr)
83
+ if isexpr (expr, :call )
84
+ f = expr. args[1 ]
85
+ if f isa Function
86
+ s = Symbol (f)
87
+ if Base. isidentifier (s)
88
+ expr. args[1 ] = s
89
+ return expr
90
+ end
91
+ end
92
+ end
93
+ return expr
94
+ end
95
+
81
96
function print_next_expr (io:: IO , frame:: Frame )
82
97
expr = pc_expr (frame)
83
98
@assert expr != = nothing
@@ -110,6 +125,7 @@ function print_next_expr(io::IO, frame::Frame)
110
125
end
111
126
expr = pattern_match_kw_call (expr)
112
127
expr = pattern_match_apply_call (expr, frame)
128
+ expr = replace_function_with_symbol (expr)
113
129
limit_expr = repr_limited (expr, MAX_BYTES_REPR[], print)
114
130
print (io, highlight_code (limit_expr; context= io))
115
131
println (io)
You can’t perform that action at this time.
0 commit comments