@@ -81,9 +81,6 @@ function Base.show(io::IO, api::AbstractAPI)
81
81
end
82
82
end
83
83
84
- """ Get current module"""
85
- cur_mod () = @static V6_COMPAT ? current_module () : ccall (:jl_get_current_module , Ref{Module}, ())
86
-
87
84
function m_eval (mod, expr)
88
85
try
89
86
Core. eval (mod, expr)
124
121
125
122
"""
126
123
macro api (cmd:: Symbol )
127
- mod = cur_mod ()
124
+ mod = @static V6_COMPAT ? current_module () : __module__
128
125
cmd == :list ? _api_list (mod) :
129
126
cmd == :freeze ? _api_freeze (mod) :
130
127
cmd == :test ? _api_test (mod) :
171
168
172
169
const _cmduse = (:use , :use! , :test , :extend , :extend! , :export , :list )
173
170
const _cmdadd =
174
- (:modules , :public , :develop , :public! , :develop! , :base , :base! )
171
+ (:modules , :public , :develop , :public! , :develop! , :base , :base! , :define! , :defdev! )
175
172
176
173
@static V6_COMPAT ? (const _ff = findfirst) :
177
174
(_ff (lst, val) = (ret = findfirst (isequal (val), lst); ret === nothing ? 0 : ret))
@@ -397,7 +394,8 @@ function _do_list(curmod, cpy, cmd, mod, nam, grp, lst)
397
394
end
398
395
399
396
macro api (cmd:: Symbol , exprs... )
400
- _api (cur_mod (), cmd, exprs)
397
+ mod = @static V6_COMPAT ? current_module () : __module__
398
+ _api (mod, cmd, exprs)
401
399
end
402
400
403
401
end # module ModuleInterfaceTools
0 commit comments