-
-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preserve scope of Symbol
to fix #1128
#1238
Conversation
Replace `Core.eval` with `Docs.Binding`
Thanks! Can you see if it's easy to add a test to Lines 146 to 150 in aef57ba
You might want to create a test module to run the doc queries in: m = Module()
Core.eval(m, quote
"Look at me!"
f(x) = x
...
end)
Pluto.PlutoRunner.doc_fetcher("sqrt", m)
Pluto.PlutoRunner.doc_fetcher("f", m)
... |
Oh I did not notice you had instructions for local module, and I struggled on it for some time. Now I added the tests. I also noticed the expression "m.x" is also untested, but I could not properly test it in a local module, so I marked them as broken. |
You can create modules inside modules: Core.eval(m, quote
module Hello
"fun"
f(x) = x
end
end)
Core.eval(m, :(Hello.f)) |
julia> Core.eval(m, quote
module Hello
"fun"
f(x) = x
end
end)
ERROR: syntax: "module" expression not at top level
Stacktrace:
[1] top-level scope
@ none:1
[2] eval(m::Module, e::Any)
@ Core .\boot.jl:360
[3] top-level scope
@ REPL[89]:1 This also occurs if I use it in a .jl file. |
Ah I see, you can't wrap it in a Core.eval(m, :(
module Hello
"fun"
f(x) = x
end
))
Core.eval(m, quote
g(x) = x
end)
Core.eval(m, :(Hello.f)) |
Thanks! |
Replace
Core.eval
withDocs.Binding
for SymbolsFix #1128