Exemple #1
0
        private static object Eval(AphidInterpreter interpreter, string code)
        {
            interpreter.EnterScope();

            try
            {
                interpreter.Interpret(code);

                return(interpreter.GetReturnValue());
            }
            finally
            {
                interpreter.LeaveScope();
            }
        }
Exemple #2
0
        public App(Stream input, Stream output)
            : base(input, output)
        {
            _documents          = new TextDocumentManager();
            _documents.Changed += Documents_Changed;
            _interpreter        = new AphidInterpreter();
            _interpreter.Interpret(@"
                #'std';
                #'io/compression';
                #'gui/winforms';
                #'gui/wpf';
                #'system/cryptography';
                #'system/wmi';
                #'system/machine';
                #'system/nuget';
                #'system/process';
                #'remoting/remote';
                #'remoting/ipc';
                #'net/tcp';
                #'net/udp';
                #'net/web';
                //#'meta';
                //#'compiler';
                using System;
                using System.Collections.Generic;
                using System.IO;
                using System.Linq;
                using System.Text;
                using System.Threading.Tasks;

            ");

            _interpreter.EnterScope();

            _scope = new AphidScopeObjectAutocompletionSource(_interpreter.CurrentScope);
        }
Exemple #3
0
 public void EnterScope([PexAssumeUnderTest] AphidInterpreter target)
 {
     target.EnterScope();
     // TODO: add assertions to method AphidInterpreterTest.EnterScope(AphidInterpreter)
 }