@@ -129,8 +129,21 @@ macro api(cmd::Symbol)
129
129
error (" @api unrecognized command: $cmd " )
130
130
end
131
131
132
- _api_display (mod, nam) =
133
- isdefined (mod, nam) && (api = m_eval (mod, nam)) != = nothing && (show (api) ; println ())
132
+ function _api_display (mod, nam)
133
+ if isdefined (mod, nam) && (api = m_eval (mod, nam)) != = nothing
134
+ show (api);
135
+ else
136
+ println (" Exported from $mod :" )
137
+ syms = names (mod)
138
+ if ! isempty (syms)
139
+ print (fld, " :" )
140
+ for s in syms
141
+ print (" " , s)
142
+ end
143
+ end
144
+ end
145
+ println ()
146
+ end
134
147
135
148
_api_list (mod:: Module ) = (_api_display (mod, :__api__ ) ; _api_display (mod, :__tmp_api__ ))
136
149
@@ -362,7 +375,7 @@ function _api(curmod::Module, cmd::Symbol, exprs)
362
375
: _api_extend (curmod, modules, cpy))
363
376
end
364
377
365
- @static V6_COMPAT || ( _dot_name ( nam) = Expr (:., nam))
378
+ makecmd (cmd, nam, sym) = @static V6_COMPAT ? Expr (cmd, nam, sym) : Expr (cmd, Expr ( :., nam, sym ))
366
379
367
380
_do_list (curmod, cpy, cmd, mod, nam, grp, api:: API ) =
368
381
_do_list (curmod, cpy, cmd, mod, nam, grp, getfield (api, grp))
@@ -371,7 +384,7 @@ function _do_list(curmod, cpy, cmd, mod, nam, grp, lst)
371
384
debug[] && println (" _do_list($curmod , $cpy , $cmd , $mod , $nam , $grp , $lst )" )
372
385
for sym in lst
373
386
if isdefined (mod, sym)
374
- m_eval (curmod, Expr (cmd, nam, sym))
387
+ m_eval (curmod, makecmd (cmd, nam, sym))
375
388
cpy && m_eval (curmod, :( push! (__tmp_api__.$ grp, $ (QuoteNode (sym)) )))
376
389
else
377
390
println (_stderr (), " Warning: Exported symbol $sym is not defined in $nam " )
0 commit comments