public ESScriptCode(SourceUnit sourceUnit, ESObjectSpace objectSpace, ESCompilerOptions esCompilerOptions, ErrorSink errorSink) : base(sourceUnit) { this.sourceUnit = sourceUnit; this.objectSpace = objectSpace; this.esCompilerOptions = esCompilerOptions; this.errorSink = errorSink; bindingNamespace = esCompilerOptions.getEnvironment(objectSpace); if (bindingNamespace == null) { bindingNamespace = objectSpace.SmalltalkNamespace; } }
public override CompilerOptions GetCompilerOptions(Scope scope) { Assert.NotNull(scope); ESCompilerOptions options = (ESCompilerOptions)GetCompilerOptions(); ScopeExtension scopeBoundParameters = scope.GetExtension(ContextId); if (scopeBoundParameters != null) { // Combine scope parameters with compiler options } return(options); }
protected override Object runScript(ScriptEngine engine, ESCompilerOptions compilationOptions, NamespaceObject environment) { var script = engine.CreateScriptSourceFromPathSuffix(pathnameSuffix); if (script == null) { var message = "Script not found: " + pathnameSuffix; Console.WriteLine(message); return(message); } else { try { return(script.Execute(compilationOptions, scriptArgs, out durationToRun)); } catch (InvalidFunctionCallException ex) { var message = "Script argument mismatch: " + pathnameSuffix; Console.WriteLine(message); return(message); } } }
protected override Object runScript(ScriptEngine engine, ESCompilerOptions compilationOptions, NamespaceObject environment) { var script = engine.CreateScriptSourceFromString(text); return(script.Execute(compilationOptions, scriptArgs, out durationToRun)); }
protected abstract Object runScript(ScriptEngine engine, ESCompilerOptions compilationOptions, NamespaceObject environment);
public ESMethodScriptCode(SourceUnit sourceUnit, ESObjectSpace objectSpace, ESCompilerOptions esCompilerOptions, ErrorSink errorSink) : base(sourceUnit, objectSpace, esCompilerOptions, errorSink) { messageReceiver = esCompilerOptions.Receiver; }
public ESBlockScriptCode(SourceUnit sourceUnit, ESObjectSpace objectSpace, ESCompilerOptions esCompilerOptions, ErrorSink errorSink) : base(sourceUnit, objectSpace, esCompilerOptions, errorSink) { }