/// <remarks> /// Errors are reported to the specified listener. /// Returns <c>null</c> if the parser cannot compile the code due to errors. /// </remarks> public CompiledCode Compile(ErrorListener errorListener) { ContractUtils.RequiresNotNull(errorListener, nameof(errorListener)); return(CompileInternal(null, errorListener)); }
public ErrorListenerProxySink(ScriptSource source, ErrorListener listener) { _listener = listener; _source = source; }
public static Object Execute(this ScriptSource aScriptSource, ESCompilerOptions compilerOptions, ErrorListener errorListener, ScriptScope scriptScope, Object[] arguments, out TimeSpan durationToRun) { var compiledCode = aScriptSource.Compile(compilerOptions, errorListener); var essenceScriptCode = compiledCode.essenceScriptCode(); if (essenceScriptCode == null) { durationToRun = TimeSpan.Zero; return(null); } var value = essenceScriptCode.Run(scriptScope.scope(), arguments); durationToRun = essenceScriptCode.DurationToRun; return(value); }
public static Object Execute(this ScriptSource aScriptSource, ESCompilerOptions compilerOptions, ErrorListener errorListener, ScriptScope scriptScope, Object[] arguments) { var compiledCode = aScriptSource.Compile(compilerOptions, errorListener); var essenceScriptCode = compiledCode.essenceScriptCode(); if (essenceScriptCode == null) { return(null); } return(essenceScriptCode.Run(scriptScope.scope(), arguments)); }