コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
            }
        }