diff options
author | Som Snytt <som.snytt@gmail.com> | 2015-09-13 17:22:11 -0700 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2016-05-19 11:27:02 -0700 |
commit | 3cddeaa525fd6fe9860a27019fdf484297a8d3dd (patch) | |
tree | 76d1bc7142e7f28e6290d25c51c82d2df072ab41 /build.xml | |
parent | 15189d14953335f7a3a8310861d045d21ab22d48 (diff) | |
download | scala-3cddeaa525fd6fe9860a27019fdf484297a8d3dd.tar.gz scala-3cddeaa525fd6fe9860a27019fdf484297a8d3dd.tar.bz2 scala-3cddeaa525fd6fe9860a27019fdf484297a8d3dd.zip |
SI-7916: ScriptEngine support
Refactor the ScriptEngine support to an adaptor atop the
IMain API.
Allow references to resolve to context attributes. (The
attributes must be defined at compilation time, though
they may resolve to updated values at evaluation time.)
This means that attributes are not bound statically in
REPL history. In particular, we forgo the trick of binding
attributes named "name: Type" as typed values.
Instead, an `x` bound in dynamic context is injected into
the script as a dynamic selection `$ctx.x` where `ctx`
performs the look-up in the script context.
When a compiled script is re-evaluated, a new instance of
the script class is created and defined symbols are
rebound.
The context stdout writer is handled with `Console.withOut`,
with bytes decoded using the default charset.
Compilation errors are thrown as ScriptException with the
first reported error.
This commit doesn't attempt dynamic selection from objects
in context. Currently, script must cast.
Diffstat (limited to 'build.xml')
-rw-r--r-- | build.xml | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1163,7 +1163,7 @@ TODO: </pre> <!-- JSR-223 support introduced in 2.11 --> <jar-opts> - <service type="javax.script.ScriptEngineFactory" provider="scala.tools.nsc.interpreter.IMain$Factory"/> + <service type="javax.script.ScriptEngineFactory" provider="scala.tools.nsc.interpreter.Scripted$Factory"/> </jar-opts> </staged-pack> </target> |