Skip to content

Commit 4d8b790

Browse files
committed
Cleanup
1 parent 9f05cc3 commit 4d8b790

File tree

3 files changed

+2
-42
lines changed

3 files changed

+2
-42
lines changed

src/APITools.jl

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,9 @@ cur_mod() = ccall(:jl_get_current_module, Ref{Module}, ())
7373
"""
7474
@api <cmd> [<symbols>...]
7575
76-
* @api init # set up module/package for adding names
77-
* @api freeze # use at end of module, to "freeze" API
76+
* @api freeze # use at end of module, to "freeze" API
7877
79-
* @api list <modules>... # list API(s) of given modules
78+
* @api list <modules>... # list API(s) of given modules (or current if none given)
8079
8180
* @api use <modules>... # use for normal use
8281
* @api test <modules>... # using api and dev, for testing purposes
@@ -92,13 +91,6 @@ cur_mod() = ccall(:jl_get_current_module, Ref{Module}, ())
9291
"""
9392
macro api(cmd::Symbol)
9493
mod = @static V6_COMPAT ? current_module() : __module__
95-
#=
96-
@static if V6_COMPAT
97-
println("api($mod, $cmd)")
98-
else
99-
println("api($__source__, $mod, $cmd)")
100-
end
101-
=#
10294
cmd == :list ? _api_list(mod) :
10395
cmd == :init ? _api_init(mod) :
10496
cmd == :freeze ? _api_freeze(mod) :
@@ -203,7 +195,6 @@ function _make_modules(curmod, cmd, exprs)
203195
end
204196

205197
function _api(curmod::Module, cmd::Symbol, exprs)
206-
#println("api($curmod, $cmd, $exprs)")
207198
ind = _ff(_cmdadd, cmd)
208199
ind == 0 || return _add_symbols(curmod, cmd, exprs)
209200

test/APITest.jl

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,10 @@
11
module APITest
22
using APITools
33

4-
_printapi(C) = (print(C) ; isdefined(APITest, :__tmp_api__) ? (show(__tmp_api__) ; println()) : println("Not defined"))
5-
macro printapi() ; _printapi("C: ") ; :( _printapi("R: ") ) ; end
6-
_printsym(C) = println(C, names(APITest, true, true))
7-
macro printsym() ; _printsym("C: ") ; :( _printsym("R: ") ) ; end
8-
9-
#@printsym
10-
11-
#@printapi
12-
13-
#println(macroexpand( :( @api init ) ))
14-
15-
@api init
16-
17-
#@printapi
18-
19-
#println(macroexpand( :( @api base nextind, getindex, setindex! ) ) )
20-
214
@api base nextind, getindex, setindex!
225

23-
#@printapi
24-
25-
#println(macroexpand( :( @api public myfunc ) ) )
26-
276
@api public myfunc
287

29-
#println(macroexpand( :( @api define_public Foo )))
30-
318
@api define_public Foo
329

3310
struct Foo end
@@ -36,12 +13,6 @@ function myfunc end
3613
myfunc(::Integer) = 1
3714
myfunc(::String) = 2
3815

39-
#@printapi()
40-
41-
#println(macroexpand( :( @api freeze ) ))
42-
4316
@api freeze
4417

45-
#@printsym
46-
4718
end # module APITest

test/runtests.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ end
1717
# Pick up APITest from the test directory
1818
push!(LOAD_PATH, @__DIR__)
1919

20-
@api init
21-
2220
@api extend APITest
2321

2422
@api list

0 commit comments

Comments
 (0)