Skip to content

Commit

Permalink
fix #923: setting ans to a expression in REPLBlocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre committed Jan 23, 2019
1 parent 46abe28 commit 5ad5170
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Expanders.jl
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ function Selectors.runner(::Type{REPLBlocks}, x, page, doc)
input = droplines(str)
(value, success, backtrace, text) = Utilities.withoutput() do
cd(dirname(page.build)) do
Core.eval(mod, :(ans = $(Core.eval(mod, ex))))
Core.eval(mod, Expr(:(=), :ans, ex))
end
end
result = value
Expand Down
5 changes: 5 additions & 0 deletions test/examples/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,11 @@ ex = :(1 + 5)
eval(ex)
```

```@example
a = 1
:(a + 1)
```

# Issue #793
```jldoctest
julia> write("issue793.jl", "\"Hello!\"");
Expand Down

0 comments on commit 5ad5170

Please sign in to comment.