Skip to content

Commit

Permalink
Merge pull request #62 from daschw/return
Browse files Browse the repository at this point in the history
allow `return` in `@recipe`
  • Loading branch information
daschw authored Mar 28, 2020
2 parents 07d3907 + c31455d commit bd51c10
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions RecipesBase/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
*.jl.*.cov
*.jl.mem
Manifest.toml
dev/
4 changes: 3 additions & 1 deletion RecipesBase/src/RecipesBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ function process_recipe_body!(expr::Expr)
set_expr
end

# TODO elseif it's a @series macrocall, add a series block and push to the `series` list
elseif e.head == :return
# To allow `return` in recipes just extract the returned arguments.
expr.args[i] = first(e.args)

elseif e.head != :call
# we want to recursively replace the arrows, but not inside function calls
Expand Down

0 comments on commit bd51c10

Please sign in to comment.