public void CollectMethodInformation() { String boundTo; String name; bool isStatic; ASTUtils.CollectMethodInformation("simple_name", out boundTo, out name, out isStatic); Assert.AreEqual(null, boundTo); Assert.AreEqual("simple_name", name); Assert.IsFalse(isStatic); ASTUtils.CollectMethodInformation("self.simple_name", out boundTo, out name, out isStatic); Assert.AreEqual(null, boundTo); Assert.AreEqual("simple_name", name); Assert.IsTrue(isStatic); ASTUtils.CollectMethodInformation("IList.Add", out boundTo, out name, out isStatic); Assert.AreEqual("IList", boundTo); Assert.AreEqual("Add", name); Assert.IsFalse(isStatic); ASTUtils.CollectMethodInformation("System::Collection::IList.Add", out boundTo, out name, out isStatic); Assert.AreEqual("System::Collection::IList", boundTo); Assert.AreEqual("Add", name); Assert.IsFalse(isStatic); }
public MethodDefinitionStatement(ISymbolTable parentScope, AccessLevel accessLevel, String fullname) : base(NodeType.MethodDefinition) { statements = new StatementCollection(this); nameScope = new SymbolTable(ScopeType.Method, parentScope); this.fullname = fullname; this.accessLevel = accessLevel; String boundToName; ASTUtils.CollectMethodInformation(fullname, out boundToName, out name, out isStatic); if (boundToName != null) { boundTo = new TypeReference(":" + boundToName); } isConstructor = "initialize".Equals(fullname); }