public async Task <DynValue> ExecuteAsync(string sourceCode, CancellationToken token) { Parser.LoadSource(sourceCode); var node = Parser.Parse(); try { return(await Task.Run(async() => await VisitAsync(node, token), token)); } catch (ExitStatementException) { CallStack.Clear(); LoopStack.Clear(); return(DynValue.Zero); } }
public DynValue Execute(string sourceCode) { Parser.LoadSource(sourceCode); var node = Parser.Parse(); try { return(Visit(node)); } catch (ExitStatementException) { CallStack.Clear(); LoopStack.Clear(); return(DynValue.Zero); } }