Skip to content

Commit

Permalink
fix #886: skip reserved words special casing in code-block parsing. (#…
Browse files Browse the repository at this point in the history
…927)

(cherry picked from commit 2add0e6)
  • Loading branch information
fredrikekre authored and mortenpi committed Jan 27, 2019
1 parent 2055205 commit f50300a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Expanders.jl
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ function Selectors.runner(::Type{EvalBlocks}, x, page, doc)
sandbox = Module(:EvalBlockSandbox)
cd(dirname(page.build)) do
result = nothing
for (ex, str) in Utilities.parseblock(x.code, doc, page)
for (ex, str) in Utilities.parseblock(x.code, doc, page; keywords = false)
try
result = Core.eval(sandbox, ex)
catch err
Expand Down Expand Up @@ -485,7 +485,7 @@ function Selectors.runner(::Type{ExampleBlocks}, x, page, doc)
else
code = x.code
end
for (ex, str) in Utilities.parseblock(code, doc, page)
for (ex, str) in Utilities.parseblock(code, doc, page; keywords = false)
(value, success, backtrace, text) = Utilities.withoutput() do
cd(dirname(page.build)) do
Core.eval(mod, Expr(:(=), :ans, ex))
Expand Down Expand Up @@ -543,7 +543,7 @@ function Selectors.runner(::Type{REPLBlocks}, x, page, doc)
mod = get!(() -> get_new_sandbox(sym), page.globals.meta, sym)
code = split(x.code, '\n'; limit = 2)[end]
result, out = nothing, IOBuffer()
for (ex, str) in Utilities.parseblock(x.code, doc, page)
for (ex, str) in Utilities.parseblock(x.code, doc, page; keywords = false)
buffer = IOBuffer()
input = droplines(str)
(value, success, backtrace, text) = Utilities.withoutput() do
Expand Down

0 comments on commit f50300a

Please sign in to comment.