示例#1
0
文件: ScopeTests.cs 项目: plioi/rook
        public ScopeTests()
        {
            using (TypeVariable.TestFactory())
            {
                global = new GlobalScope();

                ab = new LocalScope(global);
                ab.Bind("a", Integer);
                ab.Bind("b", Integer);

                cd = new LocalScope(ab);
                cd.Bind("c", Boolean);
                cd.Bind("d", Boolean);
            }
        }
示例#2
0
文件: Scope.cs 项目: plioi/rook
 public ClassScope(Scope parent)
 {
     this.parent = parent;
     members = new BindingDictionary();
 }
示例#3
0
文件: ScopeTests.cs 项目: plioi/rook
        private static void AssertType(string expectedType, Scope scope, string key)
        {
            DataType value;

            if (scope.TryGet(key, out value))
                expectedType.ShouldEqual(value.ToString());
            else
                throw new Exception("Failed to look up the type of '" + key + "' in the Scope");
        }
示例#4
0
文件: Scope.cs 项目: plioi/rook
 public LocalScope(Scope parent)
 {
     this.parent = parent;
     locals  = new BindingDictionary();
 }