Exemple #1
0
        public Result EvaluateWithinBlock(List <Mnemonic> mnemonics, string block)
        {
            if (_requestForStop)
            {
                return(new Result());
            }

            _stack.StartScope(block);
            Result r = this.Evaluate(mnemonics);

            _stack.EndScope();
            return(r);
        }
Exemple #2
0
        public void RemebersTheVaraibleValueAfterModificationInSubScope()
        {
            var sut = new GlobalScope(null, "a");

            sut.SetVariable("a", new String("bottom"), false);

            sut.StartScope();
            sut.SetVariable("a", new String("derived"), true);
            var innerAa =
                sut
                .GetVariable("a", new Runtime(new Processors())).Get(new Runtime(new Processors())) as String;

            Assert.Equal("derived", innerAa.Value);
            sut.EndScope();

            var a = sut.GetVariable("a", new Runtime(new Processors())).Get(new Runtime(new Processors())) as String;

            Assert.Equal("bottom", a.Value);
        }