CompileBlock() public method

public CompileBlock ( string text ) : Block
text string
return AjTalk.Language.Block
コード例 #1
0
ファイル: ProcessTests.cs プロジェクト: ajlopez/AjTalk
        public void ResumeNewProcess()
        {
            AutoResetEvent handle = new AutoResetEvent(false);
            Machine machine = new Machine();
            VmCompiler compiler = new VmCompiler();
            machine.SetGlobalObject("handle", handle);
            Block block = compiler.CompileBlock("handle !Set");

            Process process = new Process(block, null, machine);
            machine.SetGlobalObject("process", process);

            compiler.CompileBlock("process resume").Execute(machine, null);

            if (!handle.WaitOne(500))
                Assert.Fail("Process didn't run");
        }
コード例 #2
0
ファイル: AssertTests.cs プロジェクト: ajlopez/AjTalk
 public void LoadEnvironmentTests()
 {
     VmCompiler compiler = new VmCompiler();
     var block = compiler.CompileBlock(File.ReadAllText("AssertTests\\EnvironmentTests.st"));
     Assert.IsNotNull(block);
     Assert.IsTrue(block.NoConstants > 0);
 }