We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
readable_code
1 parent 0cea545 commit 633b526Copy full SHA for 633b526
src/utils.jl
@@ -102,8 +102,24 @@ function _readable_code(ex)
102
end
103
expr
104
105
+
106
+function rec_remove_macro_linenums!(expr)
107
+ if expr isa Expr
108
+ if expr.head === :macrocall
109
+ expr.args[2] = nothing
110
+ rec_remove_macro_linenums!(expr.args[3])
111
+ else
112
+ for ex in expr.args
113
+ rec_remove_macro_linenums!(ex)
114
+ end
115
116
117
+ expr
118
+end
119
function readable_code(expr)
- JuliaFormatter.format_text(string(Base.remove_linenums!(_readable_code(expr))))
120
+ expr = Base.remove_linenums!(_readable_code(expr))
121
+ rec_remove_macro_linenums!(expr)
122
+ JuliaFormatter.format_text(string(expr), JuliaFormatter.SciMLStyle())
123
124
125
function check_parameters(ps, iv)
0 commit comments