Skip to content

Commit

Permalink
Merge pull request #80 from JunoLab/sp/stepper
Browse files Browse the repository at this point in the history
Stepper
  • Loading branch information
MikeInnes authored Nov 9, 2017
2 parents 79826fe + d9170ed commit 64cd2c3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
8 changes: 7 additions & 1 deletion src/frontend.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export selector, clearconsole, input, structure, @sh, @profiler
export selector, clearconsole, input, structure, @sh, @profiler, @enter

"""
selector([xs...]) -> x
Expand Down Expand Up @@ -113,6 +113,12 @@ structure(s::String) = s
# TODO: do this recursively
structure(x::Array) = x

"""
@sh expr
Displays the expression `expr` and its result in the console, similar to `@show` but with
proper syntax highlighting.
"""
macro sh(ex)
quote
result = $(esc(ex))
Expand Down
12 changes: 8 additions & 4 deletions src/user.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
export @step, breakpoint
export @enter, breakpoint
"""
@enter ex
macro step(ex)
@capture(ex, f_(args__)) || error("Syntax: @step f(...)")
:(Atom.step($(esc(f)), $(map(esc, args)...)))
Step into the function call in `ex`.
"""
macro enter(ex)
@capture(ex, f_(args__)) || error("Syntax: @enter f(...)")
Atom.enter(ex)
end

breakpoint(args...) = Atom.breakpoint(args...)
Expand Down

0 comments on commit 64cd2c3

Please sign in to comment.